Is there an easy way to visualise that the following holds?
$$ \int_{-\pi}^{\pi} \cos (nx)\cos(kx)dx=0$$
I thought about simply switching the cosine to sine:
$$ \int_{-\pi}^{\pi} \cos (nx)\sin\left( kx+\frac{\pi}{2}\right)dx=0$$
Now its an even function times an odd function which makes an odd function. This will integrate over a symmetric interval to zero, which is very easy to visualise. However I have the feeling this is mistaken because you could also do it for $\cos^2 (nx) $.
I tend to avoid simply trigonometric substitutions because they are very hard to visualise.
I tried using kronecker method of integration, but this doesn't work:
$$ \int \cos (nx)\cos(kx)dx = \cos(nx)\sin(kx)-\sin(nx)\cos(kx)+...$$
EDIT: I think I found a solution:
Rewrite:
$$ \int_{-\pi}^{\pi} \cos (nx)\cos(kx)dx$$
$$ \int_{-\pi}^{\pi} \cos (nx)\cos(nx+mx)dx$$
Where $k=n+m$
Now, whenever $mx=\frac{1}{2}\pi$ we get:
$$ \int_{-\pi}^{\pi} \cos (nx)\cos(nx+\frac{1}{2}\pi)dx$$ Which can be rewritten as:
$$ \int_{-\pi}^{\pi} \cos (nx)\sin(nx)dx=0$$
Which is zero because an even function ($\cos$) times an odd function ($\sin$) is odd. And on a symmetric interval the integral of an odd function is zero.