Computing $\int_0^{2\pi} e^{e^{i\theta}} \,\mathrm{d}\theta$ I'm asked to compute the following integral:
$$I = \int_0^{2\pi} e^{e^{i\theta}} \,\mathrm{d}\theta.$$
What is a good way to approach this computation?
 A: Change variables to $z=e^{i\theta}$. Then $dz/z = i\, d\theta$, so
$$ \int_0^{2\pi} e^{e^{i\theta}} \, d\theta = -i\int_{\lvert z \rvert = 1 } \frac{e^z}{z} \, dz. $$
Now expand $e^z$ in a power series and use the Residue Theorem.
Alternatively, expand the first exponential in powers of $e^{i\theta}$ and use that $\int_0^{2\pi} e^{n i\theta} d\theta = 0$ if $n$ is a nonzero integer.
A: The best way is by using the Cauchy's Integral Formula, "CIF".
Let $f(z)=e^{z}$. Consider the curve $\gamma(\theta)=e^{i\theta}$ for $\theta \in [0, 2\pi]$, then by CIF
\begin{align}
1=e^0=f(0)\overset{CIF}{=}\frac{1}{2\pi i} \int_{\gamma(\theta)} \frac{f(z)}{z}dz \ & \overset{def}{:=} \frac{1}{2\pi i} \int_0^{2\pi} \frac{f(\gamma(\theta))}{\gamma(\theta)} \gamma'(\theta)  d\theta \\
& =\frac{1}{2\pi i} \int_0^{2\pi} \frac{f(e^{i\theta})}{e^{i\theta}} i e^{i\theta}  d\theta \\
& = \frac{1}{2\pi} \int_0^{2\pi}e^{e^{i\theta}}  d\theta 
\end{align}
Which gives of course that 
$$
\int_0^{2\pi}e^{e^{i\theta}}  d\theta = 2\pi
$$
