How to finish calculating of $\int_0^{\infty}\frac{\mathrm{d}z}{z^6+1}$? I have
$$\int_0^{\infty}\frac{\mathrm{d}z}{z^6+1}.$$
I am a bit confused about the residue result in my calculus, but what I've done:
$$\frac12\int_{-\infty}^{\infty}\frac{\mathrm{d}z}{z^6+1}=2\pi\mathrm{i}\left(\sum_{j=1}^n\textrm{Res}_j\right),$$
and therefore $z=\sqrt[6]{-1}$.
I figured out 3 roots that are in the contour:
\begin{align*}
\varphi_1&=\frac{\sqrt3}2+\frac{\mathrm{i}}2,\\
\varphi_2&=-\frac12+\mathrm{i},\\
\varphi_3&=-\frac{\sqrt3}2+\frac{\mathrm{i}}2.
\end{align*}
To find the residues, I used the formula for the fraction:
$$\textrm{Res}_{z = a}=\frac{\xi(a)}{\psi'(a)},$$
so therefore $$F(z) =\frac1{6z^5}\Bigg\lvert_{z= \varphi_1..\varphi_3}$$
and after that,
\begin{align*}
\textrm{Res}_1&=\frac1{6\left(\frac{\sqrt3}2+\frac{\mathrm{i}}2\right)^5},\\
\textrm{Res}_2&=\frac1{-6\left(\frac12-i\right)^5},\\
\textrm{Res}_3&=\frac1{-6\left(\frac{\sqrt3}2-\frac{\mathrm{i}}2\right)^5},
\end{align*}
but the imaginary component just did not dissapear in the final answer, so maybe I am doing something wrong? because I know that when we do real integration with residues, we should get rid of the imaginary component in the final answer.
 A: In order to perform such an integration, you need to specify a specific contour over which you're integrating, since the singularities of the integrating function vary.
A standard way of solving such integrals is :
The singularities of the integrating function : 
$$f(x) = \frac{1}{x^6+1}$$
come as : $x^6 + 1 = 0$.
But we're integrating over the bounds $0$ and $\infty$, which means we come upon only the roots that are in the upper plane (there are 3 there).
We will integrate the function $f(x)$ with respect to $x$, over the partially smooth curve that is consisted of the half-moon of the upper level of $γ_R$, with $z(θ) = Re^{iθ}$, $0 \geq θ \geq π$ and the line segment $[-R,R]$, where we take $R$ to be big enough, so that the singularity points in the upper plane are inside $γ_R$.
From the Residue-Theorem we have :
$$\int_{-R}^R \frac{1}{x^6+1}dx + \int_{γ_R}\frac{1}{z^6+1}dz = 2\pi i \sum_{x=x_1, x_2, x_3} \text{ Res } f(x)$$ 
The function also satisfies Jordan's Lemma, so it is : 
$$\lim_{R\to \infty}\int_{γ_R}\frac{1}{z^6+1}=0$$
thus :
$$ \int_0^\infty\frac{1}{x^6+1}dx=\frac{1}{2} \lim_{R\to \infty} \int_{-R}^R \frac{1}{x^6+1}dx= \pi i \sum_{x=x_1, x_2, x_3} \text{ Res } f(x)$$
where $x_1,x_2,x_3$ are the roots of $x^6+1=0$ in the upper-plane.
I'll leave the residue calculation to you!
A: Let us tackle the more general problem of finding, for some $m\in\mathbb{N}^+$,
$$ I(m)=\int_{-\infty}^{+\infty}\frac{dx}{x^{2m}+1}. $$
By exploiting parity, the substitution $\frac{1}{x^{2m}+1}=u$, Euler's Beta function and the reflection formula for the $\Gamma$ function we get $I(m)=\frac{\pi}{m\sin\frac{\pi}{2m}}$. Let us prove this identity through the residue theorem, too. $f(z)=\frac{1}{z^{2m}+1}$ has simple poles at $\zeta_k=\exp\left(\frac{2\pi i}{4m}(2k-1)\right)$ for $k=1,2,\ldots,2m$.
$$\operatorname*{Res}_{z=\zeta_k}\frac{1}{z^{2m}+1}=\lim_{z\to \zeta_k}\frac{z-z_k}{z^{2m}+1}\stackrel{d.H.}{=}\lim_{z\to z_k}\frac{z}{2m z^{2m}}=-\frac{\zeta_k}{2m} $$
hence
$$ I(m)=-\frac{\pi i}{m}\sum_{k=1}^{m}\zeta_k=-\frac{\pi i}{m}\sum_{k=1}^{m}\zeta_1^{2k-1}=-\frac{\pi i}{m}\cdot\frac{\zeta_1(\zeta_1^{2m}-1)}{\zeta_1^2-1}=\frac{2\pi i}{m\left(\zeta_1-\zeta_1^{-1}\right)}$$
and by De Moivre's formula we get
$$\boxed{ I(m)=\int_{-\infty}^{+\infty}\frac{dx}{x^{2m}+1}=\frac{\pi}{m\sin\frac{\pi}{2m}}.}$$
A: Hint:
The contour should consist of a semicircle of radius $R$ and the segment of the real axis from $-R$ to $R$.
The three roots under consideration are: $$z_1=e^{\frac{\pi i}{6}} \,, z_2=e^{\frac{3\pi i}{6}} \,, z_3=e^{\frac{5\pi i}{6}}$$
Then as you have calculated correctly, $$\text{ Res } f(z)_{z=z_i} = \frac{1}{6z^5} \Bigg\lvert_{z=z_i}$$
Thus, by residue theorem, we then have, $$I=2\pi i \sum_{z=z_1, z_2, z_3} \text{ Res } f(z)$$
