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.

There is a well-known identity which says
$$\cos A + \cos B = 2\cos\left(\frac{A-B}{2}\right)\cos\left(\frac{A+B}{2}\right)$$
If we put $\frac{A-B}{2} = x$ and $\frac{A+B}{2}=2x$ then we get $A=3x$ and $B=x$, so $$ \cos x \cos 2x \equiv \frac{1}{2}(\cos x+\cos 3x) $$
We can repeat this for $\cos 3x$ and $\cos 4x$. Solving $\frac{A-B}{2} = 3x$ and $\frac{A+B}{2}=4x$ gives $$\cos 3x \cos 4x \equiv \frac{1}{2}(\cos x + \cos 7x)$$
Putting this together gives
$$\cos x \cos 2x \cos 3x \cos 4x \equiv \frac{1}{4}(\cos x+\cos 3x)(\cos x+\cos 7x)$$
Now, you need to expand these brackets and follow the same procedure to simplify $\cos x \cos x$, $\cos x \cos 7x$, $\cos 3x \cos x$ and $\cos 3x \cos 7x$.
