(self, x)
return c, e
Returns the leading term a*x**b as a tuple (a, b).

        Examples
        ========

        >>> from sympy.abc import x
        >>> (1+x+x**2).leadterm(x)
        (1, 0)
        >>> (1/x**2+x+x**2).leadterm(x)
        (1, -2)
Returns the leading term a*x**b as a tuple (a, b).
Returns the leading term a * x ** b as a tuple ( a b ) .
def leadterm(self, x):
        """
        Returns the leading term a*x**b as a tuple (a, b).

        Examples
        ========

        >>> from sympy.abc import x
        >>> (1+x+x**2).leadterm(x)
        (1, 0)
        >>> (1/x**2+x+x**2).leadterm(x)
        (1, -2)

        """
        l = self.as_leading_term(x)
        d = C.Dummy('logx')
        if l.has(C.log(x)):
            l = l.subs(C.log(x), d)
        c, e = l.as_coeff_exponent(x)
        if x in c.free_symbols:
            from sympy.utilities.misc import filldedent
            raise ValueError(filldedent("""
                cannot compute leadterm(%s, %s). The coefficient
                should have been free of x but got %s""" % (self, x, c)))
        c = c.subs(d, C.log(x))
        return c, e
def leadterm ( self , x ) : l = self . as_leading_term ( x ) d = C . Dummy ( 'logx' ) if l . has ( C . log ( x ) ) : l = l . subs ( C . log ( x ) , d ) c , e = l . as_coeff_exponent ( x ) if x in c . free_symbols : from sympy . utilities . misc import filldedent raise ValueError ( filldedent ( """
                cannot compute leadterm(%s, %s). The coefficient
                should have been free of x but got %s""" % ( self , x , c ) ) ) c = c . subs ( d , C . log ( x ) ) return c , e