Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Evaluating a derivative at a point in Mathematica

Tags:
  1. May 11, 2014 #1
    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?
     
  2. jcsd
  3. May 11, 2014 #2
    Maybe something like this?

    Code (Text):
    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 (Text):
    In[4]:= D[f[x, y], {{x, y}}] /. {x -> 1, y -> 2}

    Out[4]= {{2, 0}, {3, 1}}
     
  4. May 13, 2014 #3
    Great, thanks, Bill!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Evaluating a derivative at a point in Mathematica
Loading...