Evaluate $\int \frac{1}{x^3+3x+1}dx$ Evaluate $$\int \frac{1}{x^3+3x+1}dx$$
I tried to evaluate it but I couldn't  do . 
 A: The polynomial $x^3+3x+1$ has exactly $1$ real root (at $a\sim-0.32$, according to WA), and hence two complex-conjugate roots. So $x^3+3x+1=(x-a)(x^2+bx+c)$ where $b^2-4c<0$. So your steps would be the following:
1) Break $\frac1{x^3+3x+1}$ as 
$$\frac1{x^3+3x+1}=\left(\frac1{x-a}-\frac{x+(a+b)}{x^2+bx+c}\right)\frac1{a^2+ab+c}$$
(open parenthesis to check)
2) Integrate, remembering that 
$$\frac{1}{x^2+bx+c}=\frac{1}{\left(x+\frac b2\right)^2+c-\frac{b^2}4}$$
and that $b^2-4c<0$, hence $4c-b^2>0$.
A: By setting $x=2z$ we have
$$I=\int\frac{dx}{x^3+3x+1}=\int\frac{dz}{4z^3+3z+1/2}$$
and by replacing $z$ with $\sinh t$, then $t$ with $\log u$,  we have:
$$ I = \int \frac{\cosh t}{1/2+\sinh(3t)}\,dt =\int\frac{u^3+u}{u^6+u^3-1}\,du$$
that is a bit better to deal with and, more important, gives that:
$$ 4z^3+3z+1/2 = \left(z+\sinh\frac{\operatorname{arcsinh} 1/2}{3}\right)\left(4z^2-4\sinh\frac{\operatorname{arcsinh} 1/2}{3}z+\frac{1}{2\sinh\frac{\operatorname{arcsinh} 1/2}{3}}\right)$$
so we have the roots of $x^3+3x+1$ in a explicit trigonometric form and we can compute $I$ through partial fraction decomposition. We also have:
$$\operatorname{arcsinh}\frac{1}{2}=\log\left(\frac{1+\sqrt{5}}{2}\right).$$
A: Using partial fraction expansion gives,
$$\int \frac{1}{x^3+3x+1}dx=\int \left(\frac{a_1}{x-x_1}+\frac{a_2}{x-x_2}+\frac{a_3}{x-x_3}\right)dx$$
where $x_1$, $x_2$, and $x_3$ are the roots (which can be found in closed form) and the constants $a_i$, $i=1,2,3$ are given by $a_i=\frac{1}{3x_i^2+3}$.
Note that here, only one root is real (say $x_1$ is real).  Then, $x_2$ and $x_3$ are complex conjugates and $a_1$ and $a_2$ are complex conjugates.  Thus, the integral simplifies to 
$$\int \frac{1}{x^3+3x+1}dx=a_1\log |x-x_1|+2\Re \left(a_2\log (x-x_2)\right)+C$$
where $\Re \left(a_2\log (x-x_2)\right)$ is the real part of $a_2\log (x-x_2)$ and $C$ is a constant of integration.  Writing
$$a_{2r}=\Re (a_2)$$
$$a_{2i}=\Im (a_2)$$
$$x_{2r}=\Re (x_2)$$
$$x_{2i}=\Im (2_2)$$
the integral becomes
$$\int \frac{1}{x^3+3x+1}dx=a_1\log |x-x_1|+a_{2r}\log \left((x-x_{2r})^2+x_{2i}^2\right)+2a_{2i}\arctan \left(\frac{x_{2i}}{x-x_{2r}}\right)+C$$
