I want to determine $p(x)=\sum_{|n|\le4}a_{n}e^{inx}$ so that i can minimize $\int_{-\pi}^{\pi} |y(x)-p(x)|^{2} dx$.
$y(x)=(sinx)^{8}$ and im also asked to state the min.value.
I have a theorem in my book that says that it will attain its min. when $a_{n}$ are equal to the fourier coefficients $c_{n}$ of y(x). So by computing $c_{n}$ for $|n|\le4$ I get that: $p(x)=\frac{1}{128}(-28e^{2ix}+14e^{4ix}+35+14e^{-4ix}-28e^{-2ix})$
But how do I now calculate the min. value of the integral, when I plug in my p(x)? I will have the absolute value of some expressions that are not friendly squared. Any help?