<s>[INST] Solve an integral $\int\frac{1}{(1+x^2)\sqrt{x^2-1}}dx$ Solve an integral $$\int\frac{1}{(1+x^2)\sqrt{x^2-1}}dx$$
Using the third substitution of Euler,
$$\sqrt{x^2-1}=(x-1)t\Rightarrow x=\frac{1+t^2}{1-t^2},dx=\frac{4t}{(1-t^2)^2}$$
we get an integral $$\int\frac{1-t^2}{1+t^4}dt=\frac{1}{2}\int\frac{1-\sqrt 2 t}{t^2-\sqrt 2 t+1}dt+\frac{1}{2}\int\frac{1+\sqrt 2t}{t^2+\sqrt 2t+1}dt$$
Using substitutions $$u=t^2-\sqrt 2t+1$$ and $$v=t^2+\sqrt 2t+1$$
we get $$\int\frac{1-t^2}{1+t^4}dt=-\frac{\sqrt 2}{4}\ln|u|+\frac{\sqrt 2}{4}\ln|v|=-\frac{\sqrt 2}{4}\ln|t^2-\sqrt 2t+1|+\frac{\sqrt 2}{4}\ln|t^2+\sqrt 2t+1|$$
From $$x=\frac{1+t^2}{1-t^2}\Rightarrow t=\sqrt{\frac{x-1}{x+1}}\Rightarrow$$
$$\int\frac{1}{(1+x^2)\sqrt{x^2-1}}dx=$$$$-\frac{\sqrt 2}{4}\ln\left|\frac{x-1}{x+1}-\sqrt 2\sqrt{\frac{x-1}{x+1}}+1\right|+\frac{\sqrt 2}{4}\ln\left|\frac{x-1}{x+1}+\sqrt 2\sqrt{\frac{x-1}{x+1}}+1\right|+c$$
Is there another, quicker method to solve this integral, rather than Euler substitution.
 [/INST] Here's what I tried. Setting $x=\sec \theta$, we get
\begin{align*}
\int \frac{1}{(x^2+1)\sqrt{x^2-1}} \mathrm{d}x &= \int \frac{\sec \theta \tan \theta}{(\sec^2 \theta+1)\sqrt{\sec^2 \theta-1}} \mathrm{d}\theta \\
&= \int \frac{\sec \theta}{\sec^2 \theta+1} \mathrm{d}\theta \\
&= \int \frac{\cos \theta}{\cos^2 \theta+1} \mathrm{d}\theta \\
&= \int \frac{1}{2-\sin^2 \theta} \mathrm{d}(\sin \theta)\\
&= \frac{1}{2\sqrt 2} \ln \left|\frac{\sqrt 2 + \sin \theta}{\sqrt 2 - \sin \theta}\right|+C
\end{align*}
Since, $\sec \theta = x \implies \sin \theta = \frac{\sqrt {x^2-1}}{x}$, we get
$$\int \frac{1}{(x^2+1)\sqrt{x^2-1}} \mathrm{d}x = \frac{1}{2\sqrt 2} \ln \left|\frac{\sqrt 2x + \sqrt{x^2-1}}{\sqrt 2x - \sqrt{x^2-1}}\right| +C$$
</s>