How to find the value of this integral Can someone please explain how
$$\tfrac{1}{2\pi a^2} \int_0^{2\pi}e^{-(n-1)i\theta}[1+\tfrac{e^{2i \theta}}{a^2}+\tfrac{e^{4i \theta}}{a^4}+\cdots] \, d\theta =0 $$
when $n$ is even ?
 A: As $$\int e^{mx}dx= \begin{cases} \frac{e^{mx}}m+C_1 &\mbox{if } m\ne0 \\
x+C_2 & \mbox{if }m=0 \end{cases} $$ where $C_1,C_2$ are arbitrary constants of indefinite integration 
If $n\ne1,$
$$\int_0^{2\pi}e^{-(n-1)i\theta} d\theta  =\left(\frac{e^{-(n-1)\theta i}}{-(n-1) i}+C\right)_0^{2\pi} =\frac{e^{-2(n-1)\pi  i}-1}{n i}$$
Now use Euler Formula
Can you manage for $n=1$?
A: When $k\ne0$,
$$
\int_0^{2\pi}e^{ik\theta}\,\mathrm{d}\theta=\frac1{ik}\left(e^{ik2\pi}-1\right)
$$
When $k$ is an integer, this is $0$.
When $k=0$, $e^{ik\theta}=1$ so the integral is $2\pi$.
In any case, when $n$ is even $k=-(n-1)$ is odd, and not $0$.
A: It works if $n$ is any integer except $1$.
Picture what the graph of $\theta\mapsto e^{-(n-1)i\theta}$ looks like: as $\theta$ moves along a line from $0$ to $2\pi$, the value $e^{-(n-1)i\theta}$ goes around the unit circle in the complex plane at a uniform rate.  It goes around $n-1$ times.  So its average location is exactly at the center of the circle.  The one exception, $n=1$, makes $n-1=0$, so it winds around the circle $0$ times.
The above answers the question that was originally posted, before further editing.  But the answer to the amended question uses the same idea.
