Evaluate the following integral using residue's theorem: $$\oint_C\frac{\cos(z)}{e^{iz}+1}\mathrm{d}z$$
where $C:|z+3\pi|=2$.
I got stuck when I tried to calculate the residue on pole $z=-3\pi$, I couldn't go too far with this limit $\displaystyle \lim_{z\to\ -3\pi}\frac{(z+3\pi)\cos(z)}{e^{iz}+1}$
Another approach (the result is the same as using l'Hopital's rule)
The function $$f(z)=\frac{e^{iz}+1}{z+3\pi}$$ is a difference quotient, and its limit as $z\to -3\pi$ is the derivative of $e^{iz}$ at $z=-3\pi$, so
$$\lim_{z\to -3\pi} f(z) = i e^{-3\pi i} = -i$$ and $$\lim_{z\to\ -3\pi}\frac{(z+3\pi)\cos(z)}{e^{iz}+1} = \frac{\cos(- 3\pi)}{-i}=-i.$$