Take the middle of the two roots $x_0=\dfrac{a+b}2$ and make a substitution $t=x-x_0$
Then $\displaystyle\int\dfrac{\mathop{dx}}{(x-a)(x-b)}=\int\dfrac{\mathop{dt}}{\left(t^2-(\frac{a-b}2)^2\right)}=-\dfrac 2{a-b}\tanh^{-1}\left(\dfrac{2t}{a-b}\right)+C\quad$ for $x\in[a,b]$
Note: for $x$ outside $[a,b]$ use the form in $\operatorname{cotanh}^{-1}$ instead.
Rem: using the formula $\tanh^{-1}(x)=\dfrac 12\ln\left(\dfrac{1+x}{1-x}\right)$, I let you convince yourself it is the same as the answer given by GNU or Clayton.
In a doubt, you can look at this post for a similar approach, where I calculated in detail the equality with other forms of the result.
Integral of product of two inverse polynomials