I need to use the residues integration method to calculate the following integral:
$\int_0^{2\pi} \sin(nx)\sin(mx)dx$ where m and n are positive whole numbers.
I know that I need to transform the sinus into its exponential form then substitute for $z=e^{ix}$ and do a change of variable in the integral, then use the theorem saying that the integral along a closed curve is $2\pi i$ times the sum of the residues of all the singularities inside the curve.
However, I do not manage to get the right answer, and for the case m=n I get $\pi/2$ instead of $\pi$.
\begin{align*} \int_{0}^{2\pi}\sin(nx)\sin(mx)dx&=-\dfrac{1}{4}\int_{0}^{2\pi}(e^{inx}-e^{-inx})(e^{imx}-e^{-imx})dx\\ &=-\dfrac{1}{4}\int_{0}^{2\pi}(e^{i(m+n)x}-e^{-i(m+n)x}-e^{-i(n-m)x}-e^{-i(m-n)x})dx\\ &=-\dfrac{1}{4}\int_{0}^{2\pi}(-e^{-i(n-m)x}-e^{-i(m-n)x})dx\\ &=-\dfrac{1}{4}\delta_{m,n}(-2\pi-2\pi)\\ &=\delta_{m,n}\pi. \end{align*}