Given. $F(x)=x^2$ on $0\lt x\lt2$, extended periodically with period $p=2$ (half-period $L=1$).
Find. (a) The Fourier series of $F$. (b) Use it to prove $\pi^2/6=\sum1/n^2$.
Approach. Compute $a_0,a_n,b_n$ by direct integration over one period, then evaluate the series at the jump point $x=0$, where it converges to the average of the left- and right-hand limits.
Cosine coefficients (integrate by parts twice).
$$a_n=\int_0^2x^2\cos(n\pi x)\,dx=\dfrac{4}{n^2\pi^2}\qquad(n=1,2,3,\dots)$$
Sine coefficients.
$$b_n=\int_0^2x^2\sin(n\pi x)\,dx=-\dfrac{4}{n\pi}\qquad(n=1,2,3,\dots)$$
Assembling (a):
$$\boxed{F(x)\sim\dfrac43+\sum_{n=1}^{\infty}\left[\dfrac{4}{n^2\pi^2}\cos(n\pi x)-\dfrac{4}{n\pi}\sin(n\pi x)\right]}$$
Evaluate at the jump $x=0$ for part (b). The periodic extension has $F(0^+)=0$ and, by periodicity, $F(2^-)=4$; at a jump discontinuity the Fourier series converges to the midpoint $\tfrac12(0+4)=2$. Substituting $x=0$ into the series ($\cos0=1,\ \sin0=0$):
$$2=\dfrac43+\sum_{n=1}^{\infty}\dfrac{4}{n^2\pi^2}\ \Longrightarrow\ \sum_{n=1}^{\infty}\dfrac1{n^2}=\left(2-\dfrac43\right)\dfrac{\pi^2}{4}=\dfrac23\cdot\dfrac{\pi^2}{4}$$
$$\boxed{\dfrac{\pi^2}{6}=\sum_{n=1}^{\infty}\dfrac1{n^2}}$$
(both sides $=1.644934\ldots$ to 4 decimal places).