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.

What do you mean by "complex integral"?  This is a real integral.  Okay, you can evaluate it using residues.
Consider $C$, the closed curve consisting of the line segment from $-R$ to $R$ union with semicircle of radius $R$ in the upper half plane
$$\oint_C  \frac{z^6}{(z^4+1)^2}\, dz =
\int_0^\pi \frac{R^6 e^{6i\theta} R i e^{i\theta} \, d\theta}{(1+ R^4 e^{4i\theta})^2} +  \int_{-R}^R \frac{x^6dx}{(1+x^4)^2}$$
$$\left| \int_0^\pi \frac{R^6 e^{6i\theta} R i e^{i\theta} \, d\theta}{(1+ R^4 e^{4i\theta})^2}\right| < \int_0^{\pi} \frac{R^7 \, d\theta}{(R^4-1)^2}<\frac{\pi}{R-2} $$
The  integral along the semicircle goes to zero as $R\to\infty$ and we are left with
$$\int_{-\infty}^\infty \frac{x^6dx}{(1+x^4)^2} = 2\pi i \left[ \text{Res}_{z=e^\frac{i \pi}{4}} \frac{z^6}{(z^4+1)^2} +  \text{Res}_{z=e^\frac{i 3\pi}{4}} \frac{z^6}{(z^4+1)^2}  \right] = \frac{3\pi}{4\sqrt{2}} $$
$$\int_0^\infty \frac{x^6}{(1+x^4)^2}= \frac{3\pi}{8\sqrt{2}}$$
