Contour integral with logarithm and fraction I want to evaluate this integral:
$$J=\int_0^\infty dx\frac{\log x}{x^3+1}$$
having previously evaluated $\int_0^\infty dx\frac{1}{x^3+1}=\frac{2\pi}{3\sqrt3}$.
I use the following contour: the real axis from o to R, a part of a circumference from R to $Re^{i2/3 \pi}$ and the segment from $Re^{i2/3 \pi}$ to the origin. For $R->\infty$, the circumference goes to zero and I have: $J(1-e^{i2/3\pi})=2i\pi(\operatorname{Res}(f,e^{i\pi/3}))$. The residue is $-\frac\pi 9e^{i5/6\pi}$, but after all the calculus I have a imaginary part, that is wrong because $J$ is a real integral. How can I calculate this integral? Thank you
 A: Your contour cannot give you the result. Cutting the complex plane along the positive real axis to make the function $ln$ well defined, considering
$$f(z)=\frac{\ln^2z}{1+z^3}$$
it is such that, if $x>0$, one has $f(x+I0^+)=\frac{\ln^2 x}{1+x^3}$ and  $f(x+I0^-)=\frac{(\ln x+2i\pi)^2}{1+x^3}$. Then, with the $\gamma$ contour starting at the origin following the positive real axis (just above), following then the large circle and back to the origin by the real positive axis (just below),
$$J=\int_\gamma f(z)\,dz=-4i\pi\int_0^\infty \frac{\ln x}{1+x^3}\,dx+4\pi^2\int_0^\infty \frac{1}{1+x^3}\,dx$$ as the $\ln^2$ terms cancel in the sum of the above and below axis contributions. The interesting part comes from the double product. Moreover, the large circle contribution vanishes. Integral to be evaluated is then $I=-1/(4\pi)\Im(J)$. Poles are at $z=-1,\exp(i\pi/3),\exp(5i\pi/3)$ corresponding residues are $-\pi^2/3, -\pi^2/27\exp (i\pi/3),-25\pi^2/27\exp (i\pi/3)$. Then
$$J=2i\pi\left(-\frac{4\pi^2}{27}+i\frac{4\pi^2\sqrt{3}}{9}\right) $$Finally, $$I=-\frac{2\pi^2}{27}$$
You get the integral without $ln$ as a bonus.
