TITLE: Evaluation of $\int\frac{5x^3+3x-1}{(x^3+3x+1)^3}\,dx$
QUESTION [22 upvotes]: Evaluate the integral
  $$\int\frac{5x^3+3x-1}{(x^3+3x+1)^3}\,dx$$

My Attempt:
Let $f(x) = \frac{ax+b}{(x^3+3x+1)^2}.$ Now differentiate both side with respect to $x$, and we get
$$
\begin{align}
f'(x) &= \frac{(x^3+3x+1)^2\cdot a-2\cdot (x^3+3x+1)\cdot (3x^2+3)\cdot (ax+b)}{(x^3+3x+1)^4}\\
&= \frac{5x^3+3x-1}{(x^3+3x+1)^3}\cdot\frac{(x^3+3x+1)\cdot a-6\cdot (x^2+1)\cdot (ax+b)}{(x^3+3x+1)^3}\\
&= \frac{5x^3+3x-1}{(x^3+3x+1)^3} \frac{-5ax^3+6bx^2-3ax+(a-6b)}{(x^3+3x+1)^3}\\
&= \frac{5x^3+3x-1}{(x^3+3x+1)^3}
\end{align}
$$
for $a = -1$ and $b = 0$. Thus, by the Fundamental Theorem of Calculus,
$$
\begin{align}
\int\frac{5x^3+3x-1}{(x^3+3x+1)^3}\,dx &= \int f'(x)\,dx\\
&= f(x)\\
&= -\frac{x}{(x^3+3x+1)^2}+\mathcal{C}
\end{align}
$$
How we can solve the above integral directly (maybe by using the substitution method)?

REPLY [11 votes]: $$
\begin{aligned}\int\frac{5x^3 + 3x - 1}{\left(x^3 + 3x + 1\right)^3}\,\mathrm{d}x &=\int\frac{5x^3 + 3x-1}{\left(\sqrt{x}\left(x^{5/2}+3\sqrt{x}+x^{-1/2}\right)\right)^3}\,\mathrm{d}x\\&=\int\frac{5x^3 + 3x-1}{x^{3/2}\left(x^{5/2}+3\sqrt{x}+x^{-1/2}\right)^3}\,\mathrm{d}x\\&=\int\frac{5x^{3/2}+3x^{-1/2}-x^{-3/2}}{\left(x^{5/2}+3\sqrt{x}+x^{-1/2}\right)^3}\,\mathrm{d}x\\&=\int\frac{2\,\mathrm{d}(x^{5/2}+3\sqrt{x}+x^{-1/2})}{\left(x^{5/2}+3\sqrt{x}+x^{-1/2}\right)^3}\\&=2\int\frac{\mathrm{d}\tau}{\tau^3}\\&=-\frac{1}{\tau^2}+C\\&=-\frac{1}{\left(x^{5/2}+3\sqrt{x}+x^{-1/2}\right)^2}+C\\&=\cdots\end{aligned}
$$