Solution (source code)

= Solution

The <product-to-sum formula> gives
$$
\langle f_n,f_m\rangle=\frac12\int_{-\pi}^{\pi}\big[\cos((n-m)x)-\cos((n+m)x)\big]dx=\boxed{0\quad(n\ne m).}
$$
When both indices are positive the two integer <frequencies> integrate to zero. If either index is zero the integrand already vanishes. This is <Fourier orthogonality>.