Differentiation of absolute value [duplicate]

I tried to differentiate D[Abs[z],z] and instead of Sign[z], I got the following:

Derivative[Abs][z]


Did I do something wrong or Mathematica just does not know how to differentiate?

marked as duplicate by Michael E2 differential-equations StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Dec 27 '18 at 2:16

• At the very top of the Mathematica,Stackexchange.com web page there is "Search on Mathematica..." If you type differentiate abs or derivative abs into 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:51
• If someone can suggest a better duplicate, I can add a link. – Michael E2 Dec 27 '18 at 2:16
• As of version 11, there's a function RealAbs whose domain is restricted to reals. It is therefore differentiable, unlike Abs. – John Doty Dec 27 '18 at 14:18
• There's also ComplexExpand: Derivative[Abs][z] // ComplexExpand – Michael E2 Dec 27 '18 at 20:58
• Now, I try FullSimplify[Sign'[x], x [Element] Reals]. It should give DiracDelta and it doesn't. Any advice? – user1765636 Dec 29 '18 at 22:03

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] *)