From wikipedia the derivative of the Sign[x] function has the following property:

$\qquad \frac{d}{dx}{\rm Sign}[x]=2\delta[x]$

Where $\delta[x]={\rm DiracDelta}[x]$. It seems that Mathematica ignores this property. If I'm not wrong about this, is there a way to assign this property globally (for all Notebook cells)?

  • 1
    $\begingroup$ That's a "delta", not a "theta". It refers to Dirac's delta function. The relationship you cite is valid only for real numbers, while Sign works for all complex ones. $\endgroup$ – Szabolcs Feb 13 '17 at 19:55
  • 3
    $\begingroup$ BTW you can always define your own: Clear[realSign]; realSign[0] = 0; realSign[x_] := -1 /; x < 0; realSign[x_] := 1 /; x > 0; realSign' = 2 DiracDelta[#] & $\endgroup$ – Szabolcs Feb 13 '17 at 19:55
  • 5
    $\begingroup$ Why not use sign[x_] := 2 HeavisideTheta[x] - 1 instead? You can also use the technique I provided in (137443) $\endgroup$ – Carl Woll Feb 13 '17 at 19:58
  • 1
    $\begingroup$ You can simply override this behaviour: Unprotect[Derivative]; Derivative[1][Sign][x_Symbol] := 2*DiracDelta[x] Protect[Derivative]; but i suggest to implement your own sign function which behaves like that suggested by Carl Woll $\endgroup$ – Julien Kluge Feb 13 '17 at 20:48
  • 1
    $\begingroup$ @Julien Kluge Your suggestion doesn't work for D[Sign[f[x]], x]. If you want to change how Sign is differentiated, it is better to use the technique in the link I mention above. $\endgroup$ – Carl Woll Feb 14 '17 at 4:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.