'is_simple(self, x)
Tells whether the argument(args[0]) of DiracDelta is a linear
expression in x.
x can be:
- a symbol
Examples
>>> from sympy import DiracDelta, cos
>>> from sympy.abc import x, y
>>> DiracDelta(x*y).is_simple(x)
True
>>> DiracDelta(x*y).is_simple(y)
True
>>> DiracDelta(x**2 + x - 2).is_simple(x)
False
>>> DiracDelta(cos(x)).is_simple(x)
False
See Also
simplify, Diracdelta'

def is_simple(self, x):

    p = self.args[0].as_poly(x)
    if p:
        return (p.degree() == 1)
    return False
