Skip to main content
1 of 3
David G. Stork
  • 43k
  • 3
  • 40
  • 110
myHeaviside[x_] := Which[x < 0, 0, x == 0, 1/2, x > 0, 1] 

Note that the derivative is properly calculated:

D[myHeaviside[x], x] 

(*

Which[x < 0, 0, x == 0, 0, x > 0, 0]

*)

and Simplify[%]

(*

0

*)

David G. Stork
  • 43k
  • 3
  • 40
  • 110