Euler's Substitution method of integration.

integrate $\int\sqrt{x^2+1}dx$
Solution: in my previous post,i discussed about the definite integral, but today i will be solving a question of an indefinite integral using a special method known as the euler's substitution method. the function above can be integrated using the euler substitution method.
to integrate this we let
\begin{equation*}
\sqrt{x^2+1}=x+t............(1)\end{equation*}
the reason is that, you take the coefficient of $x^2$ which is 1 and add a new variable to it which is t.now lets square both sides and make $x$ the subject of formula.
\begin{align*}
&(\sqrt{x^2+1})^2=(x+t)^2\\
&x^2+1=x^2+2xt+t^2\\
&2xt=1-t^2\\
&x=\frac{1-t^2}{2t}=\frac{1}{2t}-\frac{t}{2}........(2)\\
&\text{differentiate x}\\
&dx=(\frac{1}{2}\frac{-1}{t^2}-\frac{1}{2})dt\\
&\text{now the equation becomes}\\
&\int\sqrt{x^2+1}dx=\int(x+t)dx\\
&\text{subst. dx into the integral}\\
&=\int(x+t)(\frac{-1}{2t^2}-\frac{1}{2})dt.........(3)\\
&\text{subst. (2) into (3)}\\
&\int(\frac{1-t^2}{2t}+t)(\frac{-1}{2t^2}-\frac{1}{2})dt\\
&\int(\frac{1-t^2+2t^2}{2t})(\frac{-1-t^2}{2t^2})dt\\
&=\int(\frac{1+t^2}{2t})(\frac{-1-t^2}{2t^2})dt=-\int\frac{(1+t^2)^2}{4t^3}\\
&=-\int\frac{1+2t^2+t^4}{4t^3}dt=-\frac{1}{4}\int(\frac{1}{t^3}+\frac{2}{t}+t)dt\\
&-\frac{1}{4}(\frac{-1}{2t^2}+2\ln|t|+\frac{t^2}{2})=\frac{1}{8t^2}-\frac{1}{2}\ln|t|-\frac{1}{8}t^2\\
&\text{factor out}\ \frac{1}{8}\\
&=\frac{1}{8}(\frac{1}{t^2-t^2})-\frac{1}{2}\ln|t|.........(4)\\
&\text{this is not where we will stop, we will have to substitute back x}\\
&\text{from eqn(1) make t subject of formula}\\
&t=\sqrt{x^2+1}-x\ \text{subst. t into first part of eqn.(4) which is}\ \frac{1}{8}(\frac{1}{t^2}-t^2)\\
&=(\frac{1}{\sqrt{x^2+1}})^2-(\sqrt{x^2+1}-x)^2\\
&\text{take the conjugate}\\
&(\frac{(1)(\sqrt{x^2+1}+x)}{(\sqrt{x^2+1}-x)(\sqrt{x^2+1}+x)})^{2}-(\sqrt{{x^2+1}-x})^2\\
&\text{expand the brackets}\\
&=(\sqrt{x^2+1}-x)^2(\sqrt{x^2+1}-x)^2\\
&\text{expand the powers of the brackets}\\
&=4x\sqrt{x^2+1}............(5)\\
&\text{and that is the evaluation,now subst.(5) into (4)}\\
&\frac{1}{8}(4x\sqrt{x^2+1})-\frac{1}{2}\ln|t|\\
&\text{now we need to subst. x for the second part too}\\
&\text{let}\ -\ln|t|=\ln|t^{-1}|=\ln|\frac{1}{t}|\\
&\text{and since}\ t=\sqrt{x^2+1}-x\\
&\ln|\frac{1}{\sqrt{x^2+1}-x}|\ \text{take the conjugate}\\
&=\ln|\frac{(1)(\sqrt{x^2+1}+x)}{(\sqrt{x^2+1}-x)(\sqrt{x^2+1}+x)}|\\
&=\ln|\sqrt{x^2+1}+x|\Rightarrow{\ln(\sqrt{x^2+1}+x}.........(7)\\
&\text{subst. (7) into (6)}\\
&=\frac{1}{8}(\sqrt{x^2+1})-\frac{1}{2}(\ln(\sqrt{x^2+1}+x)
\end{align*}
And that is it.