I have to calculate Fourier coefficients and write Parseval Identity of :
$ f(x)$ defined as:
$ f(x)=cos^2(x) $
if $ -\pi/2\le x\le\pi/2$
and
$ f(x)=0$
otherwhise in $L^2(-\pi, \pi)$, in the base of functions
$e_k(x) ={e^{ikx} \over \sqrt{2\pi}}$.
So,
$ {\Huge } c_k ={1\over \sqrt{2\pi}} \int_{-\pi/2}^{\pi/2} cos^2(x)\ \cdot e^{-ikx}dx={1\over 2\sqrt{2\pi}} \int_{-\pi/2}^{\pi/2} e^{-ikx}\ dx + {1\over 2\sqrt{2\pi}} \int_{-\pi/2}^{\pi/2} cos(2x)\ \cdot e^{-ikx}dx.$
Complex parts of both integrals are odd, so it remains :
${1\over 2\sqrt{2\pi}}\ {\Large (} \int_{-\pi/2}^{\pi/2}cos(kx)\ dx + \int_{-\pi/2}^{\pi/2} cos(2x)\ \cdot cos(kx)dx{\large {\Large )}}={1\over \sqrt{2\pi}}\ {\Large (} \int_{0}^{\pi/2}cos(kx)\ dx + \int_{0}^{\pi/2} cos(2x)\ \cdot cos(kx)dx{\large {\Large )}}$.
$c_k={1 \over \sqrt{2\pi}}{\huge [}{sin(k{\pi \over2}) \over k}+ {1 \over2} \int_{0}^{\pi/2} cos(k+2)x\ {\large {\Large }} + {1 \over2} \int_{0}^{\pi/2} cos(k-2)x\ {\large {\Large }}{\huge ]} $
$ c_k={1 \over \sqrt{2\pi}}{\huge (}{sin(k{\pi \over2}) \over k}+ {1 \over2}{sin(k{\pi \over2 }+\pi) \over k+2}+ {1 \over2} {sin(k{\pi \over2 }-\pi) \over k-2}{\huge )} ={1 \over \sqrt{2\pi}}{\huge (}{sin(k{\pi \over2}) \over k}- {1 \over2} {sin(k{\pi \over2 }) \over k+2}- {1 \over2} {sin(k{\pi \over2 }) \over k-2}{\huge )} $
ObviouslyI have to calculate $c_0, c_2, c_{-2}$ separately.
My problem is to adjust $c_k$ to be able to calculate $ \sum_{-\infty }^{\infty} |c_k|^2$. I thought to write
$ sin(k{\pi \over2}) = {e^{ik\pi/2} -e^{-ik\pi/2} \over 2i}$
but I still would have 3 terms . So I should calculate the module squared of a trinomial s, then take all odd/even terms...I'm not sure I procedeed correctly. Thanks in advance to anyone who will help me.