How to do integral $\int\frac1{x^3+x+1}dx$? I've been stuck by this integral. I only knew that roots of the cubic equation are complex.
Please help me with this. $$\int\frac{dx}{x^3+x+1}$$

$x^3+x+1$ has one real and a pair of complex roots. The real root is $r= -0.6823$, given analytically by the Cardano’s formula. Decompose the integrand in terms of $r$
\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 then integrate to obtain
$$\int \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)
$$
where $r^3=-r-1$ is recognized in above derivation.
