Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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] 
f'

(* 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
5  
I believe Mathematica is treating`Abs'[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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.