$\int_0^{\infty} \frac{\ln x}{x^6 + 1}dx$ using contour integration I am looking for the solution to this improper integral. This was my approach:
Step I. (We use the 'pie slice' $\frac{\pi}{3}$). We define our log with $\frac{-\pi}{2} < \arg z < \frac{3\pi}{2}$.
\begin{equation}
\int_C \frac{\log(z)}{z^6 + 1}dz = \int_{L_1}\frac{\log(z)}{z^6 + 1}dz + \int_{L_2}\frac{\log(z)}{z^6 + 1}dz + \int_{\gamma_\epsilon}\frac{\log(z)}{z^6 + 1}dz + \int_{\Gamma_R}\frac{\log(z)}{z^6 + 1}dz
\end{equation}
Step II. Finding residues. 
The only singularity located within our contour is the singularity $e^\frac{\pi i}{6}$. 
\begin{equation}
2\pi i \operatorname{Res}(f; e^\frac{\pi i}{6}) = 2 \pi i\lim_{z\rightarrow z_0}\frac{(z-z_0)\log(z)}{z^6 - 1} = \frac{\pi^2}{18}e^\frac{\pi i}{6}
\end{equation}
Step III. Show that the integrals over $\Gamma_R$ and $\gamma_\epsilon$ $\rightarrow 0$ as $R \rightarrow \infty$ and $\epsilon \rightarrow 0$. We omit this as it is not a necessary part for this question.
Step IV. Parametrise the integral over $L_2$.
\begin{equation}
\int_{L_2}\frac{\log z}{z^6 + 1}dz = -e^{\frac{\pi i}{3}}\int_{\epsilon}^{R} \frac{\ln(x) + i \frac{\pi}{3}}{x^6 + 1}dx
\end{equation} 
Step V. When putting all of this together, we have
\begin{align}
\frac{\pi^2}{18}e^\frac{\pi i}{6} = (1-e^{\frac{\pi i}{3}})\int_{0}^{\infty} \frac{\ln(x)}{x^6 + 1}dx - i 
 e^\frac{\pi i}{3}\int_{0}^{\infty}\frac{\frac{\pi}{3}}{x^6 + 1}dx
\end{align}
Which is unfortunate because the answer is not real and therefore certainly not correct. Can you see what I did wrong?
 A: The formula you've obtained is correct. The formula contains imaginary units, but it's not yet the final answer. Except for assmuing that the formula is incorrect, you did nothing wrong. 
You have (after multiplying by $e^{-\frac{i \pi}{6}}$):
$$\frac{\pi^2}{18} = -i \int_{0}^\infty \frac{\ln x}{x^6+1}dx + \frac{\pi(1-i\sqrt{3})}{6} \int_0^\infty \frac{dx}{x^6+1} $$
Knowing that the integrals have real values, you can take the real and the imaginary part of this equation
$$\frac{\pi^2}{18} = \frac{\pi}{6} \int_0^\infty \frac{dx}{x^6+1} $$
$$0 = - \int_{0}^\infty \frac{\ln x}{x^6+1}dx - \frac{\pi\sqrt{3}}{6} \int_0^\infty \frac{dx}{x^6+1} $$
Solving this set of  equations gives you
$$ \int_0^\infty \frac{dx}{x^6+1} = \frac\pi 3$$
$$ \int_{0}^\infty \frac{\ln x}{x^6+1}dx = - \frac{\pi^2\sqrt{3}}{18}$$
If you want to obtain the values of these integrals without 'assuming' they are real, you can follow the method that Oscar Lanzi suggests in his answer.
A: I would use the whole pie with a cut.  Here is how I would do it.


*

*Start by defining the branch cut along the negative real axis with $\in z = \ln x$ on the upper side therefore $\in z = \ln x+i(2\pi)$ on the lower side.

*Draw your contour from the origin, along the upper side of the cut, around the plane at $|z|=R$ and back to the origin along the lower cut.

*Integrate $(\ln z)dz/(z^6+1)$ around this contour using methods you apparently know.  There's a catch:  because you retrace the nonnegative real axis and the logarithm differs only by a constant across the cut, you lose the $\ln z$ factor and you get only an integral for $dz/(z^6+1)$.

*To get that factor of $\ln z$ back, integrate $(\ln z)^2dz/(z^6+1)$ around your contour.  Now the difference in the squared logarithm across the branch cut will have the form $a\ln z+b$ for some constants $a$ and $b$ so this integration gives a combination of integrals for $(\ln z)dz/(z^6+1)$ and $dz/(z^6+1)$.

*Substitute the result of Step 3 for the $dz/(z^6+1)$ integral from Step 4 and solve for the $(\ln z)dz/(z^6+1)$ integral.
Have fun!
