Could you add A(x) and B(x) to get 2x^3 + (a+b)x^2 - 2x + (a+b)
Then sub a+b = 0
A(x) + B(x) = 2x^3 - 2x = 2x(x^2 -1)
So the factor would be x^2 - 1 since if both A(x) and B(x) are divisible by the factor then their sum must also be divisible by the same factor.
Note that x=0 is not a factor...