Solution (source code)

= Solution

For period $2$, use the <Fourier series> convention
$$
f(x)\sim\frac{a_0}{2}+\sum_{n=1}^{\infty}[a_n\cos(n\pi x)+b_n\sin(n\pi x)].
$$
The <Fourier coefficients> have prefactor $1$ on $[-1,1]$. First, $a_0=\int_{-1}^{1}e^x dx=2\sinh1$. For $q=n\pi$ the useful <antiderivatives> are
$$
\int e^x\cos(qx)dx=\frac{e^x[\cos(qx)+q\sin(qx)]}{1+q^2},\qquad
\int e^x\sin(qx)dx=\frac{e^x[\sin(qx)-q\cos(qx)]}{1+q^2}.
$$
At the endpoints $\sin(n\pi)=0$ and $\cos(n\pi)=(-1)^n$, so
$$
a_n=\frac{2(-1)^n\sinh1}{1+n^2\pi^2},\qquad
b_n=-\frac{2n\pi(-1)^n\sinh1}{1+n^2\pi^2}.
$$
Consequently, on $-1<x<1$,
$$
\boxed{e^x=\sinh1+2\sinh1\sum_{n=1}^{\infty}
\frac{(-1)^n[\cos(n\pi x)-n\pi\sin(n\pi x)]}{1+n^2\pi^2}.}
$$
The <Dirichlet-Jordan convergence theorem> justifies equality at every point of <continuity> of the periodic extension. At odd integers the extension has a <jump discontinuity> between $e$ and $e^{-1}$, so the series converges to their average $\cosh1$, regardless of any assigned endpoint value. This is the $\kappa=L=1$ case of the <Fourier series of a periodically extended exponential>.