Solution (source code)

= Solution

The <function> is even, so each product with a <sine> is an <odd function> and all the <Fourier coefficients> $b_n$ vanish. Its constant coefficient is
$$
a_0=\frac2\pi\int_0^\pi e^x\,dx=\frac{2(e^\pi-1)}\pi.
$$
For $n\geq1$, part (a) gives the remaining <Fourier coefficients>:
$$
a_n=\frac2\pi\int_0^\pi e^x\cos(nx)\,dx=\frac{2\left[(-1)^ne^\pi-1\right]}{\pi(1+n^2)}.
$$
Consequently the <Fourier cosine series> is
$$
\boxed{f(x)=\frac{e^\pi-1}{\pi}+\frac2\pi\sum_{n=1}^{\infty}\frac{(-1)^ne^\pi-1}{1+n^2}\cos(nx).}
$$
The periodic extension is continuous, including at $\pm\pi$, and piecewise continuously differentiable. Thus the <Fourier series> equals $f$ everywhere. Its coefficients are also bounded in magnitude by a constant times $1/n^2$, which gives <absolute convergence>.