Assume that $f(x)$ is periodically extended outside the original interval. Find the Fourier series of the extended function. $f(x)=2(1-x^2), -1\leq x<1$ So I find that $a_0 =\frac{4}{3}$ and to find $a_n$ I need to compute this: $$\int_{-1}^{1} 2 (1-x^2) \cos(n \pi x) dx$$ which is $$\frac{8 \sin(\pi n)-8 \pi n \cos(\pi n)}{\pi^3 n^3}$$ or simply $$\frac{-8\cos(\pi n)}{\pi^2 n^2}$$ Now I have two misunderstandings:
- Looking at the answer to this exercise: $$f(x)=\frac{4}{3}+\frac{8}{\pi^2} \Sigma _{n=1}^\infty \frac{(-1)^{n+1} \cos(n \pi x)}{n^2}$$ I conclude that I did wrong with my $a_n$ calculation.
- Where is the minus sign to my $a_n$?
The minus sign is absorbed by $(-1)^{n+1}$: you have your original $-1$, and then $\cos(\pi n) = (-1)^n$, so $a_n = \dfrac{8 (-1)^{n+1}}{\pi^2 n^2}$, and the constant (not depending on $n$) parts of the term are brought out front of the sum.