Evaluating $\int{\frac{1}{\sqrt{x^2-1}(x^2+1)}dx}$ Evaluating $$\int{\frac{1}{\sqrt{x^2-1}(x^2+1)}dx}$$ using $ux=\sqrt{x^2-1}$
UPDATE 'official' solution 
$$u^2x^2=x^2-1$$
$$x^2=\frac{-1}{u^2-1}$$
$$x^2+1=\frac{u^2-2}{u^2-1}$$
$$2xdx=\frac{-2u}{(u^2-1)^2}$$
  $$\int{\frac{x}{x\sqrt{x^2-1}(x^2+1)}dx}$$ 
  $$\int{\frac{1}{\frac{-1}{u^2-1}u\frac{u^2-2}{u^2-1}}\left(\frac{-u}{(u^2-1)^2}\right)du} $$ 
  $$\int{\frac{1}{(u^2-2)}du} $$ 
$$\frac{\log \left(\sqrt{2}-x\right)-\log \left(x+\sqrt{2}\right)}{2 \sqrt{2}}$$
$$\frac{\log \left(\sqrt{2}-\sqrt{x^2-1}/x\right)-\log \left(\sqrt{x^2-1}/x+\sqrt{2}\right)}{2 \sqrt{2}}$$
However at mathematica I get $$\frac{\log \left(-3 x^2-2 \sqrt{2} \sqrt{x^2-1} x+1\right)-\log \left(-3 x^2+2 \sqrt{2} \sqrt{x^2-1} x+1\right)}{4 \sqrt{2}}$$
Where is the error?
 A: $$u=\frac{\sqrt{x^2-1}}x$$
$$\frac{du}{dx}=-\frac{\sqrt{x^2-1}}{x^2}+\frac{2x}{x\cdot2\sqrt{x^2-1}}$$
$$=\frac{-(x^2-1)+x^2}{x^2\sqrt{x^2-1}}$$
$$\implies\int\frac{dx}{(1+x^2)\sqrt{x^2-1}}=\int\frac{x^2}{1+x^2} \frac{dx}{x^2\sqrt{x^2-1}}$$
Now $u^2=\dfrac{x^2-1}{x^2}\implies\dfrac1{x^2}=1-u^2$
$\implies\dfrac{x^2}{1+x^2}=\dfrac1{1+1/x^2}=\dfrac1{1+1-u^2}$
A: Let us evaluate the general form of the integral
\begin{align}
\int\frac{\mathrm dx}{(x^2+a^2)\sqrt{x^2-b^2}}&=\int\frac{a\sec^2t}{(a^2\tan^2t+a^2)\sqrt{a^2\tan^2t-b^2}}\mathrm dt\tag1\\[7pt]
&=\frac{1}{a}\int\frac{\cos t}{\sqrt{a^2\sin^2t-b^2\cos^2t}}\mathrm dt\tag2\\[7pt]
&=\frac{1}{a}\int\frac{\cos t}{\sqrt{\left(a^2+b^2\right)\sin^2t-b^2}}\mathrm dt\tag3\\[7pt]
&=\frac{1}{a\sqrt{a^2+b^2}}\int\frac{\mathrm dy}{\sqrt{y^2-1}}\tag4\\[7pt]
&=\frac{\operatorname{arccosh} y}{a\sqrt{a^2+b^2}}+C\tag5\\[7pt]
&=\bbox[8pt,border:3px #FF69B4 solid]{\color{red}{\frac{1}{a\sqrt{a^2+b^2}}\operatorname{arccosh}\left(\frac{x\,\sqrt{a^2+b^2}}{b\left(x^2+a^2\right)}\right)+C}}
\end{align}
Setting $a=1$ and $b=1$, we get
$$\int\frac{\mathrm dx}{(x^2+1)\sqrt{x^2-1}}
=\bbox[8pt,border:3px #FF69B4 solid]{\color{red}{\frac{1}{\sqrt{2}}\operatorname{arccosh}\left(\frac{x\,\sqrt{2}}{x^2+1}\right)+C}}$$

Explanation :
$(1)\;$ Use substitution $\;\displaystyle x=a\tan t\quad\implies\quad\tan t=\frac{x}{a}$
$(2)\;$ Use identities $\;\displaystyle \sec^2t=1+\tan^2t\;$ and $\;\displaystyle \tan t=\frac{\sin t}{\cos t}$
$(3)\;$ Use identity $\;\displaystyle \cos^2t=1-\sin^2t$
$(4)\;$ Use substitution $\;\displaystyle \sin t=\frac{by}{\sqrt{a^2+b^2}}\,$
$(5)\;$ Use substitution $\;\displaystyle y=\cosh u\,$. We have $\;\displaystyle y=\frac{\sqrt{a^2+b^2}\sin t}{b}\,$ and $\;\displaystyle \sin t=\frac{x}{\sqrt{x^2+a^2}}\,$
A: let me try a change of variable 
$$x = {1 + t^2 \over 1 - t^2},\  dx = {-4t \ dt \over (1-t^2)^2},\ x^2+1 = {2(1+t^4) \over (1-t^2)^2}, \ x^2-1 = {4t^2 \over (1-t^2)^2}$$
$$\int {1 \over (x^2+1) \sqrt{x^2-1}} dx = \int {t^2 - 1 \over t^4 + 1} \ dt
= \int {1 \over t^2 + 1} dt - 2 \int {1 \over t^4 + 1} dt = \tan^{-1}t - 2\int{dt \over t^4+1}$$
i got to go now. i will see if can do the last integral later.
edit: Idris, thanks for the hint. i can now evaluate 
$
\begin{eqnarray}
2\int {dt \over 1 + t^4} &=& 2\int {1/t^2 \over t^2 + 1/t^2}dt
                         = \int {1+1/t^2 \over t^2 + 1/t^2} \ dt - 
 \int {1-1/t^2 \over t^2 + 1/t^2} \ dt \\
&=&\int {d(t-1/t)\over (t-1/t)^2 + 2} - 
\int {d(t+1/t)\over (t+1/t)^2 - 2} \\
&=&{1 \over \sqrt 2}\tan^{-1}\left({t - 1/t \over \sqrt 2} \right) -
{1 \over 2\sqrt 2}\ln\left({t + 1/t -\sqrt2 \over t + 1/t +\sqrt 2} \right)
\end{eqnarray}
$
so finally, 
$$\int {1 \over (x^2+1) \sqrt{x^2-1}} dx  =  \tan^{-1}t - 
{1 \over \sqrt 2}\tan^{-1}\left({t - 1/t \over \sqrt 2} \right) +
 {1 \over 2\sqrt 2}\ln\left({t + 1/t -\sqrt2 \over t + 1/t +\sqrt 2} \right) + C$$

second edit: sorry, i made a mistake and i will fix it.
$\begin{eqnarray}
\int {1 \over (x^2+1) \sqrt{x^2-1}} dx &=& \int {t^2 - 1 \over t^4 + 1} \ dt
=\int{1 - 1/t^2 \over t^2 + 1/t^2}\ dt
= \int {d(t+1/t) \over (t+1/t)^2 - 2} \ dt \\
&=& {1 \over 2\sqrt 2}\ln\left({t + 1/t -\sqrt2 \over t + 1/t +\sqrt 2} \right) + C
\end{eqnarray}$
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,{\rm Li}_{#1}}
 \newcommand{\norm}[1]{\left\vert\left\vert\, #1\,\right\vert\right\vert}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
\begin{align}&\overbrace{\color{#66f}{\large%
\int{1 \over \root{x^{2} - 1}\pars{x^{2} + 1}}\,\dd x}}
^{\ds{\dsc{x} = \dsc{\cosh\pars{t}}}}\ =\
\int{1 \over \underbrace{\root{\cosh^{2}\pars{t} - 1}}_{\dsc{\sinh\pars{t}}}\ \bracks{\cosh^{2}\pars{t} + 1}}\,\sinh\pars{t}\,\dd t
\\[5mm]&=\int{\dd t \over \cosh^{2}\pars{t} + 1}
=\int{\sech^{2}\pars{t}\,\dd t \over 1 + \sech^{2}\pars{t}}
=\int{\sech^{2}\pars{t}\,\dd t \over 2 - \tanh^{2}\pars{t}}
\\[5mm]&={1 \over 2\root{2}}
\int\bracks{{1 \over \root{2} - \tanh\pars{t}}
+{1 \over \root{2} + \tanh\pars{t}}}\sech^{2}\pars{t}\,\dd t
\\[5mm]&={\root{2} \over 4}\,
\ln\pars{1 + \tanh\pars{t}/\root{2} \over 1 - \tanh\pars{t}/\root{2}}
={\root{2} \over 2}\,\,{\rm arctanh}\pars{\tanh\pars{t} \over \root{2}}
\\[5mm]&={\root{2} \over 2}
\,\,{\rm arctanh}\pars{\root{\cosh^{2}\pars{t} - 1} \over \root{2}\cosh\pars{t}}
=\color{#66f}{\large{\root{2} \over 2}
\,\,{\rm arctanh}\pars{\root{x^{2} - 1} \over \root{2}x}}
+ \mbox{a constant}
\end{align}
