<s>[INST] Breaking up an integral using substitution? I am faced with the following integral, and am required to use substitution to solve it, using $u = \frac{1}{x}$. 
$$\int \dfrac{1}{x^2\sqrt{x^2+1}} \, dx$$
I know I can break up the equation in:
$$\int \dfrac{1}{x}\dfrac{1}{x}\dfrac{1}{\sqrt{x^2+1}} \, dx.$$
How would I go about replacing the variable $x$ in the sqrt though? 
 [/INST] $x=\tan u$  $\Rightarrow$ $dx=(1+\tan^{2}u)du$
So
\begin{align*}
\int\frac{1}{x^{2}\sqrt{x^{2}+1}} & =\int\frac{1}{\tan^{2}u\sqrt{1+\tan^{2}u}}(1+\tan^{2}u)du=\int\frac{\sqrt{1+\tan^{2}u}}{\tan^{2}u}du\\
 & =\int\frac{\sec u}{\tan^{2}u}du
\end{align*}
$$
$$
after some simplification 
\begin{align*}
\int\frac{\sec u}{\tan^{2}u}du & =\int\frac{\cos u}{\sin^{2}u}du
\end{align*}
make substution $s=\sin u\Rightarrow ds=\cos udu$
so 
$$
\begin{align*}
\int\frac{\cos u}{\sin^{2}u}du & =\int\frac{ds}{s^{2}}=\frac{-1}{s}+c
\end{align*}
$$
by back substution $s=\sin u$
$$
\
=\frac{-1}{\sin u}+c
\
$$
and finally by $u=\arctan(x)$
we get
$$
\
=\frac{-1}{\sin (\arctan x)}+c
\
$$
</s>