Version 12.1 on a Mac

The question about the derivative of Abs' has been asked several times, but all previous posts dealt with Abs'[x] and my question is about Abs'[1].

It seems to me that there are no complex-numbers issues with Abs'[1], yet


does not simplify to 1.0. Is there a way to overcome this?


For me, Abs appeared as a result of calling Norm on a real vector. How do I make it use RealAbs?

  • 2
    $\begingroup$ 1 is a complex number, too. The problem is that Abs[z] is a complex function, not whether z is in the subset of real numbers. In terms of complex function theory, Abs'[z] is undefined. You can deal with it as it is dealt with elsewhere, such as ComplexExpand[Abs'[1]]. $\endgroup$ – Michael E2 Apr 6 at 18:56

One must somehow assert the domain $\mathbb{R}$ because the default domain is $\mathbb{C}$.

The symbol RealAbs is one such way:


Also note that just because there are no explicit complex numbers doesn't mean the derivative exists over $\mathbb{C}$. Here's the derivative at z == 1 over both domains:

dq = DifferenceQuotient[Abs[z], {z, h}] /. z -> 1;

Limit[dq, h -> 0, Direction -> Complexes]
Limit[dq, h -> 0, Direction -> Reals]
| improve this answer | |
  • $\begingroup$ Thanks, this clarifies the behavior. But how does one make the following work: NIntegrate[D[Norm[{Sin[t], Cos[t]}], t], {t, 0, 2 [Pi]}] $\endgroup$ – Wynne Apr 6 at 20:48
  • $\begingroup$ You could define RealNorm[args__] := Norm[args] /. Abs -> RealAbs. $\endgroup$ – Chip Hurst Apr 6 at 21:17
  • $\begingroup$ You could even remove some instance of Abs with RealNorm[args__] := Norm[args] /. {Abs[f_]^n_Integer?EvenQ :> f^n, Abs[f_] :> RealAbs[f]} $\endgroup$ – Chip Hurst Apr 6 at 23:37

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.