[Math] $\int_{-\pi}^\pi \cos(nx)\cos(mx)\,dx$

definite integralsfourier seriesintegration

I'm pretty sure that there's a theorem that says that the Fourier coefficients of a sum of $\cos(nx)$ and $\sin(nx)$ 's are the coefficients of the sum itself.

I tried to prove that in the specific case of $f(x) = \sum_{n=1}^{\infty}\frac{\cos(nx)}{n^2}$. In calculating the Fourier coefficients I got to calculating $\cos(nx)\cdot\cos(mx)$, but I'm now stuck. Any tips would be appreciated!

Best Answer

Let $m,n\ge 1$. Use

$$\cos (m x) \cos (n x)=\frac{1}{2} (\cos (m x-n x)+\cos (m x+n x)).$$

Then if $m\not=n$ we get $0$, since $\int_{-\pi}^\pi \cos(kx)dx=\frac{2\sin(n\pi)}{n}=0$ for all $k\in\mathbb{Z}, k\not=0$. For $m=n$ we have

$$\int_{-\pi}^\pi \cos(nx)^2 dx = \frac{1}{2}\int_{-\pi}^\pi (1+\cos(2nx)) dx = \frac{1}{2} 2\pi+\underbrace{\frac{1}{2}\int_{-\pi}^\pi \cos(2nx) dx}_{=0}=\pi.$$

This is exactly what we expected.

Related Question