The problem states:
Find the Residue of $f(z)=\frac{e^z}{\sin ^2(z)}$ at each finite singularity.
The poles are clearly at $z=k\pi (k\in\mathbb{Z})$, and the order are all 2, since:
$\lim_{z \to k\pi} (z-k\pi)\frac{e^z}{\sin ^2(z)}$ does not exists, and:
$\lim_{z \to k\pi} (z-k\pi)^2\frac{e^z}{\sin ^2(z)} = e^{k\pi}$
But when I try to find the residue, first I found I can't use known series expension formula ($\sin (z)$ in the denominator). Then I tried the formula:
$\lim_{z\to \pi k} \, \frac{d\left(f(z) (z-\pi k)^2\right)}{dz^1}$
= $\lim_{z\to \pi k} \, \left( 2(z-k\pi)\frac{e^z}{\sin ^2(z)} + (z-k\pi)^2 \frac{e^z(\sin ^2(z)-2\sin (z)\cos (z)) } {\sin ^4(z)} \right)$
(Pull out the middle term)
= $\lim_{z\to \pi k} \, \left( (z-k\pi)^2 \frac{e^z\sin ^2(z) } {\sin ^4(z)} \right)$ $+$ $ \lim_{z\to \pi k} \, \left( 2(z-k\pi)\frac{e^z}{\sin ^2(z)} + (z-k\pi)^2 \frac{e^z2\sin (z)\cos (z) } {\sin ^4(z)} \right) $
The left limit as calculated before is $e^{k\pi}$. The right one, although I did not do it myself at first, is confirmed by Mathematica to be zero.
However, when I tried to do the right limit myself, I found that I had to use L'Hôpital's rule for at least 3 times to calculate the limit. This made the calculation too cumbersome.
Can anyone suggest a better approach to this problem?
The solutioin provided by my teacher is:
First replace the variable $z$ with $t=z-n\pi$:
$\frac{e^z}{sin^2(z)}=\frac{2e^z}{1-cos(2z)}=(t=z-n\pi)\frac{2e^{t+n\pi}}{1-cos(2(t+n\pi))}=\frac{2e^{t+n\pi}}{1-cos(2t)}$
Then expand the function:
$\frac{2e^{t+n\pi}}{1-cos(2t)}=\frac{2e^{n\pi}\sum_{n=0}^{\infty}\frac{t^n}{n!}}{-\sum_{1}^{\infty}\frac{(2t)^{2n}}{(2n)!}}$
Finding the coeficient (use the Cauchy Product Formula) of $\frac{1}{t}$ is $e^{n\pi}$, which is the residue we wanted.