Fourier Series/4 minus x squared over Range of 2

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


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

Then its Fourier series can be expressed as:


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

Proof
By definition of Fourier series:


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

where:

for all $n \in \Z_{>0}$.

Thus:

For $n > 0$:

Splitting this up into bits:

Reassembling $a_n$ from the remaining non-vanishing terms:

Now for the $\sin n \pi x$ terms:

Splitting this up into bits:

Reassembling $b_n$ from the remaining non-vanishing terms:

Finally: