Re: bug? f'[x]'

*To*: mathgroup at smc.vnet.net*Subject*: [mg90900] Re: bug? f'[x]'*From*: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>*Date*: Tue, 29 Jul 2008 01:37:04 -0400 (EDT)*Organization*: The Open University, Milton Keynes, UK*References*: <g6kc46$k6f$1@smc.vnet.net>

Benjamin.R.Lewis at gmail.com wrote: > In[]:= f'[x] =!= f[x]' && f''[x] === f'[x]' > Out[]= True > > Can anyone explain this? First, keep in mind that Mathematica does *pattern* matching. Second, SameQ requires exact correspondence between expressions when those expressions are expressed in *FullForm* (FullForm being the internal representation used by Mathematica regardless of the type of input). In your case, the fullform of f'[x] is Derivative[1][f][x] whereas the fullform of f[x]' is Derivative[1][f[x]], both expressions are *syntactically* not the same. OTOH, the fullform of f''[x] is Derivative[2][f][x] whereas the fullform of f'[x]' is Derivative[2][f][x], both expressions are *syntactically* the same. (Note that the fullform of f[x]'' is Derivative[2][f[x]].) In[1]:= f'[x] =!= f[x]' && f''[x] === f'[x]' Out[1]= True In[2]:= f'[x] =!= f[x]' Out[2]= True In[3]:= f''[x] === f'[x]' Out[3]= True In[4]:= f'[x] // FullForm Out[4]//FullForm= Derivative[1][f][x] In[5]:= f[x]' // FullForm Out[5]//FullForm= Derivative[1][f[x]] In[6]:= f''[x] // FullForm Out[6]//FullForm= Derivative[2][f][x] In[7]:= f'[x]' // FullForm Out[7]//FullForm= Derivative[2][f][x] Regards, -- Jean-Marc