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

  • Context: Undergrad 
  • Thread starter Thread starter daudaudaudau
  • Start date Start date
  • Tags Tags
    Derivative Mathematica
Click For Summary
SUMMARY

The discussion focuses on assigning a derivative in Mathematica using the D-notation. Users can compute derivatives with the D function, as demonstrated with the example where the derivative of j = x^2 is assigned to g[x] using g[x_] = D[f[x], x]. The underscore in g[x_] is crucial for defining the function properly. An alternative method is also mentioned, where g is directly assigned as g = f'.

PREREQUISITES
  • Familiarity with Mathematica syntax and functions
  • Understanding of derivatives and their notation
  • Knowledge of function definitions in Mathematica
  • Basic algebraic manipulation skills
NEXT STEPS
  • Explore advanced function definitions in Mathematica
  • Learn about symbolic differentiation in Mathematica
  • Investigate the use of the D function for higher-order derivatives
  • Study the implications of using underscores in function definitions
USEFUL FOR

Mathematica users, mathematicians, educators, and students looking to deepen their understanding of symbolic differentiation and function assignments in Mathematica.

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 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
7K
  • · Replies 3 ·
Replies
3
Views
12K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K