### A problem asked by Abhishek Gupta

Evaluate $\int \frac{x-1}{(x+1)\sqrt{x^3+x^2 +x}} \; dx$

$\int \frac{x-1}{(x+1)\sqrt{x^3+x^2 +x}} \; dx$

$= \int \frac{x-1}{x(x+1)\sqrt{x+1 +\frac{1}{x}}} \; dx$

$= \int \frac{x(x^2-1)}{x^2(x+1)^2\sqrt{x+1 +\frac{1}{x}}} \; dx$

Substitute $u = x + \frac{1}{x} + 1$, so $du = \left(1 - \frac{1}{x^2}\right) \; dx = \frac{x^2-1}{x^2} \; dx$

So, $\int \frac{x(x^2-1)}{x^2(x+1)^2\sqrt{x+1 +\frac{1}{x}}} \; dx = \frac{x}{(x+1)^2 \sqrt{u}} \; du$

$= \frac{x}{(x^2 + 2x + 1) \sqrt{u}} \; du$

$= \frac{x}{x\left(x + 2 + \frac{1}{x}\right) \sqrt{u}} \; du$

$= \frac{1}{(u + 1)\sqrt{u}} \; du$

Substitute $w = \sqrt{u}$ and get $dw = \frac{1}{2\sqrt{u}} \; du$

$= \frac{1}{(u + 1)\sqrt{u}} \; du = \int \frac{2}{w^2 + 1} = 2 \tan^{-1} w + C$

$= 2 \tan^{-1} \left(\sqrt{u}\right) + C$

$= 2 \tan^{-1} \left(\sqrt{x + \frac{1}{x} + 1}\right) + C$

Credits for solution will go to Abhishek Gupta as well.