sympy/sympy — pull request #1109 by smichr (2012-03-07 16:02:39+00:00)
Title: 1809: extract additively succeeds if coeff move towards zero

Although I don't think it was clearly stated nor tested, the intent
of extract_additively is to see if something can be subtracted so as
to move an expression closer to zero. Anything can be subtracted from
anything; what makes extraction unique is when the expression moves
towards 0, so

>>> (x + 2).extract_additively(x + 1)
1
>>> (x + 2).extract_additively(x + 3) is None
True