Solution (source code)

= Solution
{c}

The <Fourier cosine series> and <Fourier sine series> use the respective forms
$$
C_f(x)=\frac{a_0}{2}+\sum_{n=1}^\infty a_n\cos(nx),\qquad
S_f(x)=\sum_{n=1}^\infty b_n\sin(nx).
$$
Their <Fourier coefficients>, obtained from <Fourier orthogonality>, are
$$
\boxed{a_n=\frac2\pi\int_0^\pi f(t)\cos(nt)\,dt\quad(n\geq0)},
\qquad
\boxed{b_n=\frac2\pi\int_0^\pi f(t)\sin(nt)\,dt\quad(n\geq1)}.
$$
In particular the constant term is $a_0/2=\pi^{-1}\int_0^\pi f(t)\,dt$. The <Fourier cosine series> is the <Fourier series> of the <even extension> $f(|x|)$, made $2\pi$-periodic. The <Fourier sine series> is the <Fourier series> of the <odd extension>, equal to $f(x)$ for $0<x<\pi$ and $-f(-x)$ for $-\pi<x<0$, again made $2\pi$-periodic.