hello

I need to find the fourier sine series for the odd function:

defined on $\displaystyle [0,\pi]. $

$\displaystyle f(x) = |x-\frac{\pi}{2}| - \frac{\pi}{2}. $

$\displaystyle f(x) $ is periodic of period $\displaystyle 2\pi $

I tried to define the function different(to get rid of the absolute value)

$\displaystyle f(x) = -x $if$\displaystyle 0<=x<=\frac{\pi}{2} $

$\displaystyle x-\pi $if$\displaystyle \frac{\pi}{2}<x<=\pi

$

I set up the integral for $\displaystyle b_{n} $.

in this case$\displaystyle L = \pi $ so:

$\displaystyle b_{n} = \frac{2}{L}\int_{0}^{\pi}f(x)sin(\frac{{\pi}nx}{L} )dx =

\frac{2}{\pi}\int_{0}^\frac{\pi}{2}-xsin(nx)}dx $

$\displaystyle + \frac{2}{\pi}\int_{\frac{\pi}{2}}^{\pi}(x-\pi)sin(nx)dx $

and the result I got was incorrect.

I went over and over this problem but couldn't find the mistake.

help would be appreciated.