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}$$
 A: Since $x^3+x+1=(x-a)((x-b)^2+c^2)$ with$$\begin{align}a&:=\sqrt[3]{\frac{\sqrt{93}-9}{18}}-\sqrt[3]{\frac{2/3}{\sqrt{93}-9}},\\b&:=\frac{1}{\sqrt[3]{12(\sqrt{93}-9)}}-\sqrt[3]{\frac{\sqrt{93}-9}{144}},\\c&:=\sqrt{3}\left(\frac{1}{\sqrt[3]{12(\sqrt{93}-9)}}+\sqrt[3]{\frac{\sqrt{93}-9}{144}}\right),\end{align}$$the integrand is as follows (double-check my partial fractions):$$\frac{1}{(x-a)((x-b)^2+c^2)}=\frac{1}{(b-a)^2+C^2}\left(\frac{1}{x-a}+\frac{(b-a)-(x-b)}{(x-b)^2+c^2}\right).$$So the most general antiderivative is$$\frac{1}{(b-a)^2+C^2}\left(\ln\frac{|x-a|}{\sqrt{(x-b)^2+c^2}}+\frac{b-a}{c}\arctan\frac{x-b}{c}\right)+C,$$where the locally constant function $C$ can have different values either side of $x=a$.
A: $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.
A: Decomposing in simple fractions,
$$\frac1{x^3+x+1}=\frac a{x-r}+\frac{bx+c}{x^2-2px+p^2+q^2}
\\=\frac a{x-r}+b\frac{x-p}{(x-p)^2+q^2}+\frac{bp+c}{(x-p)^2+q^2}.$$
The antiderivatives of the terms are
$$a\log(x-r)$$
$$\frac b2\log((x-p)^2+q^2)$$
and
$$\frac{bp+c}q\arctan\frac{x-p}q.$$
All coefficients are functions of the roots.
A: My favored way with polynomials in denominator (for any degree with or without real roots)
$$\int\frac{dx}{x^3+x+1}=\int\frac{dx}{(x-a)(x-b)(x-c) }$$ where $(a,b,c)$ are the roots. Now, using partial fraction decomposition, the integrand is
$$\frac{1}{(a-b)
   (a-c) (x-a)}+\frac{1}{(b-a) (b-c) (x-b)}+\frac{1}{(c-a) (c-b) (x-c)}$$ So, the antiderivative is
$$\frac{\log(|x-a|)}{(a-b)
   (a-c) }+\frac{\log(|x-b|)}{(b-a) (b-c) }+\frac{\log(|x-c|)}{(c-a) (c-b) }$$ Now, computing the roots using the hyperbolic method for one real root
$$a=-\frac{2 }{\sqrt{3}}\sinh \left(\frac{1}{3} \sinh ^{-1}\left(\frac{3
   \sqrt{3}}{2}\right)\right)$$ Now, the sum of the roots is $0$ and their product is $-1$; moreover $b$ and $c$ are complex conjugate; then, they are "simple" to compute. By the end, recombining the second and third terms, you will end with an arctangent and a logarithm.
