# Solving an integral expression related to the circle method and complex exponential function

While reading a paper on the circle method, I came accross the following exercise:
Let $e(x) = e^{2 \pi i x}$, prove that for $n,m \in \mathbb {Z}$, $\int_0^1 e(nx)e(-mx)=\delta _{mn}$ (Kronecker Delta).
I have tried to combine the exponentials and integrating through u-substitution, I have tried to leave them uncombined and integrate by parts, I have used Euler's Identity and integrated the sine and cosine, and no matter what I do, I get an $n-m$ term in the denominator, so whenever $m=n$ division by zero will occur. The limit is $1$, but the problem specifically says that the function will equal $1$, what am I missing?

• Did you solve the case when $m\neq n$? That's the difficult part. For the other, just pay attention to the fact that, when $m=n$, $e(mx)e(-mx) = 1$ for every $x \in [0,1]$. – Hugo Feb 27 '16 at 20:09

The primitive is $$\int dx e^{2\pi i (n-m)x}=\frac{i e^{-2 i \pi x (m-n)}}{2 \pi (m-n)}\ ,$$ for $m\neq n$, and $=x$ for $m=n$. So for $m\neq n$, computing the primitive between the bounds $0$ and $1$ yields $$\frac{i e^{-2 i \pi (m-n)}}{2 \pi (m-n)}-\frac{i }{2 \pi (m-n)}=0$$ using $e^{-2\pi i k}=1$ for $k\in\mathbb{Z}$, while for $m=n$ the primitive between $0$ and $1$ yields $1$.