Clever way to compute $\int \frac{\sqrt{u^2+1}}{u^2-1} \mathrm{d}u$ Is there any subtle way to compute the following integral?
$$\int \frac{\sqrt{u^2+1}}{u^2-1}~ \mathrm{d}u$$
The solution i had in mind was substituting $u=\tan (\theta)$,then after a few calculations the integral became $$\int \sec (\theta) 
~ \mathrm{d}\theta+2\int \frac{\sec (\theta)}{\sec^2 (\theta) -2} ~\mathrm{d}\theta$$ I think we can formulate the last integral as $$\frac{1}{2}\int \left(\frac{1}{\sec (\theta) -\sqrt{2}}+\frac{1}{\sec (\theta)+\sqrt{2}} \right)\mathrm{d}\theta$$ But it still seems to be a daunting task and i think it will require further substitutions.
So could anyone please provide a out of the blue kind of solution or a clever approach to this?Or is it possible to go along my approach shortening the calculations?
 A: Use reciprocal substitution: $u=\frac{1}t$,
$$I=\frac{1}{2}\int \frac{\sqrt{t^2+1}}{t^2(t^2-1)}d(t^2+1)$$
Next, let $x=\sqrt{1+t^2}$
$$I=\int \frac{x^2}{(x^2-1)(x^2-2)}dx=\int \frac{-1}{x^2-1}+\frac{2}{x^2-2}dx$$
Can you proceed from here?
A: Note that $\int \frac1{\sqrt{u^2+1}}du=\sinh^{-1}u$. Then \begin{align}
&\int \frac{\sqrt{u^2+1}}{u^2-1}du
 - \int \frac1{\sqrt{u^2+1}}du\\
=&\int \frac2{(u^2-1)\sqrt{u^2+1}} \ du
=2\int \frac{d(\frac u{\sqrt{1+u^2}})}{\frac{2u^2}{u^2+1}-1}
= -\sqrt2\tanh^{-1}\frac{\sqrt2 u}{\sqrt{u^2+1}}
\end{align}
A: Here are a couple of ideas.
By using $\cos^{2}\left(\theta\right)\ =\ 1-\sin^{2}\left(\theta\right)$ and $\sec\left(\theta\right)=\frac{1}{\cos\left(\theta\right)}$, we can rewrite one of your integrals as
$$\int\frac{\sec\left(\theta\right)}{\sec^{2}\left(\theta\right)-2}d\theta = \int\frac{\cos\left(\theta\right)}{2\sin^{2}\left(\theta\right)-1}d\theta.$$
Let $v = \sin{(\theta)}$ and do some partial fractions. (I think you can take it from there.)
For the original integral, you can let $u = \sinh{(a)}$, do some algebra, and then make another substitution like $v = \tanh{(a)}$, but you'd still have to do some partial fractions.
I'm not sure if you consider these substitutions out-of-the-blue or subtle like what you're interested in, but these are some ideas I had in mind and wanted to share.
A: Letting $u=\tan \theta$ transforms the integral into
$$
\begin{aligned}
\int \frac{\sqrt{u^{2}+1}}{u^{2}-1} d u&=\int \frac{\sec \theta \sec ^{2} \theta d \theta}{\tan ^{2} \theta-1} \\
&=\int \frac{d\theta}{\cos \theta-2 \cos ^{3} \theta} \\
&=\int \left(\frac{1}{\cos \theta}+\frac{2 \cos {\theta}}{1-2 \cos ^{2} \theta}\right) d \theta\\&=\ln |\sec \theta+\tan \theta|+2 \int \frac{d(\sin \theta)}{2 \sin ^{2} \theta-1} \\&=\ln |\sec \theta+\tan \theta|+\sqrt{2} \ln \left|\frac{\sqrt{2} \sin \theta-1}{\sqrt{2} \sin \theta+1}\right|+C\\&=\ln \left|u+\sqrt{1+u^{2}}\right|+\sqrt{2}\ln \left| \frac{\sqrt{2} u-\sqrt{1+u^{2}}}{\sqrt{2} u+\sqrt{1+u^{2}} }\right|+C
\end{aligned}
$$
