<s>[INST] Why is $\int_0^L [\cos(\frac{n \pi x}{L} - \frac{m \pi x}{L}) - \cos(\frac{n \pi x}{L} + \frac{m \pi x}{L})]dx = L $? Why is $\int_0^L [\cos(\frac{n \pi x}{L} - \frac{m \pi x}{L}) - \cos(\frac{n \pi x}{L} + \frac{m \pi x}{L})]dx = L$ when $n$ does equal $m$ but neither $n$ nor $m$ equal $0$?
$n$ is an integer, $L$ is a constant.
 [/INST] Hints
$1.$ Note that
$$\cos(x+y)=\cos(x)\cos(y)-\sin(x)\sin(y) \\
\cos(x-y)=\cos(x)\cos(y)+\sin(x)\sin(y)$$
$2.$ Subtract the above relations
$$\cos(x-y)-\cos(x+y)=2\sin(x)\sin(y)$$
$3.$ Conclude that
$$\cos(\frac{n \pi x}{L} - \frac{m \pi x}{L}) - \cos(\frac{n \pi x}{L} + \frac{m \pi x}{L})=2\sin(\frac{n \pi x}{L})\sin(\frac{m \pi x}{L})$$
$4.$ Prove that
$$\int_{0}^{L}\sin(\frac{n \pi x}{L})\sin(\frac{m \pi x}{L})=\delta_{mn}\int_{0}^{L}\sin^2(\frac{n \pi x}{L})$$
</s>