Deriving formula from Fourier series: $\frac{\pi^2}{12} = \sum\limits_{n=1}^{\infty} \frac{(-1)^{n+1}}{n^2}$ The equation/formula $$ \frac{\pi^2}{12} = \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n^2}$$ is to be derived.
I know that the Fourier expansion of $f(x)=x$ for $x \in (-\pi,\pi)$ is $$f(x)=x=\sum_{n=1}^{\infty} \frac{2\,(-1)^{n+1}}{n}\,\sin{nx}$$ and there was an example of how for $x=\frac{\pi}{2}$ you'd get $\frac{\pi}{4} = 1-\frac{1}{3}+\frac{1}{5}- \cdots = \sum_{l=0}^\infty \frac{(-1)^{l}}{2l+1}$, but here it's not the square of $n$. I got a Fourier series for $$f_1(x)=x^2=\sum_{n=1}^{\infty} \frac{4\,(-1)^n}{n^2}\,\cos{nx}$$ but then the exponent of the $(-1)$ isn't the same. 
I'm obviously missing something, so any hints are appreciated.


This does not directly answer the question posed in the OP regarding the use of Fourier Series to prove that 
$$\frac{\pi^2}{12}=\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2} \tag 1$$
But, I thought it might be instructive to present an approach that relies only on the Basel Problem
$$\frac{\pi^2}{6}=\sum_{n=1}^\infty \frac{1}{n^2} \tag 2$$
which was proven by Euler without use of Fourier Series.  To that end, we proceed.

Note that we can write the series in $(1)$ as 
$$\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2}=\sum_{n=1}^\infty \left(\frac{1}{(2n-1)^2}-\frac{1}{(2n)^2}\right) \tag 3$$
Alongside this result, we can write the series in $(2)$ as 
$$\begin{align}
\frac{\pi^2}{6}&=\sum_{n=1}^\infty \frac{1}{n^2} \\\\
&=\sum_{n=1}^\infty \left(\frac{1}{(2n-1)^2}+\frac{1}{(2n)^2}\right) \\\\
&=\sum_{n=1}^\infty \left(\frac{1}{(2n-1)^2}-\frac{1}{(2n)^2}\right)+2\sum_{n=1}^\infty\frac{1}{(2n)^2} \\\\
&=\sum_{n=1}^\infty \left(\frac{1}{(2n-1)^2}-\frac{1}{(2n)^2}\right)+\frac12\sum_{n=1}^\infty\frac{1}{n^2} \\\\
&=\sum_{n=1}^\infty \left(\frac{1}{(2n-1)^2}-\frac{1}{(2n)^2}\right)+\frac{\pi^2}{12}\\\\
\frac{\pi^2}{12}&=\sum_{n=1}^\infty \left(\frac{1}{(2n-1)^2}-\frac{1}{(2n)^2}\right)\tag 4
\end{align}$$
Substituting $(4)$ into $(3)$ yields the coveted result.
