DirectionalDerivativesAndAviation::usage=" Let the pressure P and temperature T at a point {x, y, z} be P[x, y, z] =
2
x
+2
2
y
1+
2
z
​, T[x, y, z] = 5 + x y -
2
z
.a If the position of an airplane at time t is {x[t]​, y[t]​, z[t]​} = {2t,
2
t
- 1, Cos[t]​}​ find

t
​(PT
2
)
at time t = 0 as observed from the airplane.b) In which direction should a bird at the point {0, -1, 1} fly if it wants to keep both P and T constant. (Give one possible direction vector. It does not need to be a unit vector.)​c An ant crawls on the surface
3
z
+ x z +
2
y
= 2 . When the ant is at the point {0, -1, 1}​, in which direction should it go for maximum increase of the temperature T = 5 + x y -
2
z
? Your answer should be a vector {a, b, c}​, not necessarily of unit length. (Note that the ant cannot crawl in the direction of the gradient because that leads off the surface. The direction vector {a, b, c} has to be on the tangent plane to the surface.)​References: Internet: personal.math.ubc.ca, 2.7.2 Directional Derivatives And The Gradient, Exercise Stage 2, Prob.-21; Personal.";
a) Find

t
2
(PT)
attimet=0asobservedfromtheairplane
:
In[]:=
P[t_]:=
4
2
t
+2
2
(
2
t
-1)
1+
2
Cos[t]
;​​T[t_]:=5+2t(
2
t
-1)-
2
Cos[t]
;
In[]:=
g[t_]=D[
2
(P[t]T[t])
];
In[]:=
g[0]
Out[]=
16
The sign - 16, it perhaps refers to the fact that is observed from the plane.
b) In which direction should a bird at the point {0, -1, 1} fly if it wants to keep both P and T constant (debe ser perpendicular a ambas):
In[]:=
P[x_,y_,z_]:=
2
x
+2
2
y
1+
2
z
;​​T[x_,y_,z_]:=5+xy-
2
z
;
In[]:=
g[x_,y_,z_]=Grad[P[x,y,z],{x,y,z}];​​h[x_,y_,z_]=Grad[T[x,y,z],{x,y,z}];
In[]:=
n=g[0,-1,1];​​n1=h[0,-1,1];
In[]:=
v=nn1
±{4,1,-2}
c) In which direction should it go for maximum increase of the temperature:
In[]:=
S[x_,y_,z_]:=
3
z
+xz+
2
y
-2;​​g1[x_,y_,z_]=Grad[S[x,y,z],{x,y,z}];​​n2=g1[0,-1,1];​​
Projection of the gradient of T over the gradient of S:
In[]:=
n2.n1
2
(Norm[n2])
n2
Out[]=
-
1
2
,1,-
3
2

Then the optimal direction is:
d=∇T{0,-1,1}--
1
2
,1,-
3
2
;
In[]:=
d=n1--
1
2
,1,-
3
2

-
1
2
,-1,-
1
2
=-
1
2
{1,2,1}=-{1,2,1}
Explanatory figure:
Tangent plane to the surface
In[]:=
n2.{x,y+1,z-1}
In[]:=
Simplify[x-2(1+y)+3(-1+z)]
-5+x-2y+3z=0;
In[]:=
ShowContourPlot3D[
3
z
+xz+
2
y
==2,{x,-2,2},{y,-2,2},{z,-2,2},ContourStyle->Directive[Green,Opacity[0.2],Specularity[White,30]],MeshNone],​​ContourPlot3D[-5+x-2y+3z==0,{x,-2,2},{y,-2,2},{z,-2,2},ContourStyle->Directive[Purple,Opacity[0.2],Specularity[White,30]],MeshNone],​​Graphics3D[{Black,Ball[{0,-1,1},0.05],Arrowheads[.03],Arrow[Tube[{{0,-1,1},{0,-1,1}+0.45{-1,0,-2}}]]}],Graphics3D[{Yellow,Point[{0,-1,1}],Arrowheads[.03],Arrow[Tube[{{0,-1,1},{0,-1,1}+0.5{1,-2,3}}]]}],Graphics3DOrange,Point[{0,-1,1}],Arrowheads[.03],ArrowTube{0,-1,1},{0,-1,1}+0.5-
1
2
,1,-
3
2
,Graphics3D[{Green,Point[{0,-1,1}],Arrowheads[.03],Arrow[Tube[{{0,-1,1},{0,-1,1}-0.25{1,2,1}}]]}],​​AxesLabel->(Style[#,15,Blue]&/@{"X","Y","Z"}),AxesOrigin{0,0,0},AxesTrue,BoxedFalse,BoxRatiosAutomatic,PlotRangeAll,ImageSizeFull
Out[]=