Evaluate the following complex integral $\displaystyle \int_0^{2\pi} e^{ie^{it}}e^{-it} dt$ I need help evaluating the following complex integral $$\int_0^{2\pi} e^{ie^{it}}e^{-it} dt$$
I know that it evaluates to $2\pi i.$
My try was to use differentiation inside integral sign, with
$$I(x) = \int_0^{2\pi} e^{ixe^{it}}e^{-it} dt,$$
but this doesn't work because I need to differentiate two times (this function depends of $x$, it isn't constant as usually with this technique).
I can't use any strong theorems of complex analysis such as residues, Cauchy integral formula, etc, but I can use anything about integrals, series, and complex numbers in general.
Any hints are appreciated.
 A: Note that
$$\int_0^{2\pi} e^{ie^{it}}e^{-it} dt
= \int_0^{2\pi}e^{-it}\sum_{k=0}^\infty\frac{i^k}{k!}e^{ikt} dt
= \sum_{k=0}^\infty \frac{i^k}{k!}\int_0^{2\pi}e^{i(k-1)t} dt
$$
where $ \int_0^{2\pi}e^{i(k-1)t} dt =0$, except for the $k=1$. Thus
$$\int_0^{2\pi} e^{ie^{it}}e^{-it} dt=i \int_0^{2\pi} dt=2\pi i
$$
A: I assume you can use the fundamental theorem of calculus, so that $$ \int_\gamma f'(z) = f(\gamma(b))-f(\gamma(a)) $$
Likewise, I assume you know the anti-derivative of $1/z$ is $\log(z)$ (take branch cut on positive reals), so that if $\gamma(t)=e^{it}$ on $(0,2\pi)$, then $$\int_\gamma \frac{1}{z} = \lim_{\epsilon\to 0} \log(e^{i(2\pi-\epsilon)})-\log(e^{i(0+\epsilon)}) = 2\pi i$$
To summarize the statements above, if $C$ is a counter-clockwise simple closed contour that goes around the origin once, then $$\int_C z^k = \left\{ \begin{array}{ll} 0 & k\ne -1 \\ 2\pi i & k=-1\end{array} \right.$$
For your particular integral, define $\phi(t)=-ie^{-it}$, so that $\phi'(t)=-e^{-it}$, then $$\int_0^{2\pi} e^{ie^{it}}e^{-it} = -\int_0^{2\pi} e^{1/\phi(t)}\phi'(t) = -\int_\phi e^{1/z}$$
For readability, reverse the contour and start at 1 instead of $-i$, define $\gamma(t)=e^{it}$ on $(0,2\pi)$, hence $$-\int_\phi e^{1/z} = \int_\gamma e^{1/z}$$
This integral, can be integrated term by term, $$\int_\gamma e^{1/z} = \int_\gamma \cdots + \frac{2!}{z^2} + \frac{1!}{z^1} + \frac{0!}{z^0} = \cdots+0+2\pi i+ 0 = 2\pi i$$
