Consider the integral $$\oint_C \frac{\cot(\pi z)}{(z-i)^2} dz,$$ where $C$ is the contour of $4x^2+y^2=2$.
The answer seems to be $$2 \pi i\left(\frac{\pi}{\sinh^2 \pi} - \frac{1}{\pi}\right)$$ but I do not know how to proceed. I would be grateful if an answer contains some worked out steps on how to proceed with this problem.
Hints.
(A) $\cot(\pi z)$ is a meromorphic function having residue equal to $\frac{1}{\pi}$ for every $z\in\mathbb{Z}$;
(B) $\frac{1}{(z-i)^2}$ is a meromorphic function with a double pole in $z=i$;
(C) If $\gamma$ is a simple closed curve in the complex plane and $f(z)$ is a meromorphic function with no singularities on $\gamma$, then: $$\oint_{\gamma}f(z)\,dz = 2\pi i\cdot \sum_{\zeta\in Z}\operatorname{Res}\left(f(z),z=\zeta\right)$$ where $Z$ is the set of singularities of $f(z)$ inside $\gamma$.
Inside the given countour there are just two singularities for $f(z)=\frac{\cot(\pi z)}{(z-i)^2}$, in $z=0$ and $z=i$. Since $\operatorname{Res}(f(z),z=0)=-\frac{1}{\pi}$, we just need to compute $\operatorname{Res}(f(z),z=i)$.
$z=i$ is a double pole for $f(z)$, hence:
$$\operatorname{Res}(f(z),z=i)=\lim_{z\to i}\frac{d}{dz}(z-i)^2 f(z)=-\lim_{z\to i}\frac{\pi}{\sin^2(\pi z)}=\frac{\pi}{\sinh^2 \pi}.$$