Integral asked on MIT bee qualifier 2012 $\int\frac{x-1}{(x+1)\sqrt{x^3+x^2+x}}\,dx$ I have been trying to solve this one but I have no clue, I put it into wolfram and the result is absurd, considering this one is taken from MIT bee qualifier 2012, this is the integral:
$$\int\frac{x-1}{(x+1)\sqrt{x^3+x^2+x}} \, dx$$

You can rewrite the integrand as
$$ \frac{(x-1)(x+1)}{(x+1)^2\sqrt{x^2\left(x + \dfrac{1}{x} + 1\right)}} =  \frac{x^2 - 1}{(x^3 + 2x^2 + x)\sqrt{x + \dfrac{1}{x} + 1}} \\
= \frac{1 - \dfrac{1}{x^2}}{\left( x + \dfrac{1}{x} + 2 \right)\sqrt{x + \dfrac{1}{x} + 1}} $$
Then make the substitution $u^2 = x + \dfrac{1}{x} + 1$ to get
$$ \int \frac{2}{u^2+1} du = 2\arctan u + C $$
