What am I doing wrong with this Euler substitution

integration

I want to evaluate the integral $\displaystyle\int\frac{1}{x\sqrt{x^2+2}}dx$ using the substitution $\sqrt{x^2+2}=-x+t$.

So I get from the substitution $x=\frac{t^2-2}{2t}$, $dx=\frac{t^2+2}{2t^2}dt$ and $\sqrt{x^2+2}=\frac{t^2+2}{2t}$. Substituting all this in I get:

$\displaystyle\int\frac{1}{x\sqrt{x^2+2}}dx=\int\frac{1}{\frac{t^2-2}{2t}\frac{t^2+2}{2t}}\frac{t^2+2}{2t^2}dt$

$\displaystyle= 2\int\frac{1}{t^2-2}dt$

$\displaystyle=\frac{1}{\sqrt{2}}\int\frac{1}{t-\sqrt{2}}-\frac{1}{t+\sqrt{2}}dt$

$\displaystyle=\frac{1}{\sqrt{2}}\ln{\left(\frac{t-\sqrt{2}}{t+\sqrt{2}}\right)}+c$

$\displaystyle=\frac{1}{\sqrt{2}}\ln{\left(\frac{x+\sqrt{x^2+2}-\sqrt{2}}{x+\sqrt{x^2+2}+\sqrt{2}}\right)}+c$

However the answer on Wolfram Alpha seems to be $\displaystyle=\frac{1}{2\sqrt{2}}\ln{\left(\frac{\sqrt{x^2+2}-\sqrt{2}}{\sqrt{x^2+2}+\sqrt{2}}\right)}+c$. I'm am completely new to these Euler substitutions so could someone check if I'd done it right?

Best Answer

Both the answers are correct as $ {\left(\frac{x+\sqrt{x^2+2}-\sqrt{2}}{x+\sqrt{x^2+2}+\sqrt{2}}\right)}^2={\left(\frac{x^2+2+x\sqrt{x^2+2}-\sqrt{2x^2+4}-\sqrt{2}x}{x^2+2+x\sqrt{x^2+2}+\sqrt{2x^2+4}+\sqrt{2}x}\right)}={\left(\frac{\sqrt{x^2+2}-\sqrt{2}}{\sqrt{x^2+2}+\sqrt{2}}\right)}$

It can be proved by using compendo-dividendo: ($\frac{a}{b}=\frac{c}{d}\implies \frac{a+b}{a-b}=\frac{c+d}{c-d})$

${\left(\frac{x^2+2+x\sqrt{x^2+2}-\sqrt{2x^2+4}-\sqrt{2}x}{x^2+2+x\sqrt{x^2+2}+\sqrt{2x^2+4}+\sqrt{2}x}\right)}={\left(\frac{\sqrt{x^2+2}-\sqrt{2}}{\sqrt{x^2+2}+\sqrt{2}}\right)}$

$\implies $ ${\left(\frac{x^2+2+x\sqrt{x^2+2}}{\sqrt{2x^2+4}+\sqrt{2}x}\right)}={\left(\frac{\sqrt{x^2+2}}{\sqrt{2}}\right)}$

Related Question