Integral - using Euler Substitution I've been trying to solve one simple Integral with Euler substitution several times, but can't find where I'm going wrong. The integral is (+ the answer given here, too):
$$\int\frac{1}{x\sqrt{x^2+x+1}} dx=\log(x)-\log(2\sqrt{x^2+x+1}+x+2)+\text{ constant}$$
The problem is, I cannot get this result. Below is my solution of the problem. I've checked it many times, must be something very obvious that I'm missing:
(original image)

Euler Substituion
$\displaystyle\int\frac{dx}{x\sqrt{x^2+x+1}}$
Let $\sqrt{x^2+x+1}=t-x$.
$x^2+x+1=t^2-2xt+x^2$
$x(1+2t)=t^2-1\implies x=\dfrac{t^2-1}{1+2t}$
$dx=\left(\dfrac{t^2-1}{1+2t}\right)'dt=\dfrac{2t(1+2t)-(t^2-1)2}{(1+2t)^2}=\dfrac{2t+4t^2-2t^2+2}{(1+2t)^2}=\dfrac{2(t^2+t+1)}{(1+2t)^2}$
$\sqrt{x^2+x+1}=t-x=t-\dfrac{t^2-1}{1+2t}=\dfrac{t^2+t+1}{1+2t}$
$\implies\displaystyle\int\frac{dx}{x\sqrt{x^2+x+1}}=2\int\frac{\frac{t^2+t+1}{(1+2t)^2}\;dt}{\frac{t^2-1}{1+2t}\cdot\frac{t^2+t+1}{1+2t}}=2\int \frac{1}{t^2-1}\,dt$
$\dfrac{1}{t^2-1}=\dfrac{1}{(t+1)(t-1)}=\dfrac{A}{t+1}+\dfrac{B}{t-1}\implies \begin{eqnarray}&&At-A+Bt+B=1\\&&A+B=0\implies A=-B\\ &&B-A=1\implies B=\frac{1}{2},A=-\frac{1}{2}\end{eqnarray}$
$\implies \displaystyle 2\int \frac{1}{2}\frac{1}{2t-1}\,dt-2\int\frac{1}{2}\frac{1}{t+1}\,dt=\int\frac{1}{t-1}\,dt-\int\frac{1}{t+1}\,dt=$
$=\ln|t-1|-\ln|t+1|=\ln\left|\dfrac{t-1}{t+1}\right|$
$t-x=\sqrt{x^2+x+1}\implies t=\sqrt{x^2+x+1}+x$
$\implies \ln\left|\dfrac{t-1}{t+1}\right|=\ln\left|\dfrac{\sqrt{x^2+x+1}+x-1}{\sqrt{x^2+x+1}+x+1}\right|$

I'll appreciate any help.
Thanks in advance!
 A: Looks about right. In your expression, multiply top and bottom of the thing inside the log by $\sqrt{x^2+x+1}-(x-1)$.
A: What you have done is correct. All you need to do is to rewrite it a different form.
$$\begin{align}
\ln \left( \sqrt{x^2+x+1} + x - 1\right) & = \ln \left( \dfrac{\left(\sqrt{x^2+x+1} + x - 1 \right) \left(\sqrt{x^2+x+1} - x + 1 \right)}{\left(\sqrt{x^2+x+1} - x + 1 \right)}\right)\\
& = \ln \left(\left(x^2 + x + 1 - (x^2 - 2x + 1) \right) \right) - \ln \left(\sqrt{x^2+x+1} - x + 1 \right)\\
&= \ln(x) - \ln \left(\sqrt{x^2+x+1} - x + 1 \right)
\end{align}
$$
Hence, $$\begin{align}
\ln \left( \dfrac{\sqrt{x^2+x+1} + x - 1}{\sqrt{x^2+x+1} + x + 1}\right) & = \ln \left( \sqrt{x^2+x+1} + x - 1\right) - \ln \left(\sqrt{x^2+x+1} + x + 1 \right)\\ & = \ln(x) - \ln \left(\sqrt{x^2+x+1} - x + 1 \right) -\ln \left(\sqrt{x^2+x+1} + x + 1 \right)\\
 & = \ln(x) - \left(\ln \left(\sqrt{x^2+x+1} - x + 1 \right) +\ln \left(\sqrt{x^2+x+1} + x + 1 \right) \right)\\
& = \ln(x) - \ln \left( \left(\sqrt{x^2+x+1}+1 \right)^2 - x^2\right)\\
& = \ln(x) - \ln \left( x^2 + x + 1 + 1 +2 \sqrt{x^2+x+1} - x^2\right)\\
& = \ln(x) - \ln \left( 2 \sqrt{x^2+x+1} + x + 2\right)
\end{align}$$
A: You may use substitution x=1/t, or Euler substitution \sqrt{x^2+x+1}=tx-1
