<s>[INST] Calculate residue of pole with order 5 I am trying to evaluate the residue of $\frac{(z^6-1)^2}{z^5(2z^4-5z^2+2)}$ at z=0.
Is there a way to do this without having to do the long derivative calculation?
I know we have the formula $Res(f,0)=\lim_{z\to0}\frac{1}{(5-1)!}\frac{\mathrm{d}^{5-1}f}{\mathrm{d}z^{5-1}}z^5f(z)$. But finding the 5th derivative of this function would take a long time and be pretty messy. My first try was to find the residues at the other poles and at infinity since all the residues must sum to zero, but when I tried to do this the residue at infinity ended up being the same as the residue at zero.
I've also considered finding the Laurent expansion but the Partial Fraction Decomposition is also long.
 [/INST] We will work in the power series ring $\Bbb Q[[z]]$ in the variable $z$ over $\Bbb Q$. Let us denote by $\operatorname{Coeff}_{z^k}\;f$ the coefficient in $z^k$ of some series $f$ in this ring. It may be useful to substitute $w=z^2$, then work in $\Bbb Q[[w]]$, but this is important only to have an easier typing. We may then work modulo $O(z^5)$, respectively modulo $O(w^3)$.
Then the needed residue is:
$$
\begin{aligned}
&\operatorname{Res}_{z=0}
\frac{(z^6-1)^2}{z^5(2z^4-5z^2+2)}
\\
&\qquad= \operatorname{Coeff}_{z^4}
\ \frac 12\cdot \frac{(z^6-1)^2}{z^4-\frac 52z^2+1}\\
&\qquad= \frac 12 \cdot \operatorname{Coeff}_{w^2}
\ \frac{(w^3-1)^2}{w^2-\frac 52w +1}\\
&\qquad= \frac 12 \cdot \operatorname{Coeff}_{w^2}
\ \frac{(w^3-1)^2}{w^2-\frac 52w +1} +O(w^3)\\
&\qquad= \frac 12 \cdot \operatorname{Coeff}_{w^2}
\ \frac{(0-1)^2}{w^2-\frac 52w +1} +O(w^3)\\
&\qquad= \frac 16 \cdot \operatorname{Coeff}_{w^2}
\ \left[\frac 4{1-2w} - \frac 1{1-\frac w2}\right] +O(w^3)\\
&\qquad= \frac 16 \cdot \operatorname{Coeff}_{w^2}
\ \left[\  4(1 + 2w + 4w^2+\dots) - \left(1+\frac w2+\frac {w^2}4+\dots\right)\ \right] +O(w^3)\\
&\qquad= \frac 16 \cdot \operatorname{Coeff}_{w^2}
\left[\ (4-1) + \left(8-\frac 12\right)w+ \left(16-\frac 14\right)w^2+\dots \ \right]+O(w^3)\\
&\qquad= \frac 16 \cdot \left(16-\frac 14\right) = \color{blue}{\frac{21}8}\ .
\end{aligned}
$$
(The computation was done so that we could finally have the Laurent exansion in zero, but then the numerator $(w^3-1)^2$ has to be considered more carefully.)

Computer check, here sage:
sage: R.<z> = PowerSeriesRing(QQ)
sage: (z^6-1)^2 / z^5 / (2*z^4 - 5*z^2 + 2) + O(z^6)
1/2*z^-5 + 5/4*z^-3 + 21/8*z^-1 + 69/16*z + 261/32*z^3 + 1029/64*z^5 + O(z^6)

(This may be not wanted, but it is just a check, and it may be important to know this can be easily done with computational aid.)
</s>