Theorem: Fourier Series/Pi Squared minus x Squared over Minus Pi to Pi

Let $\map f x$ be the real function defined on $\openint {-\pi} \pi$ as:
:400pxthumbright$\map f x$ and its $4$th approximation
:$\map f x = \pi^2 - x^2$
$f$ can be expressed as a half-range Fourier cosine series thus:
{{begin-eqn}}
{{eqn | l = \map f x
      | o = \sim
      | r = \frac {2 \pi^2} 3 + 4 \sum_{n \mathop = 1}^\infty \paren {-1}^{n - 1} \frac {\cos n x} {n^2}
      | c = 
}}
{{eqn | r = \frac {2 \pi^2} 3 + 4 \paren {\cos x - \frac 1 4 \cos 2 x + \frac 1 9 \cos 3 x - \cdots}
      | c = 
}}
{{end-eqn}}

Proof:
We have that:
:$\pi^2 - \paren {-x}^2 = \pi^2 - x^2$
and so $\map f x$ is even on $\openint {-\pi} \pi$.
It follows from Fourier Series for Even Function over Symmetric Range:
:$\ds \map f x \sim \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty a_n \cos n x$
where for all $n \in \Z_{> 0}$:
:$a_n = \ds \frac 2 \pi \int_0^\pi \map f x \cos n x \rd x$
Thus by definition of $f$:
{{begin-eqn}}
{{eqn | l = a_0
      | r = \frac 2 \pi \int_0^\pi \map f x \rd x
      | c = Cosine of Zero is One
}}
{{eqn | r = \frac 2 \pi \int_0^\pi \paren {\pi^2 - x^2} \rd x
      | c = Definition of $f$
}}
{{eqn | r = \frac 2 \pi \intlimits {\pi^2 x - \frac {x^3} 3} 0 \pi
      | c = Primitive of Power
}}
{{eqn | r = \frac 2 \pi \paren {\paren {\pi^3 - \frac {\pi^3} 3} - \paren {0 - \frac 0 3} }
      | c = 
}}
{{eqn | r = \frac 2 \pi \paren {\frac {2 \pi^3} 3}
      | c = 
}}
{{eqn | r = \frac {4 \pi^2} 3
      | c = 
}}
{{end-eqn}}
{{qed|lemma}}
Then for $n > 0$:
{{begin-eqn}}
{{eqn | l = a_n
      | r = \frac 2 \pi \int_0^\pi \map f x \cos n x \rd x
      | c = 
}}
{{eqn | r = \frac 2 \pi \int_0^\pi \paren {\pi^2 - x^2} \cos n x \rd x
      | c = Definition of $f$
}}
{{eqn | r = 2 \pi \int_0^\pi \cos n x \rd x - \frac 2 \pi \int_0^\pi x^2 \cos n x \rd x
      | c = Linear Combination of Definite Integrals
}}
{{end-eqn}}
Splitting this up into two:
{{begin-eqn}}
{{eqn | o = 
      | r = 2 \pi \int_0^\pi \cos n x \rd x
      | c = 
}}
{{eqn | r = 2 \pi \intlimits {\frac {\sin n x} n} 0 \pi
      | c = Primitive of $\cos a x$
}}
{{eqn | r = 2 \pi \paren {\frac {\sin n \pi} n - \frac {\sin 0} n}
      | c = 
}}
{{eqn | r = 2 \pi \paren {0 - 0}
      | c = Sine of Multiple of Pi
}}
{{eqn | r = 0
      | c = 
}}
{{end-eqn}}
{{begin-eqn}}
{{eqn | o = 
      | r = -\frac 2 \pi \int_0^\pi x^2 \cos n x \rd x
      | c = 
}}
{{eqn | r = -\frac 2 \pi \intlimits {\frac {2 x \cos n x} {n^2} + \paren {\frac {x^2} n - \frac 2 {n^3} } \sin n x} 0 \pi
      | c = Primitive of $x^2 \cos n x$
}}
{{eqn | r = -\frac 2 \pi \paren {\paren {\frac {2 \pi \cos n \pi} {n^2} + \paren {\frac {\pi^2} n - \frac 2 {n^3} } \sin n \pi} - \paren {\frac {0 \cos 0} {n^2} + \paren {\frac {0^2} n - \frac 2 {n^3} } \sin 0} }
      | c = 
}}
{{eqn | r = -\frac 2 \pi \paren {\frac {2 \pi \cos n \pi} {n^2} }
      | c = Sine of Multiple of Pi and removing vanishing terms
}}
{{eqn | r = -\frac {4 \cos n \pi} {n^2}
      | c = 
}}
{{eqn | r = -\frac {4 \paren {-1}^n} {n^2}
      | c = Cosine of Multiple of Pi
}}
{{eqn | r = \paren {-1}^{n - 1} \frac 4 {n^2}
      | c = simplification
}}
{{end-eqn}}
{{qed|lemma}}
Finally:
{{begin-eqn}}
{{eqn | l = \map f x
      | o = \sim
      | r = \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty a_n \cos n x
      | c = 
}}
{{eqn | r = \frac 1 2 \frac {4 \pi^2} 3 + \sum_{n \mathop = 1}^\infty \paren {-1}^{n - 1} \frac 4 {n^2} \cos n x
      | c = substituting for $a_0$ and $a_n$ from above
}}
{{eqn | r = \frac {2 \pi^2} 3 + 4 \sum_{n \mathop = 1}^\infty \paren {-1}^{n - 1} \frac {\cos n x} {n^2}
      | c = simplifying
}}
{{end-eqn}}
{{qed}}