# Fourier Series/Pi Squared minus x Squared over Minus Pi to Pi

## Theorem

Let $f \left({x}\right)$ be the real function defined on $\left({-\pi \,.\,.\, \pi}\right)$ as:

$f \left({x}\right) = \pi^2 - x^2$

Then its Fourier series can be expressed as:

 $\displaystyle f \left({x}\right)$ $\sim$ $\displaystyle \frac {2 \pi^2} 3 + 4 \sum_{n \mathop = 1}^\infty \left({-1}\right)^{n - 1} \frac {\cos n x} {n^2}$ $\displaystyle$ $=$ $\displaystyle \frac {2 \pi^2} 3 + 4 \left({\cos x - \frac 1 4 \cos 2 x + \frac 1 9 \cos 3 x - \cdots}\right)$

## Proof

We have that:

$\pi^2 - \left({-x}\right)^2 = \pi^2 - x^2$

and so $f \left({x}\right)$ is even on $\left({-\pi \,.\,.\, \pi}\right)$.

It follows from Fourier Series for Even Function over Symmetric Range:

$\displaystyle f \left({x}\right) \sim \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty a_n \cos n x$

where for all $n \in \Z_{> 0}$:

$a_n = \displaystyle \frac 2 \pi \int_0^\pi f \left({x}\right) \cos n x \rd x$

Thus by definition of $f$:

 $\displaystyle a_0$ $=$ $\displaystyle \frac 2 \pi \int_0^\pi f \left({x}\right) \rd x$ Cosine of Zero is One $\displaystyle$ $=$ $\displaystyle \frac 2 \pi \int_0^\pi \left({\pi^2 - x^2}\right) \rd x$ Definition of $f$ $\displaystyle$ $=$ $\displaystyle \frac 2 \pi \left[{\pi^2 x - \frac {x^3} 3}\right]_0^\pi$ Primitive of Power $\displaystyle$ $=$ $\displaystyle \frac 2 \pi \left({\left({\pi^3 - \frac {\pi^3} 3}\right) - \left({0 - \frac 0 3}\right)}\right)$ $\displaystyle$ $=$ $\displaystyle \frac 2 \pi \left({\frac {2 \pi^3} 3}\right)$ $\displaystyle$ $=$ $\displaystyle \frac {4 \pi^2} 3$

$\Box$

Then for $n > 0$:

 $\displaystyle a_n$ $=$ $\displaystyle \frac 2 \pi \int_0^\pi f \left({x}\right) \cos n x \rd x$ $\displaystyle$ $=$ $\displaystyle \frac 2 \pi \int_0^\pi \left({\pi^2 - x^2}\right) \cos n x \rd x$ Definition of $f$ $\displaystyle$ $=$ $\displaystyle 2 \pi \int_0^\pi \cos n x \rd x - \frac 2 \pi \int_0^\pi x^2 \cos n x \rd x$ Linear Combination of Definite Integrals

Splitting this up into two:

 $\displaystyle$  $\displaystyle 2 \pi \int_0^\pi \cos n x \rd x$ $\displaystyle$ $=$ $\displaystyle 2 \pi \left[{\frac {\sin n x} n}\right]_0^\pi$ Primitive of $\cos a x$ $\displaystyle$ $=$ $\displaystyle 2 \pi \left({\frac {\sin n \pi} n - \frac {\sin 0} n}\right)$ $\displaystyle$ $=$ $\displaystyle 2 \pi \left({0 - 0}\right)$ Sine of Multiple of Pi $\displaystyle$ $=$ $\displaystyle 0$

 $\displaystyle$  $\displaystyle -\frac 2 \pi \int_0^\pi x^2 \cos n x \rd x$ $\displaystyle$ $=$ $\displaystyle -\frac 2 \pi \left[{\frac {2 x \cos n x} {n^2} + \left({\frac {x^2} n - \frac 2 {n^3} }\right) \sin n x}\right]_0^\pi$ Primitive of $x^2 \cos n x$ $\displaystyle$ $=$ $\displaystyle -\frac 2 \pi \left({\left({\frac {2 \pi \cos n \pi} {n^2} + \left({\frac {\pi^2} n - \frac 2 {n^3} }\right) \sin n \pi}\right) - \left({\frac {0 \cos 0} {n^2} + \left({\frac {0^2} n - \frac 2 {n^3} }\right) \sin 0}\right)}\right)$ $\displaystyle$ $=$ $\displaystyle -\frac 2 \pi \left({\frac {2 \pi \cos n \pi} {n^2} }\right)$ Sine of Multiple of Pi and removing vanishing terms $\displaystyle$ $=$ $\displaystyle -\frac {4 \cos n \pi} {n^2}$ $\displaystyle$ $=$ $\displaystyle -\frac {4 \left({-1}\right)^n} {n^2}$ Cosine of Multiple of Pi $\displaystyle$ $=$ $\displaystyle \left({-1}\right)^{n - 1} \frac4 {n^2}$ simplification

$\Box$

Finally:

 $\displaystyle f \left({x}\right)$ $\sim$ $\displaystyle \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty a_n \cos n x$ $\displaystyle$ $=$ $\displaystyle \frac 1 2 \frac {4 \pi^2} 3 + \sum_{n \mathop = 1}^\infty \left({-1}\right)^{n - 1} \frac 4 {n^2} \cos n x$ substituting for $a_0$ and $a_n$ from above $\displaystyle$ $=$ $\displaystyle \frac {2 \pi^2} 3 + 4 \sum_{n \mathop = 1}^\infty \left({-1}\right)^{n - 1} \frac {\cos n x} {n^2}$ simplifying

$\blacksquare$