Solution (source code)

= Solution

With the standard real normalization, the <Fourier series> of a period-$2L$ <function> is
$$
f(x)\sim\frac{a_0}{2}+\sum_{n=1}^{\infty}\left[a_n\cos\frac{n\pi x}{L}+b_n\sin\frac{n\pi x}{L}\right],
$$
where
$$
\boxed{a_n=\frac1L\int_{-L}^Lf(x)\cos\frac{n\pi x}{L}\,dx\quad(n\geq0),\qquad
b_n=\frac1L\int_{-L}^Lf(x)\sin\frac{n\pi x}{L}\,dx\quad(n\geq1).}
$$
For the <partial sum> $S_N$, <Fourier orthogonality> eliminates all cross terms. The constant term contributes $2L(a_0/2)^2$, while every squared <sine> or <cosine> integrates to $L$, giving
$$
\int_{-L}^LS_N(x)^2dx=L\frac{a_0^2}{2}+L\sum_{n=1}^N(a_n^2+b_n^2).
$$
For a square-integrable <function>, completeness of the trigonometric <orthogonal basis> in the <Hilbert space> $L^2[-L,L]$ makes $S_N\to f$ in norm. Passing to the limit proves <Parseval's identity>:
$$
\boxed{\int_{-L}^Lf(x)^2dx=L\left[\frac{a_0^2}{2}
+\sum_{n=1}^{\infty}(a_n^2+b_n^2)\right].}
$$
Square integrability is the needed hypothesis here; periodicity alone is not an integrability or convergence condition.