Fourier Series involving modulus function I've come across this problem as stated:
Let $f(x)$ be the function $f(x) = |x| + \pi$, if $-\pi < x < \pi$.
Find the exact values of the first two non-zero terms of the Fourier Series for $f(x)$.
I understand that it is an even function given that $f(-x) = |-x| + \pi = |x| + \pi = f(x)$, thus $b_n = 0$ for all $n=1,2,3...$
However, as I got stuck and referred to suggested solution, in the steps the $\pi$ was omitted from $f(x)$, leaving only $f(x) = |x|$ in the sense that when finding $a_0$, the solution took $|x|$ as $f(x)$ instead of $|x| + \pi$.
Why was the solution presented this way?
Thank you.

If $n\neq 0$, note that
$$
\int_{-\pi}^\pi \cos(nx)~dx = 0.
$$
The Fourier cosine coefficients are:
$$
\frac{1}{\pi}\int_{-\pi}^\pi f(x)\cos(nx)~dx = \frac{1}{\pi}\int_{-\pi}^\pi |x|\cos(nx)~dx + \frac{1}{\pi}\int_{-\pi}^\pi \pi\cos(nx)~dx.
$$
If $n\neq 0$, then the second integral on the RHS is zero, so
$$
\frac{1}{\pi}\int_{-\pi}^\pi f(x)\cos(nx)~dx = \frac{1}{\pi}\int_{-\pi}^\pi |x|\cos(nx)~dx.
$$
The only time we see the $\pi$ is therefore when $n=0$ and $\cos(nx) \equiv 1$.
