<s>[INST] How to compute the integral of $ \frac{\sqrt{(x^2+1)}}{x^2}$? II have spent hours trying to find the right substitution but I have had no results.
I have tried using $x=\tan u$ but it did not give the result shown in my book.
 [/INST] $$\int \frac{\sqrt{x^2+1}}{x^2}dx$$
Apply Integration By Parts:$\:\int \:uv'=uv-\int \:u'v$
$u=\sqrt{x^2+1},\:u'=\frac{x}{\sqrt{x^2+1}},\:\:v'=\frac{1}{x^2},\:\:v=-\frac{1}{x}$
Then
$$\int \frac{\sqrt{x^2+1}}{x^2}dx=-\frac{\sqrt{x^2+1}}{x}-\int \:-\frac{1}{\sqrt{x^2+1}}dx$$
$$=-\frac{\sqrt{x^2+1}}{x}-\int \:-\frac{1}{\sqrt{x^2+1}}dx$$
Then Note:
$\int \:-\frac{1}{\sqrt{x^2+1}}dx=-arcsinh \left(x\right)$
So
$$\int \frac{\sqrt{x^2+1}}{x^2}dx=\color{red}{arcsinh \left(x\right)-\frac{\sqrt{x^2+1}}{x}+C}$$
</s>