Sometimes I misstype an equality and I write an assignment instead.

For example, if I write

f'[x] = 2

instead of an equation, f'[x] == 2, it seems that the expression f'[x] now works as a variable which stores the value 2. And in fact,

f'[x] // FullForm
(* 2 *)

I can undo this by unsetting the assignment,

f'[x] =. ;

(* f'[x] *)

But I do not understand how and where this value is stored.

If I write

f[x] = 2;

I know that f gets a downvalue for when evaluated at x, but in the case of f'[x] I do not understand, is it modifying the definition of Derivative?

  • 1
    $\begingroup$ Related: (40314). Actually halirutan's answer to that question makes this seem like a duplicate, but I don't want to cast a binding vote on it. $\endgroup$
    – Mr.Wizard
    Jun 7, 2017 at 11:51

2 Answers 2


Yes, it will be associated to Derivative. The basic way to check this is to look at the definition of Derivative:

?? Derivative

This won't show anything about f, but it will show that Derivative has the ReadProtected attribute. This prevents the definitions from being printed. It also shows that Derivative does not have the Protected attribute, which is a big hint that its definitions can be easily changed.

So let us remove ReadProtected,

ClearAttributes[Derivative, ReadProtected]

and check again


Now you can see the definition.

As @Kuba said, there is a more convenient undocumented way (since version 10) that works without needing to remove attributes:

<< GeneralUtilities`


Consider the FullForm of f'[x]:

f'[x] // FullForm // HoldForm

If we make a definition on a similar object with a substitution for Derivative, the rule is bound to that substitution:

foo[1][f][x] = 5;

? foo


More specifically it appears in the SubValues list:

{HoldPattern[foo[1][f][x]] :> 5}

That itself could be found with:

 foo -> {OwnValues -> {}, SubValues -> {HoldPattern[foo[1][f][x]] -> 5}, 
   UpValues -> {}, DownValues -> {}, NValues -> {}, FormatValues -> {}, 
   DefaultValues -> {}, Messages -> {}, Attributes -> {}}]

Reference: Copying one symbol into another

Exactly the same evaluation is followed for your case, and indeed the rule is found in:

f'[x] = 2;

{HoldPattern[Derivative[1][f][x]] :> 2, . . . }

My point is other than the parsing of f'[x] into Derivative[1][f][x] no special behavior is observed here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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