User:GFauxPas/Sandbox/Zeta2/FourierSeries/

Define the function:


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

And consider its representation as a Fourier series:


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

where:


 * $\displaystyle a_n = \frac 1 \pi \int_{-\pi}^{\pi} x^2 \cos n x \, \mathrm dx: n = 0, 1, 2, \ldots$


 * $\displaystyle b_n = \frac 1 \pi \int_{-\pi}^{\pi} x^2 \sin n x \, \mathrm dx: n = 0, 1, 2, \ldots$

Because $x^2$ is even and $\sin x$ is odd, their product is odd.

This implies, as the interval in question is symmetric about $0$:


 * $\displaystyle \frac 1 \pi \int_{-\pi}^{\pi} x^2 \sin n x \, \mathrm dx = 0$,

So:


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

Because $x^2$ is even and $\cos x$ is even, their product is even.

This implies, as the interval in question is symmetric about $0$:


 * $\displaystyle a_n = \frac 1 \pi \int_{-\pi}^{\pi} x^2 \cos n x \, \mathrm dx = \frac 2 \pi \int_{0}^{\pi} x^2 \cos n x \, \mathrm dx$

For $n = 0$:

for $n \ge 1$:

Put $a_0$ and $a_n$ into the Fourier series:


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

Put $x = \pi$: