### Interesting integral problem with tricky solution

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$

Substitute $u = x + 1 + \frac{1}{x}$ and $du = 1 -\frac{1}{x^2}\; dx = \frac{x^2-1}{x^2}\; dx$

or, $(x - 1)\; dx = \frac{x^2}{x+1}\; du$

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

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

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

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

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

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

or, $2dw = \frac{du}{\sqrt{u}}$, and we have

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

$=2\int \frac{dw}{w^2+ 1} \; du$

$=2\tan^{-1} w + C$

$= 2tan^{-1} \sqrt{u}+C$

$= 2tan^{-1} \sqrt{x + 1 +\frac{1}{x}} + C$