Residue of $\cot(z)/(z-\frac{\pi}{2})^2$ at $\frac{\pi}{2}$ I want to know what type of singularity has $f(z)=\cot(z)/(z-\frac{\pi}{2})^2$ at $\frac{\pi}{2}$ and what is the residue of $f(z)$ at $\frac{\pi}{2}$. I thought that $f$ has a pole of order $2$ at $\frac{\pi}{2}$, but the problem is that $\cot(\pi/2)=0$. Can you help me, please?

Write $\cos z$ as $(z-\frac {\pi} 2) g(z)$ near $\frac {\pi} 2$ and check (by looking at the derivative) that $g(\frac {\pi} 2)\neq 0$. Hence the function has  a pole of order $1$ at $\pi /2$. Can you use $g$ to find the residue now? (The answer is $-1$).
