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?

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.
