I calculated the real Fourier coefficients of $f(x) =\cos (\frac{x}{2})$ but my result does not equal the result in the solution.
Can anyone please tell me what my mistake is?
(Not relevant to the calculation below: $b_n$ vanish because $f$ is even and $a_0=0$)
Here is my calculation:
In the end, I simplify it to this expression:
$$ a_n = \begin{cases} \frac{4}{2\pi (1 - 4n^2)} & n \text{ even } \\ \frac{-4}{2\pi (1-4n^2)} & n \text{ odd}\end{cases}$$
Which again simplifies to
$$ a_n = \frac{(-1)^n 4}{2\pi (1-4n^2)} $$
And the solution states:
$$ a_n = \frac{(-1)^n 4}{\pi (1-4n^2)} $$
At first I thought I was using the wrong formula for the coefficients but for period $2\pi$ the formula is
$$ a_n = \frac{1}{\pi} \int_0^\pi f(x) \cos(nx) dx$$
So I'm just really confused. I did the calculation twice and got the same result in every step.
