I tried to differentiate D[Abs[z],z] and instead of Sign[z], I got the following:
Derivative[1][Abs][z]
Did I do something wrong or Mathematica just does not know how to differentiate?
I tried to differentiate D[Abs[z],z] and instead of Sign[z], I got the following:
Derivative[1][Abs][z]
Did I do something wrong or Mathematica just does not know how to differentiate?
For z real
Abs[z] == Sqrt[z^2] // Simplify[#, Element[z, Reals]] &
(* True *)
D[Abs[z] /. Abs[x_] :> Sqrt[x^2], z] // Simplify[#, Element[z, Reals]] &
(* z/Abs[z] *)
This is only equal to Sign[z] if z is real and z != 0
% == Sign[z] // Simplify[#, Element[z, Reals]] &
(* z != 0 *)
%% == Sign[z] // Simplify[#, Element[z, Reals] && z != 0] &
(* True *)
EDIT: That is,
D[Abs[z] /. Abs[x_] :> Sqrt[x^2], z] //
FullSimplify[#, Element[z, Reals] && z != 0] &
(* Sign[z] *)
differentiate absorderivative absinto that and tap Enter and read some of the posts on this subject then that may explain some of this to you. – Bill Dec 26 '18 at 22:51RealAbswhose domain is restricted to reals. It is therefore differentiable, unlikeAbs. – John Doty Dec 27 '18 at 14:18ComplexExpand:Derivative[1][Abs][z] // ComplexExpand– Michael E2 Dec 27 '18 at 20:58