Solution (source code)

= Solution

For the period-two <Fourier series> of a <square-integrable function> $w$, <Parseval's identity> states
$$
\int_{-1}^1|w(x)|^2\,dx=\frac{|a_0|^2}{2}+\sum_{n=1}^{\infty}\bigl(|a_n|^2+|b_n|^2\bigr).
$$
For $w=f-g$, write $s=\sinh1$. Its coefficients are $a_0=2s$, $a_n=2(-1)^ns/(1+n^2\pi^2)$ and $b_n=n\pi a_n$, because $g$ is subtracted. Therefore
$$
\begin{aligned}
\int_{-1}^1(f-g)^2\,dx
&=2s^2+4s^2\sum_{n=1}^{\infty}\frac{1+n^2\pi^2}{(1+n^2\pi^2)^2}\\
&=2s^2\left[1+2\sum_{n=1}^{\infty}\frac1{1+n^2\pi^2}\right]\\
&=2\sinh1\cosh1=\boxed{\sinh2}.
\end{aligned}
$$
The sum was obtained in part (a). As a separate check, $f-g=e^{-x}$ in the interval, whose square has integral $\int_{-1}^1e^{-2x}\,dx=\sinh2$. Endpoint jumps have no effect on this <integral>.