Proving orthogonality of complex form of Fourier Series I am lost when working on this complex Fourier Series question, I am sure it is a basic simple problem but I am not well versed in applied math:

Show that $\{e^{\mathscr i n\pi x/\mathscr l}\}, n = 0, \pm 1, \pm 2 \ldots$ is an orthogonal family on $-\mathscr l < x < \mathscr l$ with respect to the complex inner product:
$$\langle u, v \rangle := \int^b_a u(x)\overline{v(x)} dx,$$

where overbar indicates conjugation. Hit: Use Euler's formula  $e^{i\theta} = cos(\theta) + \mathscr i sin(\theta)$.
Here are what I managed so far:
$$\begin{align}
\langle u, \bar{u} \rangle :&= \int^{\mathscr l}_{-\mathscr l} [\cos (n\pi x/\mathscr l) + \mathscr i \sin(n\pi x / \mathscr l)][\cos (n\pi x/\mathscr l) - \mathscr i \sin(n\pi x / \mathscr l)] \  dx \\
&= \int^{\mathscr l}_{-\mathscr l} \cos^2 (n\pi x/\mathscr l) + \sin^2 (n\pi x / \mathscr l) \ dx \\
&= \int^{\mathscr l}_{-\mathscr l} \ dx\\
&= [x]^{\mathscr l}_{-\mathscr l}\\
&= 2 \mathscr l\\
\end{align}$$
The final result should be zero in order to prove orthogonality. Please let me know where I got wrong. Thanks for your time and effort.
 A: I think you're mixing something up, or not understanding the definition of orthogonality. Orthogonality means that $\langle u,v\rangle=0$ when $u,v$ are different pairs of members from an orthogonal family. Taking a pair of the same ones should not give you zero since inner products satisfy $\langle u, u\rangle=0$ iff $u=0$. So pick two different indices, $m$ and $n$ and do the integration. 
For what its worth you can save yourself some time by just dealing with $\exp(i n \theta)$ and knowing that $\int_a^b \exp(i n \pi \theta)d\theta = \frac{1}{in \pi }\left.\exp(i n \pi \theta)\right|_a^b$
A: Consider $e_k(x) = e^{2 \pi ikx/P}$.
If $j \neq k$,
\begin{align*}
\langle e_j, e_k \rangle &= \frac{1}{P} \int_0^P e^{2\pi i j k / P} e^{-2\pi i k x / P} \, dx \\
&= \frac{1}{P} \int_0^P e^{2\pi i (j - k) x / P} \, dx \\
&= \frac{1}{P} \frac{P}{2\pi i (j - k)} e^{2\pi i (j - k)x/ P} \bigg \vert_0^P = 0 & \text{Use Euler's Formula}
\end{align*}
If $j = k$,
\begin{align*}
\langle e_j, e_k \rangle &= \frac{1}{P} \int_0^P e^{2\pi i j k / P} e^{-2\pi i k x / P} \, dx \\
&= \frac{1}{P} \int_0^P e^{2\pi i (j - k) x / P} \, dx \\
&= \frac{1}{P} \int_0^P 1\\
&= 1
\end{align*}
Note: Since we have translation invariance, we can integrate over $-P/2$ to $P/2$ instead of $0$ to $P$. Chooseing $P = 2$ gives the integration from $-1$ to $1$ as you used.
