Definite Integral from 0 to Pi of Cosine of m x by Cosine of n x

Theorem
Let $m, n \in \Z$ be integers.

Then:
 * $\displaystyle \int_0^\pi \cos m x \cos n x \rd x = \begin{cases}

0 & : m \ne n \\ \dfrac \pi 2 & : m = n \end{cases}$

That is:
 * $\displaystyle \int_0^\pi \cos m x \cos n x \rd x = \dfrac \pi 2 \delta_{m n}$

where $\delta_{m n}$ is the Kronecker delta.

Proof
Let $m \ne n$.

When $m = n$ we have: