I need help with the following integral: $$ \frac{1}{2\pi i }\int_{|z| = 4} \frac{\cos(e^z)}{\sin^2(z)} dz. $$ I have tried finding the residues, which gave me 0 through my (possibly erroneous) calculations, making the power reduction substitution $\sin^2(z) = 1/2 (1- \cos(2z))$, and parameterizing the curve via $\gamma(t) = 4e^{it}$ and going from there without any luck. Any hints or nudges in the right direction would be cherished. Thanks!
Edit: for context, this integral was the first problem on a qualifying exam in my department, and I have been stuck on it in preparation for the next one. It is therefore important that I can find a solution that I can do by hand in a timely manner- the residue calculations I have tried are extremely cumbersome and haven't produced anything useful yet.
To elaborate on Nitin's answer, you were on the right track with residues, but the actual calculation is tricky. The key fact is $ \lim\limits_{z\to 0}\left[\,\frac{\sin(z)}{z}\,\right] = 1 $, which can be applied because the limit of products is the product of limits.
By the product rule, $ \lim\limits_{z\to 0}[\,z^2 f(z)\,]' = \lim\limits_{z\to 0}[\,2z\, f(z) + z^2 f'(z)] $.
By the quotient rule, $f'(z)= \dfrac{-e^z \sin(e^z) \sin^2(z) - 2\cos(e^z) \cos(z) \sin(z)}{\sin^4(z)} $
Then $\text{Res}(f,0) = \lim\limits_{z\to 0}\left[\, 2z\dfrac{\cos(e^z)}{\sin^2(z)} + z^2\dfrac{-e^z \sin(e^z) \sin^2(z) - 2\cos(e^z) \cos(z) \sin(z)}{\sin^4(z)}\,\right] $
Focusing in on the expression inside the limit, I will make some rearrangements
$$ \left(\frac{z}{\sin(z)}\right)\frac{2\cos(e^z)}{\sin(z)} - \left(\frac{z^2}{\sin^2(z)}\right) \frac{-e^z \sin(e^z) \sin^2(z)}{\sin^2(z)} - \left(\frac{z^2}{\sin^2(z)}\right) \frac{2\cos(e^z) \cos(z) }{\sin(z)}$$
Now when taking the limit, by applying the key fact, all the expressions in parentheses become factors of 1.
$$\lim\limits_{z\to 0}\left[ \frac{2\cos(e^z)}{\sin(z)} - e^z \sin(e^z) - \frac{2\cos(e^z) \cos(z)}{\sin(z)}\right]$$
Plugging in $z=0$ where it doesn't create zeros and simplifying gives $$\lim\limits_{z\to 0}\left[ \frac{2\cos(1)}{\sin(z)} - \sin(1) - \frac{2\cos(1)}{\sin(z)}\right] = -\sin(1)$$
You can follow a very similar process for the other two residues at $z = \pm \pi$, as $ \lim\limits_{z\to c}\left[\,\frac{\sin(z-c)}{z-c}\,\right] = 1 $