How to evaluate $\int_0^\pi \cos(x) \cos(2x) \cos(3x) \cos(4x)\, dx$ Is there an easy way to evaluate the integral $\int_0^\pi \cos(x) \cos(2x) \cos(3x) \cos(4x)\, dx$?
I know that I can plugin the $e$-function and use the linearity of the integral. However this would lead to 16 summands which I really dont want to calculate separately.

HINT: We have the following identities 
$\cos(A+ B) = \cos A \cos B - \sin A \sin B$ and 
$\cos(A-B) = \cos A \cos B + \sin A \sin B$
$2\cos A \cos B = \cos(A+B) + \cos (A-B)$
$\cos A \cos B = \dfrac{\cos(A+B) + \cos(A-B)}{2}$
Take $\cos x$ and $\cos 4x$ together and $\cos 2x$ and $\cos 3x$ together.
Then $\cos(x) \cos(2x) \cos(3x) \cos(4x) =\\ \frac18[1 + \cos(10x) + \cos(8x)+ \cos(6x)+2\cos(4x)+2\cos(2x)+\cos(x) ]$.
Now you can do with your usual integration formula.
