How can I assign a derivative in Mathematica using D-notation?

daudaudaudau
Messages
297
Reaction score
0
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.
 
Physics news on Phys.org
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
 
g[x_] = D[f[x], x]

Note the underscore in g[x_].

(Alternatively, you could just do g = f')
 

Similar threads

Replies
8
Views
2K
Replies
3
Views
1K
Replies
4
Views
1K
Replies
1
Views
2K
Replies
4
Views
3K
Replies
12
Views
2K
Replies
14
Views
2K
Back
Top