How can I force Mathematica to simplify the derivative of Sign? The following
FullSimplify[D[Sign[x], x], x > 0]
does not work. All it produces is
Sign'[x]
(On the other hand,
FullSimplify[D[Abs[x], x], x > 0]
goes through.)
How can I force Mathematica to simplify the derivative of Sign? The following
FullSimplify[D[Sign[x], x], x > 0]
does not work. All it produces is
Sign'[x]
(On the other hand,
FullSimplify[D[Abs[x], x], x > 0]
goes through.)
PiecewiseExpand[Sign, Assumptions → x > 0]
(* 1 *)
Regards M.I
Thanks. However I need to simplify Sign’, not Sign.
ComplexExpand[Re[D[Sign, x]], TargetFunctions → Conjugate]
(* 0 *)
Interesting. Thanks.
You could get around this by:
sgn[x_] := Piecewise[{{-1, x < 0}, {0, x == 0}, {1, x > 0}}]
sgn'[x]
(* Piecewise[{{0, x < 0 || x > 0}}, Indeterminate] *)
D[sgn[x], x]
(* iecewise[{{0, x < 0 || x > 0}}, Indeterminate] *)
I’m showing the InputForm of each output. In a notebook you’ll actually see the usual nice display, with a big left brace enclosing the separate cases on each line.
Or do it:
D[PiecewiseExpand[Sign[x], Assumptions -> x \[Element] Reals], x]
(*Piecewise[{{0, x < 0 || x > 0}}, Indeterminate]*)
Sign is a programming construct, not an analytic function. However, you can define a generalized function with similar properties and differentiate that:
sign[x_] := 2 HeavisideTheta[x] - 1
sign'[x]
(* 2 DiracDelta[x] *)