Orthogonality lemma sine and cosine I want to know how much is the integral $\int_{0}^{L}\sin(nx)\cos(mx)dx$ when $m=n$ and in the case when $m\neq n$. I know the orthogonality lemma for the other cases, but not for this one. 
 A: When $n=m$ we have $\sin(nx)\cos(nx) = \frac{\sin(2nx)}{2}$. When $n\neq m$ use the product to sum formula:
$$\sin(nx)\cos(mx) = \frac{\sin((n+m)x) + \sin((n-m)x)}{2}$$
Then the integration becomes much simpler.
A: If $n=m$, then we have
$$\intop_{x=0}^{L}\sin\left(nx\right)\cos\left(nx\right)\mathrm{d}x
=\left[\frac{\sin^2\left(nx\right)}{2n}\right]_{x=0}^{x=L}
=\frac{\sin^2\left(nL\right)}{2n},$$
and for $n\neq m$ we have
$$\intop_{x=0}^{L}\sin\left(nx\right)\cos\left(mx\right)\mathrm{d}x
=\frac{1}{2}\left(\intop_{x=0}^{L}\sin\left(\left(n+m\right)x\right)\mathrm{d}x+\intop_{x=0}^{L}\sin\left(\left(n-m\right)x\right)\mathrm{d}x\right)$$
$$=\frac{1}{2}\left(\left[\frac{\cos\left(\left(n+m\right)x\right)}{n+m}\right]_{x=L}^{x=0}+\left[\frac{\cos\left(\left(n-m\right)x\right)}{n-m}\right]_{x=L}^{x=0}\right)
=\frac{1}{2}\left(\frac{1-\cos\left(\left(n+m\right)L\right)}{n+m}+\frac{1-\cos\left(\left(n-m\right)L\right)}{n-m}\right)$$
$$=\frac{1}{2}\frac{2n-2m\cos\left(nL\right)\cos\left(mL\right)-2n\sin\left(nL\right)\sin\left(nL\right)}{n^2-m^2}.$$
