Consider the $2\pi$ periodic function $f(x) = x^2$ defined over the interval $x\in (0,2\pi].$
The Fourier expansion of $f$ is as follows: $$f(x) = \frac{4\pi^2}{3}+\sum_{n\geq 1}\left(\frac{4}{n^2}\cos(nx)-\frac{4\pi}{n}\sin(nx)\right).$$
Now I am asked to compute the sum of the series
$$\sum_{n\geq 1}\frac{1}{n^2}$$
using the expansion given above. I guess we have to set $x= 0,$ but when I do that, I do not get the correct answer ($\frac{\pi^2}{6}$). Where am I going wrong?
At $ x=0$ the Fourier series converges to $\frac {f ({-0})+f ({+0})}{2}=\frac {(2\pi)^{2}+0^{2}}{2}=2\pi^2$
Plug that into your fourier series and you get the desired result.