Fourier Series/x squared over Minus Pi to Pi

Theorem
For $x \in \openint {-\pi} \pi$:
 * $\displaystyle x^2 = \frac {\pi^2} 3 + \sum_{n \mathop = 1}^\infty \paren {\paren {-1}^n \frac 4 {n^2} \cos n x}$

Proof
From Even Power is Even Function, $x^2$ is an even function.

By Fourier Series for Even Function over Symmetric Range, we have:


 * $\displaystyle x^2 \sim \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty a_n \cos n x$

where:

Then:

Substituting for $a_n$ in $(1)$:


 * $\displaystyle x^2 = \frac {\pi^2} 3 + \sum_{n \mathop = 1}^\infty \paren {\paren {-1}^n \frac 4 {n^2} \cos n x}$

as required.