Calculate this residue I'm kind of strigling with a problem right now. It is as follows:
Calculate the residues of this function at all isolated singularities.
$$f(z)=\frac{e^z}{\sin^2z}$$
I got the singularities ($k\pi,k\in\mathbb{Z}$) and shown they all are double poles, and I'm now struggling with the limit $$\lim_{z\to k\pi}\frac{\partial}{\partial z}[(z-k\pi)^2f(z)]$$ to obtain their value. Any tip? Thanks a lot!
 A: $\newcommand{\+}{^{\dagger}}%
 \newcommand{\angles}[1]{\left\langle #1 \right\rangle}%
 \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}%
 \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}%
 \newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,}%
 \newcommand{\dd}{{\rm d}}%
 \newcommand{\ds}[1]{\displaystyle{#1}}%
 \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}%
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}%
 \newcommand{\fermi}{\,{\rm f}}%
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}%
 \newcommand{\half}{{1 \over 2}}%
 \newcommand{\ic}{{\rm i}}%
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}%
 \newcommand{\isdiv}{\,\left.\right\vert\,}%
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}%
 \newcommand{\ol}[1]{\overline{#1}}%
 \newcommand{\pars}[1]{\left( #1 \right)}%
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}%
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,#2\,}\,}%
 \newcommand{\sech}{\,{\rm sech}}%
 \newcommand{\sgn}{\,{\rm sgn}}%
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}%
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
\begin{align}
&\lim_{z \to k\pi}\partiald{}{z}\bracks{%
\pars{z - k\pi}^{2}\expo{z}\over \sin^{2}\pars{z}}
=
\lim_{z \to k\pi}\partiald{}{z}\bracks{%
\pars{z - k\pi}^{2}\expo{\pars{z - k\pi} + k\pi}
      \over \sin^{2}\pars{\bracks{z - k\pi} + k\pi}}
\\[3mm]&=
\expo{k\pi}\lim_{z \to k\pi}\partiald{}{z}\bracks{%
\pars{z - k\pi}^{2}\expo{z - k\pi}
      \over \sin^{2}\pars{z - k\pi}}
=
\expo{k\pi}\lim_{z \to 0}\partiald{}{z}\bracks{z^{2}\expo{z} \over \sin^{2}\pars{z}}
\end{align}
$$
{z^{2}\expo{z} \over \sin^{2}\pars{z}}
=
{z^{2}\expo{z} \over \pars{z - z^{3}/6 + \cdots}^{2}}
=
{\expo{z} \over \pars{1 - z^{2}/6 + \cdots}^{2}} = 1 + z + \cdots
\ \imp\
\lim_{z \to 0}\partiald{}{z}\bracks{{z^{2}\expo{z} \over \sin^{2}\pars{z}}} = 1
$$
$$\color{#0000ff}{\large%
\lim_{z \to k\pi}\partiald{}{z}\bracks{%
\pars{z - k\pi}^{2}\expo{z}\over \sin^{2}\pars{z}} = \expo{k\pi}}
$$
A: You can write
$$\sin^2 z = \frac12\left(1 - \cos (2z)\right)$$
to make the computation of the start of the Taylor series easier. Then for the singularity in $k\pi$, you have
$$\begin{align}
\sin^2 z &= \frac12\left(1-\cos (2((z-k\pi)+k\pi))\right)\\
&= \frac12\left(1-\cos (2(z-k\pi))\right)\\
&= \frac12\left(1 - \left(1 - \frac{4(z-k\pi)^2}{2} + \frac{16(z-k\pi)^4}{4!} - \dotsc\right)\right)\\
&= (z-k\pi)^2\left(1 - \frac{(z-k\pi)^2}{3} + \dotsc\right),
\end{align}$$
and in
$$\frac{e^z}{\sin^2 z} = \frac{e^z}{(z-k\pi)^2\left(1 - \frac13(z-k\pi)^2+\dotsc\right)}$$
you can develop the $1/(1- \frac13(z-k\pi)^2 + \dotsc)$ factor into a geometric series, which shows you that
$$\operatorname{res}\left(\frac{e^z}{\sin^2 z};k\pi\right) = \frac{d}{dz}\Bigl\lvert_{z=k\pi} e^z.$$
A: When $$f(z):={e^z\over\sin^2 z}$$
then
$$f(n\pi+z)=e^{n\pi}{e^z\over\sin^2 z}\equiv e^{n\pi}\> f(z)\ .\tag{1}$$
Therefore it suffices to compute the residue of $f$ at $z=0$.
Writing "$?$" for a non-specified function which is analytic at $z=0$ we have $\sin z=z+?z^3=z(1+?z^2)$ and therefore $\sin^2 z=z^2(1+?z^2)$. In this way we obtain
$$f(z)={1+z+?z^2\over z^2(1+?z^2)}={(1+z+?z^2)(1+?z^2)\over z^2}={1\over z^2}+{1\over z}+?\ ,$$
from which we deduce that ${\rm res}\,(f\,|\,0)=1$. Using $(1)$ it then follows that
$${\rm res}\,(f\,|\,n\pi)=e^{n\pi}\qquad(n\in{\mathbb Z})\ .$$
