<s>[INST] Calculate $\int\frac{dx}{x\sqrt{x^2-2}}$. The exercise is:

Calculate:$$\int\frac{dx}{x\sqrt{x^2-2}}$$

My first approach was:

Let $z:=\sqrt{x^2-2}$ then $dx = dz \frac{\sqrt{x^2-2}}{x}$ and $x^2=z^2+2$ $$\int\frac{dx}{x\sqrt{x^2-2}} = \int\frac{1}{x^2}dz = \int\frac{1}{z^2+2}dz = \frac{1}{2}\int\frac{1}{(\frac{z}{\sqrt{2}})^2 + 1}dz = \frac{1}{2} \arctan(\frac{z}{\sqrt{2}})$$
$$ = \frac{1}{2}\arctan(\frac{\sqrt{x^2-2}}{\sqrt{2}})$$

Yet when e.g. Maple derives the expression, it turns out my solution is false. I also cannot find the mistake, and I'd be glad if someone could point it out to me.
I am interested in your solutions, but in another approach I substituted $z:=\frac{\sqrt{2}}{x}$ and multiplied the integrand with $\frac{\sqrt{2}x}{\sqrt{2}x}$ and it worked out just fine.
 [/INST] The mistake is that you are integrating over $z$,you can do a substitution $$u=\frac{z}{\sqrt{2}},dz=\sqrt{2}du\\\frac{1}{2}\int\frac{\sqrt{2}du}{u^2+1}=\frac{\sqrt{2}}{2}\arctan(u)=\frac{1}{\sqrt{2}}\arctan(\frac{\sqrt{x^2-2}}{\sqrt{2}})$$
</s>