Solution (source code)

= Solution

On the basic interval the graph is the pair of straight segments joining $(-\pi,0)$, $(0,1)$ and $(\pi,0)$. Its <periodic extension> is an <even> <triangular wave>.

\Image[/past-exam-of-the-mathematics-course-of-the-year-1-of-the-natural-sciences-course-of-the-university-of-cambridge/2001/paper-1-triangular-wave.png]
{title=The even triangular wave and its periodic extension}
{description=Original plot marking the basic interval and the repeated linear pieces.}

The <Fourier coefficients> satisfy $b_n=0$ by evenness, and
$$
a_0=\frac2\pi\int_0^\pi(1-x/\pi)dx=1,\qquad a_n=\frac2\pi\int_0^\pi(1-x/\pi)\cos(nx)dx=\frac{2[1-(-1)^n]}{\pi^2n^2}.
$$
For the second formula, <integration by parts> gives $\int_0^\pi x\cos(nx)dx=[(-1)^n-1]/n^2$. Only odd indices survive, giving this rescaled <Fourier cosine series of a triangular wave>:
$$
\boxed{f(x)=\frac12+\frac4{\pi^2}\sum_{m=0}^\infty\frac{\cos[(2m+1)x]}{(2m+1)^2}.}
$$
The <pointwise convergence of a piecewise smooth Fourier series> applies throughout the interval, including the continuous joined endpoints. The coefficients also imply <uniform convergence> by the <Weierstrass M-test>. At $x=0$, the value is one, so
$$
\boxed{\sum_{m=0}^\infty\frac1{(2m+1)^2}=\frac{\pi^2}8.}
$$