'Return the positive Rational that can be extracted non-recursively
from every term of self (i.e., self is treated like an Add). This is
like the as_coeff_Mul() method but primitive always extracts a positive
Rational (never a negative or a Float).
Examples
>>> from sympy.abc import x
>>> (3*(x + 1)**2).primitive()
(3, (x + 1)**2)
>>> a = (6*x + 2); a.primitive()
(2, 3*x + 1)
>>> b = (x/2 + 3); b.primitive()
(1/2, x + 6)
>>> (a*b).primitive() == (1, a*b)
True'

def primitive(self):

    if (not self):
        return (S.One, S.Zero)
    (c, r) = self.as_coeff_Mul(rational=True)
    if c.is_negative:
        (c, r) = ((- c), (- r))
    return (c, r)
