Evaluation of integral, with a reverse substitution to line integral. Evaluate $$\int_{0}^{2\pi}e^{\cos(t)}\cos(\sin(t)-7t)\,dt$$
I believe you need to do a substitution like $$z=e^{it}$$ and integrating over the curve, since the subject is called complex analysis.
 A: You don't have to: first recall the complex form of the cosine; using this makes the integrand
$$ \frac{1}{2} \left( \exp{(\cos{t}+i\sin{t}-7it)} + \exp{(\cos{t}-i\sin{t}+7it)} \right) $$
But then we apply Euler's identity, and find
$$ \frac{1}{2} \left( \exp{(e^{it}-7it)} + \exp{(e^{-it}+7it)} \right) $$
Substituting $u=2\pi-t$ in the latter shows that both terms have the same integral, so we are down to calculating
$$ \int_0^{2\pi} e^{e^{it}} e^{-7it} \, dt $$
If you know your Fourier series, you know that
$$ \int_0^{2\pi} e^{int} \, dt = \begin{cases} 2\pi & n=0 \\ 0 & n \neq 0 \end{cases}, $$
and therefore if we expand $e^{e^{it}}$ as a series in $e^{it}$, only the term with $(e^{it})^7$ gives something that is not zero. (Absolute convergence lets us switch the sum and integral.) In particular,
$$ \int_0^{2\pi} e^{e^{it}} e^{-7it} \, dt = \int_0^{2\pi} e^{-7it} \left( 1 + e^{it} + \frac{e^{2it}}{2!} + \dotsb + \frac{e^{7it}}{7!} + \dotsb \right) \, dt \\
=  \int_0^{2\pi} e^{-7it} \, dt +  \int_0^{2\pi} e^{-7it}e^{it} \, dt + \dotsb + \frac{1}{7!}\int_0^{2\pi} dt + \dotsb \\
= \frac{2\pi}{7!}.
$$

To do this by contour integration, go back to
$$ \int_0^{2\pi} e^{e^{it}} e^{-7it} \, dt. $$
Substitute $e^{it}=z$, so $dz/(iz) = dt $. Then
$$ \int_0^{2\pi} e^{e^{it}} e^{-7it} \, dt = \frac{1}{i}\int_{|z|=1} \frac{e^z}{z^8} \, dz. $$
So now use the Cauchy integral formula for the Taylor series coefficient,
$$ f^{(n)}(w) = \frac{n!}{2\pi i}\int_{|z|=r} \frac{f(z)}{(z-w)^{n+1}} \, dz. $$
Here, $f(z)=e^z/i$, $n=7$ and $w=0$, so
$$ \frac{1}{i}\int_{|z|=1} \frac{e^z}{z^8} \, dz = \int_{|z|=1} \frac{f(z)}{z^8} \, dz = \frac{2\pi i}{7!}f^{(7)}(0) = \frac{2\pi i}{7!} \frac{1}{i} = \frac{2\pi}{7!}. $$
A: For every $t\in \mathbb{R}$ we have:
$$
e^{\cos t}\cos(\sin t-7t)=\Re e^{\cos t+i(\sin t-7t)}=\Re\exp\left(e^{it}-7it\right)=\Re\exp(e^{it})e^{-7it},
$$
and if we set $z=e^{it}$, then
$$
\int_0^{2\pi}e^{\cos t}\cos(\sin t-7t)\,dt=\Re\int_0^{2\pi}\exp(e^{it})e^{-7it}\,dt=\Re\int_{|z|=1}e^zz^{-7}\frac{dz}{iz}=\Re\frac{1}{i}\int_{|z|=1}\frac{e^z}{z^8}\,dz.
$$
Since
$$
e^z=\sum_{k=0}^\infty\frac{z^k}{k!} \quad \forall z\in \mathbb{C},
$$
and
$$
\int_{|z|=1}\frac{1}{z^n}=\begin{cases}
2\pi i&\mbox{ if } n= 1\\
0 & \mbox{ otherwise }
\end{cases}
$$
we have
$$
\int_{|z|=1}\frac{e^z}{z^8}\,dz=\sum_{k=0}^\infty\int_{|z|=1}\frac{z^k}{k!z^8}\,dz=\int_{|z|=1}\frac{1}{7!z}\,dz=\frac{2\pi i}{7!}.
$$
It follows that
$$
\int_0^{2\pi}e^{\cos t}\cos(\sin t-7t)\,dt=\Re\frac{1}{i}\int_{|z|=1}\frac{e^z}{z^8}\,dz=\Re\frac{1}{i}\cdot\frac{2\pi i}{7!}=\frac{2\pi}{7!}=\frac{\pi}{2520}.
$$
