Finding residues in a complex integral $\int_0^\infty\frac{z^6\,\mathrm{d}z}{(z^4+1)^2}$ using Laurent series expansion I am trying to compute
$$\int_0^\infty\frac{z^6\,\mathrm{d}z}{(z^4+1)^2}.$$
I am getting stuck on computing the residues.  I am only considering the residues when $z=\mathrm{e}^{\frac{\mathrm{i}\pi}4}$ and $z=\mathrm{e}^{\frac{3\mathrm{i}\pi}4}$ since we are taking the integral from $0$ to $\infty$. When computing the residues, I am getting a computational nightmare.  For instance,
$$\underset{z=\mathrm{e}^{\frac{\mathrm{i}\pi}4}}{\textrm{Res}}\,f(z)=\lim_{z\rightarrow\mathrm{e}^{\frac{\mathrm{i}\pi}4}}\frac{\mathrm{d}}{\mathrm{d}z}\frac{z^6}{\left(z-\mathrm{e}^{\frac{3\mathrm{i}\pi}4}\right)^2\left(z-\mathrm{e}^{\frac{5\mathrm{i}\pi}4}\right)^2\left(z-\mathrm{e}^{\frac{7\mathrm{i}\pi}4}\right)^2},$$
and the derivative calculation has been quite messy.
I've also tried using $\frac{1+\mathrm{i}}{\sqrt2}$ in place of $\mathrm{e}^{\frac{\mathrm{i}\pi}4}$, and similar representations for the other roots, in the hopes of the calculation maybe "cleaning up" a bit. I was wondering if anyone could see anything that I am missing that would make computing this derivative nicer, or if these residues are just computationally "ugly".
Thank you!
 A: Let's compute the residue by finding a few terms of the Laurent series for
$$
p(z) = \frac{z^6}{(z^4+1)^2}
$$
at $\omega = e^{i\pi/4} = \frac{1+i}{\sqrt{2}}$.
To expand in powers of $z-\omega$, I prefer to write $r=z-\omega$ and expand in powers of $r$.
$$
p(r+\omega) = \frac{(r+\omega)^6}{((r+\omega)^4+1)^2}
$$
Do this in small steps.  As $r \to 0$:
$$
N:=(r+\omega)^6 = \omega^6+6\omega^5 r + O(r^2)
= -i - \omega r + O(r^2)
\\
(r+\omega)^4 = \omega^4 + 4 \omega^3 r + 6 \omega^2 r^2 + O(r^3) 
= -1+4i\omega r + 6 i r^2 + O(r^3)
\\
(r+\omega)^4 + 1 = 4i\omega r + 6 i r^2 + O(r^3)
\\
D = \big((r+\omega)^4 + 1\big)^2 = -16i r^2 - 48 \omega r^3 + O(r^4)
\\
p(r+\omega) = \frac{N}{D} =
\frac{-i - \omega r + O(r^2)}{-16i r^2 - 48 \omega r^3 + O(r^4)}
= \frac{1}{16 r^2}\left(\frac{1 - 6 i\omega r+O(r^2)}{1 - 3 i \omega r+O(r^2)}\right)
\\
=\frac{1}{16 r^2} \big(1 - 3 i \omega r + O(r^2)\big)
= \frac{1}{16} r^{-2} - \frac{3 i \omega}{16} r^{-1} + O(1)
$$
So we see that the residue is
$$
\frac{-3i\omega}{16} = \frac{3-3i}{16\sqrt{2}}
$$
A: Let $\omega=e^{i\pi/4}$.
Let $Z_n=z-\omega^n$.
$$f(z):=\frac{z^6}{(Z_3 Z_5 Z_7)^2}$$
$$\ln f=6\ln z -2\ln Z_3-2\ln Z_5-2\ln Z_7$$
$$\frac{f’}{f}=\frac6z-\frac2{Z_3}-\frac2{Z_5}-\frac2{Z_7}$$
$$f’(z)=f(z)\left[\frac6z-\frac2{Z_3}-\frac2{Z_5}-\frac2{Z_7}\right]$$
The residue equals $f’(\omega)$. The rest is just algebra.
