The Fourier series of $\cos^2(x)={1\over2}+{1\over2}\cos(2x)$ is $a_0=1, a_2={1\over2}$ and the other terms are zero since $$Ff(x)={a_0\over2}+\sum\limits_{k=1}^{\infty}[a_k\cos(kx)+b_k\sin(kx)]$$
So in order to calculate $\int\limits_{-\pi}^\pi \cos^4(x)dx $ we use Parseval's identity :
$$\|f\|^2={1\over T}\int\limits_{-T/2}^{T/2}f^2(x)dx=a_0^2+{1\over2}\sum\limits_{k=1}^{\infty}a_k^2+b_k^2$$
But what I get is false:
$${1\over 2\pi}\int\limits_{-\pi}^\pi (\cos^2(x))^2dx=1+{1\over2}\Big({1\over2}\Big)^2={9\over 8}$$ $$\int\limits_{-\pi}^\pi \cos^4(x)dx=2\pi\cdot{9\over8}={9\pi\over4}$$
But it should be ${3\over4}\pi$
What am I doing wrong?
It should be that $$ \frac{1}{L}\int_{-L}^L f^2(x)\, dx = \frac{a_0^2}{2} + \sum_{n=1}^\infty \left(a_n^2 + b_n^2\right). $$ Hence, $$ \frac{1}{\pi}\int_{-\pi}^\pi \cos^4(x)\, dx = \frac{a_0^2}{2} + a_1^2 = \frac{1}{2} + \left(\frac{1}{2}\right)^2 = \frac{1}{2} + \frac{1}{4} = \frac{3}{4} $$ and the desired answer follows.