<s>[INST] Integration using Euler $\int \frac{\sqrt{x^2+2x-1} }x\,dx$ I've just tried to use the Euler's formula for my integral, but I can't get the correct answer. So if anyone could help me I would really appreciate that.
This is my integral:
$$\int\frac{\sqrt{x^2+2x-1} }{x}\,dx$$
P.S. The ingral must be solven using Euler's formula
This is where I've got stuck:
I started with this substitution:
$$\sqrt{x^2+2x-1} = -x + t$$
After derivating I get $dx= t^2 + 2x -1 /2(t+1)^2$.
After immpleneting it into my integral, I get to this point
$$\int\frac{(t^2+2t-1)(t^2+2t-1)}{(t^2+1)2(t+1)^2}\,dt$$ I don't have any idea what I should do next (thought to do another substitution but don't know what to substitute).
 [/INST] Before applying any substitutions, rewrite the integral as
\begin{align}
I=&\int\frac{\sqrt{x^2+2x-1} }{x}\,dx\\
= &\ \sqrt{x^2+2x-1} +\int \frac1{\sqrt{x^2+2x-1} }dx
- \int \frac1{x\sqrt{x^2+2x-1} }dx
\end{align}
Then, with the Euler substitution $\sqrt{x^2+2x-1} = t-x $
\begin{align}
&\int \frac1{\sqrt{x^2+2x-1} }dx=\int \frac1{1+t}dt =\ln|1+t|\\
&\int \frac1{x\sqrt{x^2+2x-1} }dx=\int \frac2{1+t^2}dt = 2\tan^{-1}t\\
\end{align}
As a result
\begin{align}
I= \sqrt{x^2+2x-1} +\ln\left|1+x+ \sqrt{x^2+2x-1}\right|\\
- 2\tan^{-1}(x+ \sqrt{x^2+2x-1})\\
\end{align}
</s>