[Math] Fourier Series of $\sin^2(x)$

fourier analysisfourier seriespartial differential equationsperiodic functions

I'm trying to calculate the Fourier Series of $f(x)=\sin^2(x)$.
$f$ is odd, so $a_{n}=0$ and $$b_{n}=\frac{2}{\pi}\int_{0}^{\pi}f(x)\sin(nx)dx=\frac{2}{\pi}\int_{0}^{\pi}\sin^2(x)\sin(nx)dx$$
But the integral is equal to $\frac{2(\cos(\pi n)-1)}{n(n^2-4)}$, and my book of Fourier Analysis (Folland) say that the Fourier Series of $f$ are $\frac{1}{2}\left(1-\cos(2x)\right)$. How do I come to the right answer?

Best Answer

Are you sure that your function $f(x) = \sin ^2 x$ is an odd function?

Your text book is giving you a hint to use the formula $$\sin ^2 x =\frac{1}{2}\left(1-\cos(2x)\right)$$

Related Question