find the complex integral: $\int_0^\infty \frac{z^6}{(z^4+1)^2}dz$. Problem with integral formula.... Question I am trying to find the complex integral: $\displaystyle\int_0^\infty \frac{z^6}{(z^4+1)^2}dz$.
My Attempt (and eventual question): $\int_0^\infty \frac{z^6}{(z^4+1)^2}dz=\frac{1}{2}\int_\infty^\infty\frac{z^6}{(z^4+1)^2}dz$.  Now, the singularities of $z^4+1$ are of the form $z_k=e^{\frac{i(\pi+2\pi k)}{4}}$, where $k=0,1,2,3$.  Drawing the contour in the upper half plane, we see tht the only two singularities in our contour are $z_0=e^{\frac{i\pi}{4}}$ and $z_1=e^{\frac{i3\pi}{4}}$.
Let $f(z)=\frac{g(z)}{h(z)}$ where $g(z)=z^6$ and $h(z)=(z^4+1)^2$.  Then, $h'(z)=8z^3(z^4+1)$.    So, the value of the integral is $2\pi i\frac{1}{2}\sum_{k=0}^1\frac{z_k^6}{8z_k^3(z_k^4+1)}=\frac{\pi i}{8}\Big(\frac{e^{i\frac{3\pi}{2}}}{e^{i\frac{3\pi}{4}}(e^{i\pi}+1)}+\frac{e^{i\frac{\pi}{2}}}{e^{i\frac{\pi}{4}}(e^{i\pi}+1)}\Big)$.  But, $e^{i\pi}+1=0$, so I must have done something wrong....?  Any insight would be great!  Thank you.

@Vercassivelaunos has the right idea; it's not even that computationally demanding. A root $a$ of $z^4+1$ has residue$$\begin{align}\lim_{z\to a}\tfrac{d}{dz}\tfrac{(z-a)^2z^6}{(z^4+1)^2}&=\lim_{z\to a}\tfrac{2(z-a)z^5(az^4+4z-3a)}{(z^4+1)^3}\\&=2a^5\lim_{\epsilon\to0}\tfrac{\epsilon(a(a+\epsilon)^4+4(a+\epsilon)-3a)}{(4a^3\epsilon)^3}\\&=\tfrac{1}{32a^4}\lim_{\epsilon\to0}\tfrac{a(a+\epsilon)^4+a+4\epsilon}{\epsilon^2}.\end{align}$$Of course, the numerator's $\epsilon^0$ and $\epsilon^1$ terms vanish, and the $\epsilon^2$ coefficient is $a\binom42a^2$, so the residue is $\frac{3}{16a}$. So the integral on $\Bbb R$ is $2\pi i\frac{3}{16}(e^{-\pi i/4}+e^{-3\pi i/4})=\frac{3\pi\sqrt{2}}{8}$, while the original integral is $\frac{3\pi\sqrt{2}}{16}$.
For what it's worth, you could also have solved this with $z=\tan^{1/2}t$ if you know your Beta & Gamma functions; the original integral becomes$$\tfrac12\int_0^{\pi/2}\sin^{5/2}t\cos^{-1/2}tdt=\tfrac14\operatorname{B}(\tfrac74,\,\tfrac14)=\tfrac14\Gamma(\tfrac74)\Gamma(\tfrac14)=\tfrac{3\pi}{16}\csc\tfrac{\pi}{4}=\tfrac{3\pi\sqrt{2}}{16}.$$
