Minimization of integrals in real analysis For $\:a,\:b,\:c\in\mathbb{R}\:$ minimize the following integral:
$$\\\\\int_{-\pi}^{\:\pi}(\gamma-a-b\:\cos\:\gamma\:-c\:\sin\:\gamma)^2\:d\gamma$$
How do we solve this? No idea
 A: Let $f(a,b,c)$ be defined as
$$f(a,b,c)=\int_{-\pi}^\pi \left(\gamma -a-b\cos \gamma -c\sin \gamma\right)^2\,d\gamma$$
The first partial derivatives vanish at a local maximum or minimum.  We will now evaluate the three first partial derivatives.
$$\begin{align}
\frac{\partial f}{\partial a}&=-2\int_{-\pi}^\pi \left(\gamma -a-b\cos \gamma -c\sin \gamma\right)\,d\gamma\\\\
&=4\pi a \implies a=0 \\\\
\frac{\partial f}{\partial b}&=2\int_{-\pi}^\pi \left(\gamma -a-b\cos \gamma -c\sin \gamma\right) \sin \gamma \,d\gamma\\\\
&=-2\pi c +2\int_{-\pi}^\pi \gamma \sin \gamma \,d\gamma\implies c=2 \\\\
\frac{\partial f}{\partial c}&=-2\int_{-\pi}^\pi \left(\gamma -a-b\cos \gamma -c\sin \gamma\right) \cos \gamma \,d\gamma\\\\
&=2\pi b\implies b=0
\end{align}$$
The minimum value of $f$ is $f(0,0,2)=\frac23 \pi^3-4\pi$
A: This is not an answer but it is too long for a comment.
Dr. MV gave you the rigorous answer.
If you think about the problem, what it means is that, based on an infinite number of data points, you want to approximate, in the least square sense, $\gamma$ by $a+b\cos(\gamma)+c\sin(\gamma)$ over the range $[-\pi,\pi]$.
For symmetry reasons, it is obvious that the result should correspond to $a=0$ and $b=0$ and the problem simplifies a lot (to what Dr. MV answered).
According to my earlier comment, you could have computed first $$f(a,b,c,\gamma)=\int\left(\gamma -a-b\cos \gamma -c\sin \gamma\right)^2\,d\gamma$$ Expanding and using double angle identities and some integrations by parts, you would have obtained $$f(a,b,c,\gamma)=\frac{1}{6} \gamma  \left(6 a^2-6 a \gamma +3 b^2+3 c^2+2 \gamma ^2\right)-2 \sin
   (\gamma ) (-a b+b \gamma +c)-$$ $$2 \cos (\gamma ) (a c+b-c \gamma )+\frac{1}{4}
   \left(b^2-c^2\right) \sin (2 \gamma )-\frac{1}{2} b c \cos (2 \gamma )$$ form which $$F=f(a,b,c,\pi)-f(a,b,c,-\pi)=2 a^2 \pi +b^2 \pi +c^2 \pi -4 c \pi +\frac{2 \pi ^3}{3}$$ Computing the partial derivatives and setting them equal to $0$ would give  $$F'_a=4 a \pi=0 \implies a=0$$ $$F'_b=4 b \pi=0 \implies b=0$$ $$F'_c=2 c \pi -4 \pi=0 \implies c=2$$ Back to $F$, these values give $F=\frac{2 \pi ^3}{3}-4 \pi$.
This way is much longer than Dr. MV procedure. If I did put it here, it was for illustration of my comment.
