<s>[INST] Evaluating the integral $\int \sqrt{1 + \frac{1}{x^2}} dx$ 
$$\int \sqrt{1 + \frac{1}{x^2}} dx$$

This is from the problem calculating the arc length of $y=\log{x}$.
I tried $x = \sinh{t}$ or $\frac{1}{x} = \tan{t}$ but all failed.
 [/INST] If $x>0$,
$$\begin{align*}
I&=\int \sqrt{1 + \frac1{x^2}} \, dx \\
&= \int \frac{\sqrt{x^2+1}}{x} \, dx\\
&= -\frac12 \int \frac{(1+t^2)^2}{t^2(1-t^2)}\,dt \\
&= \int \frac{(1+u^2)^2}{u(1-u^2)^2}\,du
\end{align*}$$
by either substituting
$$t=\sqrt{1+x^2}-x \implies x=\frac{1-t^2}{2t} \implies dx = -\frac{1+t^2}{2t^2}\,dt$$
or
$$u=\frac{\sqrt{x^2+1}-1}x \implies x=\frac{2u}{1-u^2} \implies dx = 2\frac{1+u^2}{(1-u^2)^2}\,du$$
</s>