TITLE: Evaluating $\int{\frac{1}{\sqrt{x^2-1}(x^2+1)}dx}$
QUESTION [5 upvotes]: 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?

REPLY [2 votes]: $\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}