Evaluate the indefinite integral $$\int\frac{x-1}{(x+1)\sqrt{x^4+x^3+x^2}}dx$$
What I have tried
$$I = \int\frac{x^2-1}{(x^2+2x+1)\sqrt{x^4+x^3+x^2}}dx$$
$$I = \int\frac{x^2-1}{(x^2+2x+1)x\sqrt{x^2+\frac{1}{x}+1}}dx$$
How do I solve it? Help me please.
Let $x=\frac1t$,
$$I=\int\frac{x-1}{(x+1)\sqrt{x^4+x^3+x^2}}dx=\int\frac{t-1}{(t+1)\sqrt{t^2+t+1}}dt$$ $$=\int\frac{dt}{\sqrt{t^2+t+1}}-2\int\frac{dt }{(t+1)\sqrt{t^2+t+1}} $$ where the first integral is straightforward,
$$\int\frac{dt}{\sqrt{t^2+t+1}}=\int\frac{dt}{\sqrt{(t+\frac12)^2+\frac34}} =\sinh^{-1}\left(\frac{2t+1}{\sqrt3}\right)$$
and, with $u=\frac{2}{\sqrt3}(t+\frac12)=\tan y$, the second integral becomes $$\int\frac{dt }{(t+1)\sqrt{t^2+t+1}} =\int\frac{du }{(\frac{\sqrt3}2u+\frac12)\sqrt{u^2+1}} = \int\frac{\sec y }{\frac{\sqrt3}2\tan y+\frac12}dy $$ $$\int\frac{dy }{\frac{\sqrt3}2\sin y+\frac12\cos y}dy =\int\frac{dy }{\sin( y+\frac\pi6)}=\ln\left(\tan\left(\frac y2+\frac\pi{12}\right)\right) $$
Thus,
$$I=\sinh^{-1}\left(\frac{2t+1}{\sqrt3}\right) -2\ln\left(\tan\left(\frac y2+\frac\pi{12}\right)\right) +C$$