fourier series, parsevel's identity i need to solve the following question using parsevel's identity.


*

*$\displaystyle\int_{-\pi}^{\pi} \cos^{4} x\, dx = \frac{3\pi}{4}$.

*$\displaystyle\int_{-\pi}^{\pi} \cos^{6} x\, dx = \frac{5\pi}{8}$.
I tried using $f\left(x\right)$ as $\cos^{2}\left(x\right)$ but didn't get the answer after finding $a_{0}$, $a_n{ }$, and $b_{n}$.
I got $a_{0}=1$, $a_{n}=0$, $b_{n}=0$.
Please help me.
I know that I have to use the Parseval's Indentity relation but I don't know whose function's expansion makes this possible.
 A: Okay, if $f(x)=\cos^2(x)$, then its Fourier series is
$f(x)=\sum_{n \in \mathbb{Z}}c_ne^{inx}$, with
$$c_n=\frac{1}{2\pi}\int_{-\pi}^\pi \cos^2(x)e^{-in x}dx=\frac{1}{4\pi}\int_{-\pi}^\pi \cos(2x)+1e^{-in x}dx=\frac{1}{4\pi}\begin{cases}
\pi & \text{ if } n=\pm 2 \\ 
0 & \text{ otherwise}  
\end{cases}+\frac{1}{4\pi} \begin{cases}
2\pi & \text{ if } n=0\\ 
0 & \text{ otherwise}  
\end{cases}$$
Thus, applying Parseval's identity,
$$\int_{-\pi}^\pi |\cos^2(x)|^2dx=\int_{-\pi}^\pi\cos^4(x)dx=2\pi\sum_{n=-\infty}^\infty \left|c_n\right|^2=2\pi \left( \frac{1}{16}+\frac{1}{16}+\frac{1}{4}\right)=\frac{3}{4}\pi.$$
The other one is tackled similarly ($c_n$ for $f(x)= \cos^3(x)$ is just a bit harder to work out), though this seems like overkill: just use double angle formulae to work out the original integrals!
A: Using the identity $\displaystyle \cos(x)=\frac{e^{-2\pi i x}+e^{2\pi i x}}{2}$ we can expand $\cos^2x$ as
$$\cos^2x=\frac{(e^{-2\pi i x})^2+2(e^{-2\pi i x})(e^{2\pi i x})+(e^{2\pi i x})^2}{4}=\frac{1}{4}e^{-4\pi i x}+\frac{1}{2}+\frac{1}{4}e^{4\pi i x}.$$
Therefore Parseval's tells us
$$\frac{1}{2\pi}\int_{-\pi}^\pi |\cos^2 x|^2dx=\cdots+0^2+\frac{1}{4^2}+0^2+0^2+0^2+\frac{1}{2^2}+0^2+0^2+0^2+\frac{1}{4^2}+0^2+\cdots$$
Now can you do $f(x)=\cos^3x$ on your own?
