Understanding orthogonality of functions in the context of Fourier series

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?

• That's quite a bit of unnecessary formatting. Rather annoying in my opinion. By the way, what does $a^ba^c$ simplify to? You should try simplifying that integrand before you expand complex exponentials into cosines and sines. You wouldn't even need to use Euler's formula if you know what $\int_0^1 e^{2\pi i nx}dx$ is for $n\in\Bbb Z$. – whacka Sep 16 '15 at 3:30
• So you aren't using the four integrals to solve the original problem (which would be ill-advised methinks), you're just curious about the four integrals? By the way, $A+Bi+C+Di=0$ with $A.B,C,D$ real does not mean $A=B=C=D=0$, it only means that $A+C=0$ and $B+D=0$. In fact, the integrals can be nonzero if $r+p=0$. (Also, you might as well use substitution to get rid of all the $L$s and $x_0$s first of all.) To evaluate any of the four integrals, just convert cosine and sine to complex exponentials. – whacka Sep 16 '15 at 3:46
• @whacka Those 4 integrals are common in Fourier analysis and I would just like to know why their sum is zero. That's why I wrote the title 'in the context of Fourier'. – BLAZE Sep 16 '15 at 3:54
• The sum of the four integrals is zero because the original integral is zero. One can prove the original integral - say put it in the form $\int_0^{2\pi} e^{inx}{\rm d}x$ - is zero by symmetry: it is invariant under multiplication by all complex numbers of unit modulus, so it must be zero. – whacka Sep 16 '15 at 4:00

$$\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}$$
• @BLAZE, first make a change of variable for the integral, one way $x = x_0 + \frac{Lt}{2 \pi},$ the other way $t = \frac{2 \pi (x - x_0)}{L},$ so that $dx = \frac{Ldt}{2 \pi}.$ Now the integral is from $0$ to $2 \pi.$ Still some work to be done, – Will Jagy Sep 16 '15 at 17:49