Show that $$\int_{x_0}^{x_0+L}\mathrm{e}^{-2\pi i r x/L}\mathrm{e}^{2\pi i p x/L}\mathrm{d}x =\begin{cases}L & \space \mathrm{for} \space r=p,\\0&\ \mathrm{for}\space r\ne p.\end{cases} $$
I understand completely the case when $r=p$ . So for the case that $r\ne p$ using Euler's formula I re-cast the integrand such that
$\displaystyle \int_{x_0}^{x_0+L}\mathrm{e}^{-2\pi i r x/L}\mathrm{e}^{2\pi i p x/L}\mathrm{d}x $ $$ =\int_{x_0}^{x_0+L}\cos\left(2\pi r x/L\right)\cos\left(2\pi p x/L\right)\mathrm{d}x+\int_{x_0}^{x_0+L}i\sin\left(2\pi r x/L\right)\cos\left(2\pi p x/L\right)\mathrm{d}x $$ $$\qquad\qquad-\int_{x_0}^{x_0+L}i\sin\left(2\pi p x/L\right)\cos\left(2\pi r x/L\right)\mathrm{d}x+\int_{x_0}^{x_0+L}\sin\left(2\pi r x/L\right)\sin\left(2\pi p x/L\right)\mathrm{d}x $$ So it must be the case such that the sum of the $4$ integrals above are equal to zero when $r\ne p$. Could someone please explain using the rules for orthogonal functions why their sum is zero?
$$\mathrm{e}^{-2\pi i r x/L} \; \mathrm{e}^{2\pi i p x/L} \; = \; \mathrm{e}^{2\pi i (p-r) x/L}$$