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

I noticed the following difference

Assuming[x ∈ Reals, FullSimplify[D[Abs[2 x], x]]]

(* 2 Sign[x] *)

Assuming[x ∈ Reals, FullSimplify[Abs'[2 x]]]

(* Sign[x] *)

While it is clear that the first line of code above returns the correct result, I wonder why the call of Derivative fails? A little further investigation shows that

f[x_] := Abs[2 x] 

(* 2 Derivative[1][Abs][#1] & *)

which is correct and implies that the difference might come from with or without SetDelayed. But I still do not fully understand why the second code failed.

share|improve this question
I believe Mathematica is treatingAbs'[2x] as Abs'[u] which when simplification occurs Sign[u]=Sign[2x]->Sign[x]. This can be seen if you substitute x^3 for 2x – ubpdqn Oct 25 '13 at 8:13
@ubpdqn You are right, thanks. – saturasl Oct 25 '13 at 21:27
up vote 5 down vote accepted

It is easier to see what is going on if we look at a function that doesn't need any assumptions about its domain.

D[Sin[2 x], x]
2 Cos[2 x]

Now let's look at what is almost the full form of Sin'[2 x]

Derivative[1][Sin][2 x]
Cos[2 x]

That happens because this 2nd form is equivalent to (Derivative[1][Sin])[2 x]

share|improve this answer
Thanks. According to my understanding, Derivative carries out only parts of the entire chain rule; whereas D actually calls Derivative multiple times to carry out the entire chain rule. This is the relation between D and Derivative. Please correct me if I am wrong. – saturasl Oct 25 '13 at 21:26

Your Answer


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

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