Find the Fourier series of the function$\ f(x) = x^2; 0 < x < 2\pi $ of period $\ 2\pi $ and find the sum of the infinite series $$\ (i) $$ $$\sum_{n=1}^\infty \frac{1}{n^2}$$ $$\ (ii) $$ $$\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}$$
I have tried to solve the second part of the math using fourier cosine series.My point of view was that the function is even and it is defined over $\ [0,2\pi]$ as like the half range fourier function defined over [0,L].
Cosine Series: $\ f(x) =\frac{a_0}{2} +\sum_{n=1}^\infty a_n\cos \frac{n\pi x}{L} $
$\ a_0=\frac{2}{\pi} \int_0^\pi x^2 dx =\frac{2\pi^2}{3}$
$\ a_n = \frac{2}{\pi} \int_0^\pi x^2 \cos nx dx =\frac{2}{\pi}[\frac{x^2}{n}\sin nx +\frac{2x\ cosnx}{n^2} -\frac{2}{n^3}\ sinnx]_0^\pi $
$\ =\frac{2}{\pi} \frac{2\pi}{n^2} (-1)^n $ $\ =\frac{4}{n^2} (-1)^n $
$\ f(0)=\frac{f_L(0)+f_R(0)}{2}=0 $ [I am not sure about this line]
$\ f(x) =\frac{\pi^2}{3} +\sum_{n=1}^\infty \frac{4}{n^2} (-1)^n \ cos nx $
$\ f(0)=\frac{\pi^2}{3}+4\sum_{n=1}^\infty \frac{1}{n^2} (-1)^n $
$\ 0= \frac{\pi^2}{3} + 4 \sum_{n=1}^\infty \frac{1}{n^2} (-1)^n $
$\ \sum_{n=1}^\infty \frac{1}{n^2} (-1)^n = -\frac{\pi^2}{12} $
$\ \sum_{n=1}^\infty \frac{1}{n^2} (-1)^{n+1} = \frac{\pi^2}{12} $