User:GFauxPas/Sandbox/Zeta2/FourierSeries/

Define the function:


 * $\map f x = x^2: -\pi \le x \le \pi$

And consider its representation as a Fourier series:


 * $\ds \map f x = \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty \paren {a_n \cos x + b_n \sin x}$

where:


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


 * $\ds b_n = \frac 1 \pi \int_{-\pi}^\pi x^2 \sin n x \rd x: 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$:


 * $\ds \frac 1 \pi \int_{-\pi}^\pi x^2 \sin n x \rd x = 0$,

So:


 * $\ds \map f x = \frac {a_0} 2 + \sum_{n \mathop = 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$:


 * $\ds a_n = \frac 1 \pi \int_{-\pi}^\pi x^2 \cos n x \rd x = \frac 2 \pi \int_0^\pi x^2 \cos n x \rd x$

For $n = 0$:

for $n \ge 1$:

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


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

Put $x = \pi$: