Directional DerivativesTo find the derivative of x^2 y + y^2 z + z^2 x at the point (1,0,1) in the direction of [0,3,-1], do the following:
In[148]:=
Clear[u,v,f]
f[x_,y_,z_]:=x^2 y + y^2 z + z^2 x;
v={0,3,-1}
u=v/norm[v]
Out[148]=
{0, 3, -1}
Out[149]=
3 1
{0, --------, -(--------)}
Sqrt[10] Sqrt[10]
In[150]:=
grad3[f][x,y,z].u
Out[150]=
2 2
y + 2 x z 3 (x + 2 y z)
-(----------) + --------------
Sqrt[10] Sqrt[10]
In[151]:=
grad3[f][x,y,z].u /.{x->1, y->0,z->1}
Out[151]=
2 3
-Sqrt[-] + --------
5 Sqrt[10]
To find the derivative of f(x,y,z) above at (1,-3,2) in the direction of the curve r(t)=t^2 i +3t j + (1-t^3) k, do the following:
The direction of a curve at a point is given by its derivative at that point! To be at the point (1,-3,2) we need t=-1 in r(t).
In[152]:=
r[t_]:={t^2,3 t,1-t^3}
In[153]:=
dir=D[r[t],t]/.t->-1
u=dir/norm[dir]
Out[153]=
{-2, 3, -3}
Out[154]=
2 3 -3
{-Sqrt[--], --------, --------}
11 Sqrt[22] Sqrt[22]
In[155]:=
grad3[f][x,y,z].u
Out[155]=
2 2
-3 (y + 2 x z) 3 (x + 2 y z) 2 2
--------------- + -------------- - Sqrt[--] (2 x y + z )
Sqrt[22] Sqrt[22] 11
In[156]:=
grad3[f][x,y,z].u /.{x->1, y->-3 ,z->2}
Out[156]=
2 11 39
2 Sqrt[--] - 3 Sqrt[--] - --------
11 2 Sqrt[22]
Up to The Gradient