We have to do integration with substitution.
I tried to solve it and got stuck after getting $\int \frac{dz}{x(z+1)}$
The answer is given as $2tan^{-1}(x +\sqrt {x^2 +2x-1})$
$z-x=\sqrt{x^2+2x-1}$
$z^2+x^2-2zx=x^2+2x-1$
$z^2+1=2zx+2x$
$zx+x=(z+1)x$