Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


In[855]:= D[Abs[x], x] /. x -> 1

Out[855]= Derivative[1][Abs][1]

In[856]:= D[x, x] /. x -> 1

Out[856]= 1


Why is Derivative[1][Abs][x] not simplifed to 1 when x -> 1?

share|improve this question
This question was also addressed back on stackoverflow: Mathematica code: Derivative of Abs[x]. – Simon Jul 12 '12 at 10:04
Related: 8185 – Michael E2 Apr 8 '15 at 13:07
up vote 18 down vote accepted

$\mathrm{abs}(z)$ defined on the set of complex numbers $\mathbb{C}$ is not a holomorphic function because it violates the Cauchy-Riemann conditions, and the derivative is not well defined. $\mathrm{abs}(x)$ defined on the set of real numbers $\mathbb{R}$ is differentiable everywhere except at $x=0$.

Mathematica treats Abs[x] as a function defined on complex numbers and so will not simplify Abs'[x] when it occurs in expressions. However, you can force it to simplify by explicitly stating that the argument is real as follows:

FullSimplify[Abs'[x], x ∈ Reals]
(* Sign[x] *)

Also see this question for a very closely related problem.

share|improve this answer
This should be corrected "...hence is differentiable nowhere." because it may be misleading. Obvoiusly it is directionally differentiable, but not holomorphic. Besides that it would deserve the enlightened tag. – Artes Jul 12 '12 at 12:02
Alternatively, you could phrase this as "the derivative depends on the direction the limit is taken from". So, if you take the derivative along a direction $\theta$, you get $\left(\partial_z|z|\right)_{\theta}=|z|^{-1}\left(\Re(z)\cos(\theta)+\Im(z)\sin‌​(\theta)\right)$(or something like that) – acl Jul 12 '12 at 12:03
@Artes acl: Thanks, I've edited it :) – R. M. Jul 12 '12 at 13:43
It is correct to say that abs, as a complex function, is differentiable nowhere -- meaning that at each complex number it fails to have a derivative. (And then, a fortiori, of course it is nowhere holomorhpic.) The language "the derivative depends on the direction the limit is taken from" is misleading; there is nothing about "direction" involved in what "differentiable" means. – murray Jul 12 '12 at 15:10
Thanks, I've removed that sentence. I think I'll stop with the mathematical language edits, because this could go on, but I'm not a mathematician and the basic idea and the solution is there. – R. M. Jul 12 '12 at 15:31

FunctionExpand will resolve this (I think FullSimplify also calls FunctionExpand in the background):

FunctionExpand[Abs'[x], x \[Element] Reals]

(* ==> Sign[x] *)

Abs'[1] // FunctionExpand

(* ==> 1 *)
share|improve this answer
ComplexExpand works as well. – Michael E2 Apr 8 '15 at 12:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.