<s>[INST] Integral of $\int\frac{dx}{x^2\sqrt{1-\frac{1}{x^2}}}$ I was asked to find the following integral: 
$$\int\frac{dx}{x^2\sqrt{1-\frac{1}{x^2}}}$$
What I tried to replace $\sqrt{1-\frac{1}{x^2}}$ with $u$ so that: $$du=\frac{dx}{x^3\sqrt{1-\frac{1}{x^2}}} \Rightarrow du*x=\frac{dx}{x^2\sqrt{1-\frac{1}{x^2}}}$$
And:$$x=\sqrt{\frac{1}{1-u^2}}$$
And we can replace:
$$\int\frac{dx}{x^2\sqrt{1-\frac{1}{x^2}}}=\int\frac{du}{\sqrt{1-u^2}}=\arctan(u)+C=\arctan(\sqrt{1-\frac{1}{x^2}})+C$$
The problem is, when that result is derived we don't get the original expression. I just can't find my mistake, so some help would be appreciated.
 [/INST] The substitution $u=\sqrt{1-\frac{1}{x^2}}$ is equivalent to $|x|=\frac{1}{\sqrt{1-u^2}}$.  For $x>1$, we have
$$\begin{align}
\int \frac{1}{x^2\sqrt{1-\frac1{x^2}}}\,dx&=\int \frac{1}{\sqrt{1-u^2}}\,du\\\\
&=\arcsin(u)+C\\\\
&=\arcsin\left(\frac{\sqrt{x^2-1}}{x}\right)+C\\\\
&=-\arcsin(1/x)+C'
\end{align}$$
where we used the identity $\arcsin(1/x)+\arcsin\left(\frac{\sqrt{x^2-1}}{x}\right)=(\pi/2)\text{sgn}(x)=\pi/2$ when $x>1$.
One can proceed similarly for the case in which $x<-1$.
</s>