Faster way to compute an ugly residue I need to compute (by hand) the value of
$$\text{Res} \frac{\cot \pi z}{\sinh^2 \pi z}_{z=0}$$
Now, this is a third-order pole, meaning that to compute the residue there, I would need to evaluate
$$\frac{1}{2}\lim_{z\to 0} \frac{d^2}{dz^2} \frac{z^2\cot \pi z}{\sinh^2 \pi z}$$
Which involves taking a nasty derivative (twice) and applying L'Hopital many times. Is there any way to forego this nasty algebra? Is there a better way to compute this residue?
Wolfram calculates its value to be
$$-\frac{2}{3\pi}$$
in about 2 seconds (computers can do algebra quickly).
 A: $\frac{\cot(\pi z)}{\sinh^2(\pi z)}$ is an odd function  whose Laurent expansion at the origin starts with $\frac{1}{\pi^3 z^3}$, hence
$$\operatorname*{Res}_{z=0}\frac{\cot(\pi z)}{\sinh^2(\pi z)} = \lim_{z\to 0} z\left(\frac{\cot(\pi z)}{\sinh^2(\pi z)}-\frac{1}{\pi^3 z^3}\right) $$
and the computation of the last limit is a bit simpler than the computation of a second derivative.
A: Using the well known power series developments for the numerator and denominator functions, and taking into account that we're interested only in a small neighborhood of zero, we get
$$\frac{\cot\pi z}{\sinh^2 \pi z }=\frac{\frac1{\pi z}-\frac{\pi z}3+\ldots}{\pi^2z^2+\frac{\pi^4z^4}3+\ldots}=\frac{\frac1{\pi z}-\frac{\pi z}3+\ldots}{\pi^2z^2\left(1+\frac{\pi^2z^2}3+\ldots\right)}=$$
$$=\frac1{\pi^2z^2}\cdot\left(\frac1{\pi z}-\frac{\pi z}3+\ldots\right)\left(1-\frac{\pi^2z^2}3+\frac{\pi^4z^4}9-\ldots\right)=$$
$$=\frac1{\pi^2z^2}\left(\ldots+\left(-\frac\pi3-\frac\pi3\right)z+\ldots\right)=\ldots-\frac2{3\pi z}+\ldots$$
and thus the residue is $\;-\cfrac2{3\pi}\;$.
A: Since$$\cot(\pi z)=\frac1{\pi z}-\frac{\pi z}3+o(z^2)$$and$$\sinh^2(z)=\pi^2z^2+\frac{\pi^4z^4}3+o(z^5),$$if your write $\frac{\cot(\pi z)}{\sinh^2(\pi z)}$ as$$\frac{\cot(\pi z)}{\sinh^2(\pi z)}=\frac{a_{-3}}{z^3}+\frac{a_{-1}}z+a_1z+\cdots,$$you'll have\begin{align}\frac1{\pi z}-\frac{\pi z}3+\cdots&=(\pi^2z^2+\frac{\pi^4z^4}3\cdots)\left(\frac{a_{-3}}{z^3}+\frac{a_{-1}}z+a_1z+\cdots\right)\\&=\frac{\pi^2a_{-3}}z+\left(\pi^2a_{-1}+\frac{\pi^4a_{-3}}3\right)z+\cdots\end{align}From this you can deduce that $a_{-3}=\frac1{\pi^3}$ and that $a_{-1}=\frac{-2}{3\pi}$. And $a_{-1}$ is the residue that you are interested in.
