# Computing the first derivative in x, y ,and z

I have the following function:

f:=x^3+yz+z^2x;


I need to compute the first derivative in x, y , and z in the 6 following points:

  %/.{x->1,y->3,z->0}
%/.{x->0,y->1,z->2}
%/.{x->0,y->0,z->6}
%/.{x->7,y->6,z->8}
%/.{x->7,y->7,z->9}
%/.{x->6,y->9,z->3}

• In your function definition you need a space in order to indicate multiplication. "yz" is a symbol. You should have typed "y z" or "y*z". – Jack LaVigne Oct 5 '15 at 14:30

I believe this is a duplicate. I just note that Grad can provide all the partial derivatives in one step. I just post this not to encourage all multiple rule lists but to limit typing:

rep = {{x -> 1, y -> 3, z -> 0},
{x -> 0, y -> 1, z -> 2},
{x -> 0, y -> 0, z -> 6},
{x -> 7, y -> 6, z -> 8},
{x -> 7, y -> 7, z -> 9},
{x -> 6, y -> 9, z -> 3}};
f := x^3 + y z + z^2 x;


So,

TableForm[(Grad[f, {x, y, z}] /. #) & /@ rep,
TableHeadings -> {#[[All, 2]] & /@
rep, {"\!$$\*SubscriptBox[\(f$$, $$x$$]\)",
"\!$$\*SubscriptBox[\(f$$, $$y$$]\)",
"\!$$\*SubscriptBox[\(f$$, $$z$$]\)"}}] another way:

f = x^3 + y z + z^2 x;
mat = {{1, 3, 0}, {0, 1, 2}, {0, 0, 6}, {7, 6, 8}, {7, 7, 9}, {6, 9,3}};
{{3, 0, 3}, {4, 2, 1}, {36, 6, 0}, {211, 8, 118}, {228, 9, 133}, {117,3, 45}}


You could try using

f[x_, y_, z_] := x^3 + y*z + z^2*x

Derivative[1, 0, 0][f][x, y, z]

%/.{x->1,y->3,z->0}

Derivative[0, 1, 0][f][x, y, z]

Derivative[0, 0, 1][f][x, y, z]

• This is the way to go. In fact, the replacement is not even necessary. Just do: Derivative[1, 0, 0][f][1,3,0], etc... – QuantumDot Oct 5 '15 at 11:41