TITLE: Evaluate $ \int_{0}^{\infty} \frac{1}{x^3+x+1}dx$
QUESTION [5 upvotes]: I want to evaluate the following integral
$$ \int_{0}^{\infty} \frac{1}{x^3+x+1}\>dx$$
via Residue theorem. Or, any other methods are welcome!
Actually i just compute this via mathematica, but it seems
the command
Integrate[1/(x^3 + x + 1), {x, 0, Infinity}]
gives some terrible output not a compact or simple form.
My first trial is factor $x^3+x+1$ into linear terms but it does not seem easy,
I have difficulties for finding poles, $i.e$, finding zeros for $x^3+x+1=0$. And having trouble for finding proper contour.

REPLY [6 votes]: Note that $x^3+x+1$ has only one real root given below by the Cardano’s formula
$$r= \sqrt[3]{\frac{\sqrt{93}-9}{18}}-\sqrt[3]{\frac{\sqrt{93}+9}{18}}=  -0.6823
$$
Then, decompose the integrand accordingly
\begin{align}
\frac1{x^3+x+1}&= \frac1{(x-r)(x^2+rx-1/r)}
=\frac r{2r +3}\left(-\frac1{x-r}+\frac{x+2r}{x^2+rx-1/r}\right)
\end{align}
and integrate to obtain
\begin{align}
\int_0^\infty \frac{dx}{x^3+x+1}
=&\frac r{2r +3}\left(-\ln\frac{x-r}{\sqrt{ x^2+rx-1/r}}
+\frac{ 3r \tan^{-1}\frac{2x+r}{\sqrt{1-3/r} } }{\sqrt{1-3/r}}\right)_{x=0}^{x=\infty}\\
=&\frac {3r}{2r +3}\left(\ln(-r)^{\frac12}
-\frac{(-r)^{\frac32}}{\sqrt{3-r} } \left(\frac\pi2 + \tan^{-1}\frac{(-r)^{\frac32}}{\sqrt{3-r} }\right)\right) \\ 
\end{align}