1. ## Fouriers series

Expand the function $f(x)=x\sin{x}$ into Fouriers series on an interval $<-\pi,\pi>$

In my book, the solution of this example starts with.

$f(x)=\sin{x}\sum^{\infty}_{n=1}\frac{2}{n}(-1)^{n+1}\sin{nx}$

I know $b_n$ i 0 because f(x) is an even function. But where did they get the $(-1)^{n+1}$ from? Is that the solution for $a_n$?

2. Originally Posted by Pinsky
Expand the function $f(x)=x\sin{x}$ into Fouriers series on an interval $<-\pi,\pi>$
If $\frac{a_0}{2} + \sum_{n=1}^{\infty} a_n \cos nx + b_n\sin nx$

Then $a_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x) \cos (nx) dx$ for $n\geq 0$ and $b_n = 0$ (because it is an even function).

Thus, $a_n = \frac{2}{\pi}\int_0^{\pi} x\sin x \cos (nx) dx$ for $n\geq 0$. Do this by integration by parts.