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?
 A: Motivated by completing the square in $x^2+x+1$, the change of variables $u = \sqrt{4/3} (x + 1/2)$ makes the integral
$$ \int \dfrac{\sqrt{u^2+1}}{(u + 1/\sqrt{3})^2}\; du $$
Then another substitution $v = \sqrt{u^2+1} - u$  transforms this to the integral of a rational function, which can be done using partial fractions.
EDIT: More generally, the change of variables $v = \sqrt{x^2 + a x + b} - x$
(and thus $x = (v^2-b)/(a-2v)$) is often useful for integrals involving $\sqrt{x^2+ax+b}$.  It transforms the integral 
$$ \int \sqrt{x^2+ax+b}\; R(x)\; dx$$
to 
$$ \int \dfrac{2(v^2-av+b)^2}{(a-2v)^3} R\left(\frac{v^2-b}{a-2v}\right)\; dv$$
A: If we let $$p=2\frac{\sqrt{x^2+x+1}}{x+1},q=\frac{x-1}{x+1}
$$So $p^2=3+q^2$ with $p\text{d}p=q\text{d}q$.And
\begin{aligned}\int{\frac{x\mathrm{d}x}{\left( 1+x \right) ^2\sqrt{x^2+x+1}}}&=\frac{1}{2}\int{\frac{q+1}{p}\mathrm{d}q}
\\
&=\frac{1}{2}\int{\mathrm{d}p}+\frac{1}{2}\int{\frac{\mathrm{d}q}{p}}
\\
&=\frac{1}{2}p+\frac{1}{2}\int{\frac{\mathrm{d}q+\mathrm{d}p}{p+q}}
\\
&=\frac{1}{2}p+\frac{1}{2}\ln \left( p+q \right) 
\end{aligned}
At this time,indefinite integral can be easily done:
\begin{align}&\int{\frac{\sqrt{x^2+x+1}}{\left( 1+x \right) ^2}\mathrm{d}x}=\int{\frac{x^2+x+1}{\left( 1+x \right) ^2\sqrt{x^2+x+1}}\mathrm{d}x}
\\
&=\int{\frac{\mathrm{d}x}{\sqrt{x^2+x+1}}}-\int{\frac{x\mathrm{d}x}{\left( 1+x \right) ^2\sqrt{x^2+x+1}}}
\\
&=\ln \left( x+\frac{1}{2}+\sqrt{x^2+x+1} \right) -\frac{\sqrt{x^2+x+1}}{x+1}-\frac{1}{2}\ln \left( \frac{x-1+2\sqrt{x^2+x+1}}{x+1} \right) 
\end{align}
A: 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$
