<s>[INST] calcuating residue of a complex function I need to calculate the residue of the function $\frac{(z^6+1)^2}{(z^5)(z^2-2)(z^2-\frac{1}{2})}$ at $z$=0.
z=0 is  a pole of order 5 so I tried using the general formula to calculate the residue but the calculation becomes very tedious since it involves finding the fourth derivative of the complex function. I even tried writing the laurent series but that too got me nowhere. Could anyone please tell how to proceed with this problem?
 [/INST] In order to get the residue of the function at $z=0$ we calculate the coefficient  of $z^{-1}$ of the  Laurent series expansion. We use the coefficient of  operator $[z^n]$  to denote the coefficient of $z^n$.

We obtain
  \begin{align*}
\color{blue}{[z^{-1}]}&\color{blue}{\frac{\left(z^6+1\right)^2}{z^5\left(z^2-2\right)\left(z^2-\frac{1}{2}\right)}}\\
&=[z^4]\frac{\left(z^6+1\right)^2}{(-2)\left(1-\frac{z^2}{2}\right)\left(-\frac{1}{2}\right)\left(1-2z^2\right)}\tag{1}\\
&=[z^4]\left(1+\frac{z^2}{2}+\frac{z^4}{4}\right)\left(1+2z^2+4z^4\right)\tag{2}\\
&=4+1+\frac{1}{4}\tag{3}\\
&\,\,\color{blue}{=\frac{21}{4}}
\end{align*}

Comment:


*

*In (1) we apply the rule $[z^{p-q}]A(z)=[z^p]z^qA(z)$.   We also factor out constants to normalise terms  in the  denominator.

*In (2) we  replace the  term  $(z^6+1)^2$ in  the numerator with  $1$ since other terms do not contribute  to $[z^4]$.   We also  expand $\frac{1}{1-az^2}=1+az^2+a^2z^4+O(z^6)$  up to  terms of $z^4$ since       other     terms do not       contribute.

*In  (3)  we   extract      the        coefficients     of   $z^4$.
</s>