Find the Fourier series with period $2$ of
$$f(x) = -x,\qquad-1<x<1$$
so I find that $a_0$ and $a_n$ both are $0$ since odd functions
so the Fourier series is on the form:
$$\sum_{n=1}^{\infty}b_n\sin(n\pi x)$$
so the question is: how do I find $b_n$? I know the formula but I am not sure how to solve the definite integral which is.
$$-\int_{-1}^{1} x\sin(n\pi x)\,dx$$
thanks for any help!
$$u=x\;,\;\;u'=1\\v'=\sin n\pi x\;,\;\;v=-\frac1{n\pi}\cos n\pi x$$
so
$$\int\limits_{-1}^1x\sin n\pi x\,dx=\left.-\frac x{n\pi}\cos n\pi x\right|_{-1}^1+\frac1{n\pi}\int\limits_{-1}^1\cos n\pi x\,dx=\\$$
$$=-\frac2{n\pi}\cos n\pi+\left.\frac1{n^2\pi^2}\sin n\pi x\right|_{-1}^1=(-1)^{n+1}\frac2{n\pi}$$
and etc....