1/4 (-4 x + x^2 + 2 x A + B)
If the solution is a linear combination of the constants
Int[Surd[x_, -1], x_] := Simp[Log[x], x] Int[Surd[x_, n_Integer], x_] := If[n>0, (n/(n+1))*x*Surd[x,n], ((-n/(-n-1))*x)/Surd[x, -n]] /; FreeQ[n, x] && NeQ[n, -1]
x^m Surd[x,n]^pwhere m is a positive integer, and n and p can be numeric or symbolic. Then you could post this add-on package to Rubi making it available to the Rubi community.
_.pattern object for
pto unify your first two rules.
symja_android_library's rule dump in their repo and that seems attractive.
MathematicaSyntaxTestSuitewould also help loads.