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.
 A: @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}.$$
A: 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}}$$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
With $\ds{z = \pars{{1 \over t} - 1}^{1/4}}$ the integral becomes:
\begin{align}
{1 \over 4}\int_{0}^{1}t^{-3/4}\pars{1 - t}^{3/4}\,\dd t & =
{1 \over 4}\,{\Gamma\pars{1/4}\Gamma\pars{7/4} \over \Gamma\pars{2}} =
{1 \over 4}\Gamma\pars{1 \over 4}
\bracks{{3 \over 4}\,\Gamma\pars{3 \over 4}}
\\[5mm] & =
{3 \over 16}\,{\pi \over \sin\pars{\pi/4}} =
\bbx{\large{3\root{2} \over 16}\,\pi} \approx 0.8330 \\ &
\end{align}
A: Note
\begin{align}
\int_0^\infty \frac{z^6}{(z^4+1)^2}dz
&\overset{z\to\frac1z}
= \int_0^\infty \frac{dz }{(z^4+1)^2}
= \frac14\int_0^\infty \frac1{z^3}d \left(\frac{z^4}{z^4+1}\right)\\
&=\frac34 \int_0^\infty \frac{dz }{z^4+1}
\overset{z\to\frac1z} = \frac38\int_0^\infty \frac{1+z^2 }{z^4+1}dz\\
& = \frac38\int_0^\infty \frac{d(z-\frac1z)}{(z-\frac1z)^2+2}
= \frac{3\pi}{8\sqrt2}
\end{align}
