<s>[INST] Need help in indefinite integral elimination I'm trying to get a easy and short answer for that indefinite integral:
$$\int\frac{\sqrt{x^2+x+1}}{(x+1)^2}\,dx$$
But everything I find is very big and difficult to understand (too much so it seems like a wrong result). Is there any way to solve it in a more beautiful way?
 [/INST] Let's calculate by parts first 
$\int{\frac{\sqrt{x^2+x+1}}{(1+x)^2}dx} = -\frac{\sqrt{x^2+x+1}}{1+x} + \int{\frac{1}{x+1}\cdot\frac{2x+1}{2\sqrt{x^2+x+1}}dx}\\
\int{\frac{\sqrt{x^2+x+1}}{(1+x)^2}dx} = -\frac{\sqrt{x^2+x+1}}{1+x} +\int{\frac{(2x+2)-1}{2(x+1)\sqrt{x^2+x+1}}dx}\\
\int{\frac{\sqrt{x^2+x+1}}{(1+x)^2}dx} = -\frac{\sqrt{x^2+x+1}}{1+x} +\int{\frac{1}{\sqrt{x^2+x+1}}dx} - \frac{1}{2}\int{\frac{1}{(x+1)\sqrt{x^2+x+1}}dx}
$
Integral $\int{\frac{1}{\sqrt{x^2+x+1}}dx}$ can be calculated with substitution $\sqrt{x^2+x+1} = u - x$ 
and integral $\int{\frac{1}{(x+1)\sqrt{x^2+x+1}}dx}$
can be calculated with substitution $\sqrt{x^2+x+1} = u\cdot x - 1$
</s>