Issue solving an integral I'm having issues solving the following integral:
$$ \int{\frac{e^x}{e^{2x}-e^x-2}}dx $$
From what I can tell, I should substitute $u = e^x$ and $du = e^xdx$ and end up with
$$ \int{\frac{1}{u^2 - u - 2}}du $$
where I can then use partial fraction decomposition to simplify the integrand as follows
$$ \frac{1}{u^2 - u - 2} = \frac{A}{u-2} + \frac{B}{u+1} $$
$$ A(u+1) + B(u-2) = 1 $$
$$ Au + A + Bu -2B = 1 $$
$$\begin{pmatrix}1 & 1 & 0\\1 & -2 & 1\end{pmatrix} \to \begin{pmatrix} 1 & 0 & \frac{1}{3} \\ 0 & 1 & -\frac{1}{3} \end{pmatrix} \to A=\frac{1}{3}, B=-\frac{1}{3} $$
So I have
$$ \int{ \left( \frac{ \frac{1}{3} }{u-2} - \frac{ \frac{1}{3} }{u + 1} \right) } du = \frac{1}{3} \int{\frac{1}{u - 2}du} - \frac{1}{3}\int{\frac{1}{u+1}}du $$
which gives me
$$ \frac{1}{3}\ln(u-2) - \frac{1}{3}\ln(u + 1) + C, \textrm{ where } u =e^x $$
so my final answer is
$$ \frac{1}{3}( \ln(e^x-2) - \ln(e^x + 1) ) + C $$
However, wolframalpha is telling me that the answer is
$$ \frac{2}{3}\tanh^{-1}\left(\frac{1}{3} - \frac{2e^x}{3}\right) + C $$
I really have no idea how the inverse tangent hyperbolic function would even get there. We haven't even covered any integrals that give $\tanh^{-1}$ in class.

It turns out that$$\operatorname{arctanh}'(x)=\frac1{1-x^2}.$$But\begin{align}\frac1{u^2-u-2}&=\frac1{\left(u-\frac12\right)^2-\frac94}\\&=-\frac49\frac1{1-\left(\frac13-\frac{2u}3\right)^2},\end{align}and therefore\begin{align}\left(\frac23\operatorname{arctanh}\left(\frac13-\frac{2u}3\right)\right)'&=-\frac49\frac1{1-\left(\frac13-\frac{2u}3\right)^2}\\&=\frac1{u^2-u-2}.\end{align}
