Needs["Algebra`PolynomialExtendedGCD`"]

Clear[LogToArcTan]
LogToArcTan[a_, b_, x_] := 
      LogToArcTan[-b, a, x] /; 
        Exponent[a, x] < Exponent[b, x]
LogToArcTan[a_, b_, x_] := 
      2  ArcTan[a/b] /; 
        PolynomialQ[Together[a/b], x]
LogToArcTan[a_, b_, x_] := 
      Module[{g, c, d}, 
{g, {d, c}} = 
          PolynomialExtendedGCD[b, -a]; 
2 
             ArcTan[Together[(a*d + b*c)/g]] + 
          LogToArcTan[d, c, x]
]

rioboo = LogToArcTan[(x^3) - 3  x, (x^2) - 2, x]

Plot[(rioboo/2), {x, -3, 3}]