daudaudaudau Messages 297 Reaction score 0 Thread starter Oct 20, 2008 #1 Hi. A quick mathematica question. If I compute a derivative using D[f[x],x], how can I assign this result to another function, e.g. I want g[x]=f'[x] using the D-notation. Thanks.
Hi. A quick mathematica question. If I compute a derivative using D[f[x],x], how can I assign this result to another function, e.g. I want g[x]=f'[x] using the D-notation. Thanks.
JeffNYC Messages 26 Reaction score 0 Oct 20, 2008 #2 This what you mean? In[1]:= j = x^2 Out[1]= x^2 In[2]:= e = D[j, x] Out[2]= 2 x In[3]:= f = D[e, x] Out[3]= 2 In[4]:= ff = D[f, x] Out[4]= 0
This what you mean? In[1]:= j = x^2 Out[1]= x^2 In[2]:= e = D[j, x] Out[2]= 2 x In[3]:= f = D[e, x] Out[3]= 2 In[4]:= ff = D[f, x] Out[4]= 0
adriank Messages 534 Reaction score 1 Oct 21, 2008 #3 g[x_] = D[f[x], x] Note the underscore in g[x_]. (Alternatively, you could just do g = f')