Both those integrals are correct, but over different domains. At least, if we confine all the functions to real values.
The arctanh works in the interval $(-\frac ba, \frac ba)$, the ln for $(-\infty, -\frac ba) \cup (\frac ba, \infty)$ (if both $a$ and $b$ are positive).
Remember, $\mathrm{arctanh}(u)$ has the domain $(-1,1)$. $\ln(u)$ has the domain $(0,\infty)$ and $\frac{ax-b}{ax+b}>0$ for $x<-\frac ba<$ or $\frac ba<x$ if both $a$ and $b$ are positive.
I suppose the full indefinite integral is a combination of those two given answers. (See below for an alternative.) Or, we could allow complex results for either arctanh or ln; then either one would do. Smart graphers like Geogebra apparently allow the complex values, since the derivatives take up the entire (twice-punctured) real line. Dumber graphers, like my TI-Nspire CX, stick to real values and show the reduced domains. Here are some graphs from an emulated TI-Nspire CX. In these graphs, $a=b=1$ for definiteness.


ADDED LATER:
For completeness, I should mention that there is another, easy way to get an integral that gives the derivative over the entire twice-punctured real numbers. Namely, put an absolute value inside the ln function, so we get
$$\frac{1}{2ab} \ln{\left|\frac{ax - b}{ax + b}\right|}$$
This makes sense, since some tables of integrals (such as my CRC 13th Student Edition) assumes that all integrals with $\ln(\cdot)$ in them actually mean $\ln(|\cdot|)$.
See the final graph to see the result.
