Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy import *
>>> x = symbols('x')
>>> myf = Piecewise(
... (0, x <= 0),
... (x, x > 0)
... )
>>> myf.diff(x)
Piecewise((0, x <= 0), (1, x > 0))
>>>