Residue of $ \cot^2(z)$ at all poles I need to calculate residue of $\cot^2(z)$ at all poles. But I don't know how to solve it. 
I am trying to solve in this way:
$$\lim_{z\to a} \frac{d}{dz}\left(\cot^2(z)(z-a)^2\right)$$ where $a \in \{k\pi: k \in Z\}$
But I don't know how to solve this limit of derivation. 
Can anybody help me, please? 
 A: $$\cot^2(z) = \frac{\cos^2(z)}{\sin^2(z)} \ \ \text{ so we need only worry about the zeros of } \sin^2(z)$$
These zeros occur when $z_k = k \pi$ for $k \in \mathbb{Z}$, as you've already identified.
Moreover, they are 2nd order zeros, as $(\sin^2(z))' = 2 \sin(z) \cos(z)$, which also has zeros at $z_k$, whereas $(2 \sin(z) \cos(z))' = 2 \cos^2(z) - 2\sin^2(z)$, which is nonzero at $z_k$.
Hence, $\cot^2(z)$ has $2^{nd}$ order poles when $z_k = k \pi, k \in \mathbb{Z}$. Therefore,
$$\text{Res}_{z = z_k} \cot^2(z) = \lim_{z \to z_k} \frac{d}{dz}\frac{\cos^2(z)(z - z_k)^2}{\sin^2(z)}$$
Calculate this derivative, then take the limit by applying L'Hopital's rule

In general, if $f(z)$ has an $n^{th}$ order pole at $z = z_k$, then
$$\text{Res}_{z = z_k} f(z) = \frac1{(n-1)!} \lim_{z \to z_k} \frac{d^{n-1}}{dz^{n-1}} \left[(z-z_k)^n\, f(z)\right]$$
Which can be seen directly from the Laurent expansion of $f$
A: $$\cot^2z=-1+\dfrac{1}{\sin^2z}=-1+\dfrac{2}{1-\cos2z}$$
then
\begin{align}
-1+\dfrac{2}{1-\cos2z}
&= -1+\dfrac{2}{4z^2\left(\dfrac{1}{2!}-\dfrac{4}{4!}z^2+\dfrac{16}{6!}z^4+\cdots\right)} \\
&= -1+\dfrac{1}{2z^2}\left(2+\dfrac{2}{3}z^2+\dfrac{2}{15}z^4+\cdots\right) \\
&= -1+\dfrac{1}{z^2}+\dfrac{1}{3}+\dfrac{z^2}{15}+\cdots\\
&= \dfrac{1}{z^2}-\dfrac{2}{3}+\dfrac{z^2}{15}+\cdots
\end{align}
s0 $a_{-1}=0$. Now, since $\cot^2(z-k\pi)=\cot^2z$ then the residue of $\cot^2z$ in $z=k\pi$ will be $0$ as well.
A: My advice is to just do it. This limit might be hard to swallow, but there are worse things.
First, take the derivative
$$ \begin{align} \frac{d}{dz}\left((z-k\pi)^2\cot^2 z \right) 
&= 2(z-k\pi)\cot^2 z - 2(z-k\pi)^2\cot z\csc^2 z \\
&= \frac{2(z-k\pi)\cos^2z\sin z - 2(z-k\pi)^2\cos z}{\sin^3 z} \end{align}$$
You may substitute $w = z-k\pi$ to obtain
$$ \lim_{w\to 0}\frac{2w\cos^2w\sin w - 2w^2\cos w}{\sin^3 w} $$
This is an indeterminate form, so you'll need to apply L'Hopital's rule 3 times. Good luck
