Mathematica Evaluating a derivative at a point in Mathematica

AI Thread Summary
To evaluate the derivative of a function defined in Mathematica at a specific point, one can use the syntax D[f[x, y], {{x, y}}] to compute the derivative. After obtaining the derivative, it can be evaluated at a point by substituting the values directly into the derivative expression using the replacement rule. For example, using df /. {x -> 1, y -> 2} or D[f[x, y], {{x, y}}] /. {x -> 1, y -> 2} yields the same result. The output confirms the correct evaluation at the specified point. This method effectively demonstrates how to work with derivatives in Mathematica.
Rasalhague
Messages
1,383
Reaction score
2
If I define a function, such as

f[x_, y_] := {-2 x + 2 x^2, -3 x + y + 3 x^2}

I can compute the derivative with

D[f[x, y], {{x, y}}]

but what is the syntax for evaluating this derivative at a point?
 
Physics news on Phys.org
Maybe something like this?

Code:
In[1]:= f[x_, y_] := {-2 x + 2 x^2, -3 x + y + 3 x^2};
df = D[f[x, y], {{x, y}}]

Out[2]= {{-2 + 4 x, 0}, {-3 + 6 x, 1}}

In[3]:= df /. {x -> 1, y -> 2}

Out[3]= {{2, 0}, {3, 1}}

or this

Code:
In[4]:= D[f[x, y], {{x, y}}] /. {x -> 1, y -> 2}

Out[4]= {{2, 0}, {3, 1}}
 
Great, thanks, Bill!
 

Similar threads

Replies
1
Views
2K
Replies
1
Views
2K
Replies
5
Views
3K
Replies
13
Views
2K
Replies
3
Views
2K
Replies
4
Views
1K
Replies
3
Views
2K
Back
Top