I would like to find the Laurent series of the function $$ f(x)=\frac{x^2}{(1+x^2)^2}. $$
I already know that there are two poles of order $2$, namely $x=\pm i$. And I also know that, by partial fraction decomposition, $$ \frac{x^2}{(1+x^2)^2}=\frac{1}{x^2+1}-\frac{1}{(1+x^2)^2}. $$
Here are two variations to calculate the residue of $f$ at $x=i$. We already know the pole of $f$ at $x=i$ is of order $2$. A common way is to use the
Limit formula for higher order poles:
It is somewhat more cumbersome, but also not so difficult, to calculate the remainder of $f$ at $x=i$ by consequent expansion at $x=i$.
Manual expansion in terms of $(x-i)$:
We start with \begin{align*} f(x)&=\frac{x^2}{\left(1+x^2\right)^2}=\frac{x^2}{(x+i)^2(x-i)^2}\\ &=\frac{(x-i+i)^2}{(x-i+2i)^2(x-i)^2}\\ &=\frac{(x-i)^2+2i(x-i)-1}{(2i)^2\left(1+\frac{x-i}{2i}\right)^2(x-i)^2}\\ &=-\frac{1}{4}\frac{1}{\left(1+\frac{x-i}{2i}\right)^2} +\frac{1}{2i(x-i)}\,\frac{1}{\left(1+\frac{x-i}{2i}\right)^2}\\ &\qquad+\frac{1}{4(x-i)^2}\,\frac{1}{\left(1+\frac{x-i}{2i}\right)^2}\tag{2} \end{align*} The expansion of the square of the geometric series in (2) gives \begin{align*} \frac{1}{\left(1+\frac{x-i}{2i}\right)^2} &=\left(1-\frac{x-i}{2i}+\cdots\right)\left(1-\frac{x-i}{2i}+\cdots\right)\\ &=1-\frac{x-i}{i}+\mathrm{higher\ order\ terms}\tag{3} \end{align*}