Solution (source code)

= Solution

Integration by parts gives the <Fourier sine series> coefficients
$$
b_n=\frac2\pi\int_0^\pi x\sin(nx)\,dx=\frac{2(-1)^{n+1}}n.
$$
Hence
$$
\boxed{x=2\sum_{n=1}^\infty\frac{(-1)^{n+1}}n\sin(nx),\qquad0<x<\pi.}
$$
The odd periodic extension is a sawtooth, equal to $x$ on $(-\pi,\pi)$ and repeated every $2\pi$; its jumps at odd multiples of $\pi$ have midpoint value zero in the Fourier series. In particular the sine series equals zero, rather than the specified endpoint value $\pi$, at $x=\pi$. The even periodic extension is the continuous triangular wave equal to $|x|$ on $[-\pi,\pi]$. Their sketches are below.

The <Parseval identity for a Hilbertian basis> for this sine expansion gives
$$
\frac2\pi\int_0^\pi x^2\,dx=\sum_{n\ge1}b_n^2
=4\sum_{n\ge1}\frac1{n^2},\qquad
\boxed{\sum_{n\ge1}n^{-2}=\pi^2/6.}
$$

\Image[/past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2013/ib/paper-1-periodic-extensions.png]
{title=Odd sawtooth and even triangular periodic extensions on minus two pi to two pi}