Residue of $\frac{z^2}{(1+z^2)^3}$ at $z=i$? What is the residue of the above function?  The pole at $z=i$ is order 3. Answer according to book is $1/16i$. I have tried taking 2 derivatives of $\frac{1}{1+z^2}$ in order to use $\frac{1}{1-z^2}$ geometric series, which looked promising but didn't work out.  I tried the standard formula for the residue:  $\frac{1}{(p-1)!}$ times the limit of . . .  etc.  Ended up with such messy derivatives.  What is the best way to solve this?
 A: One way to is to a partial fractions decomposition:
$$
\frac{z^2}{(1+z^2)^3}
=
\frac{i}{16 (z + i)} - \frac{1}{16 (z + i)^2} + \frac{i}{8 (z + i)^3} - \frac{i}{16 (z - i)} - \frac{1}{16 (z - i)^2} - \frac{i}{8 (z - i)^3}
$$
The only relevant term is
$$
- \frac{i}{16 (z - i)}
$$
All the other terms have primitives.
A: Factor out the negative power of $z-i$ which creates the singularity:
$$f(z) = (z-i)^{-3} \cdot \frac{z^2}{(z+i)^3}.$$
Now expand $\frac{z^2}{(z+i)^3}$ as a power series in terms of powers of $z-i$, and take $2\pi$ times the $(z-i)^2$ coefficient (which becomes the $(z-i)^{-1}$ coefficient after multiplying by $(z-i)^{-3}$).
A: Another way is to rewrite
$$
\frac{z^2}{(1+z^2)^3}=\frac{z^2+1-1}{(1+z^2)^3}=\frac{1}{(1+z^2)^2}-\frac{1}{(1+z^2)^3}=\frac{(z+i)^{-2}}{(z-i)^2}-\frac{(z+i)^{-3}}{(z-i)^3}
$$
and calculate the residues for both fractions by the standard formula with no messy derivatives any longer
\begin{align}
\frac{d}{dz}(z+i)^{-2}\bigg|_{z=i}&=\frac{-2}{(2i)^3}=\frac{1}{4i},\\
\frac12\frac{d^2}{dz^2}(z+i)^{-3}\bigg|_{z=i}&=\frac{12}{(2i)^5}=\frac{3}{16i}
\end{align}
to get
$$
\frac{1}{4i}-\frac{3}{16i}=\frac{1}{16i}.
$$
P.S. This approach is in a way a combination of other two answers: we do a kind of fraction decomposition, however, not complete, but as much as to be able to do the $z-i$ power expansion easily.
