Skip to main content

CLP-3 Multivariable Calculus

Section 2.7 Directional Derivatives and the Gradient

Subsection 2.7.1 Directional Derivatives and the Gradient

The principal interpretation of \(\diff{f}{x}(a)\) is the rate of change of \(f(x)\text{,}\) per unit change of \(x\text{,}\) at \(x=a\text{.}\) The natural analog of this interpretation for multivariable functions is the directional derivative, which we now introduce through a question.

Subsubsection 2.7.1.1 A Question

Suppose that you are standing at \((a,b)\) near a campfire. The temperature you feel at \((x,y)\) is \(f(x,y)\text{.}\) You start to move with velocity \(\vv=\llt v_1,v_2\rgt \text{.}\) What rate of change of temperature do you feel?

Subsubsection 2.7.1.2 The Answer

Let’s set the beginning of time, \(t=0\text{,}\) to the time at which you leave \((a,b)\text{.}\) Then
  • at time \(0\) you are at \((a, b)\) and feel the temperature \(f(a, b)\) and
  • at time \(t\) you are at \((a+v_1t\,,\, b+v_2t)\) and feel the temperature \(f(a+v_1t\,,\, b+v_2t)\text{.}\) So
  • the change in temperature between time \(0\) and time \(t\) is \(f(a+v_1t\,,\, b+v_2t)-f(a,b)\text{,}\)
  • the average rate of change of temperature, per unit time, between time \(0\) and time \(t\) is \(\frac{f(a+v_1t\,,\, b+v_2t)-f(a,b)}{t}\) and the
  • instantaneous rate of change of temperature per unit time as you leave \((a,b)\) is \(\lim\limits_{t\rightarrow 0}\frac{f(a+v_1t\,,\, b+v_2t)-f(a,b)}{t} \text{.}\)
Concentrate on the \(t\) dependence in this limit by writing \(f(a+v_1t\,,\, b+v_2t)=g(t)\text{.}\) Then
\begin{align*} \lim_{t\rightarrow 0}\frac{f(a+v_1t\,,\, b+v_2t)-f(a,b)}{t} &=\lim_{t\rightarrow 0}\frac{g(t)-g(0)}{t}\\ &=\diff{g}{t}(0)\\ &=\diff{}{t}\big[f(a+v_1t\,,\, b+v_2t)\big]\Big|_{t=0} \end{align*}
By the chain rule, we can write the right hand side in terms of partial derivatives of \(f\text{.}\)
\begin{equation*} \diff{}{t}\big[f(a+v_1t\,,\, b+v_2t)\big] =f_x(a+v_1t\,,\, b+v_2t)\,v_1 + f_y(a+v_1t\,,\, b+v_2t)\,v_2 \end{equation*}
So, the instantaneous rate of change per unit time as you leave \((a,b)\) is
\begin{align*} &\lim_{t\rightarrow 0}\frac{f(a+v_1t\,,\, b+v_2t)-f(a,b)}{t}\\ &\hskip0.5in=\big[f_x(a+v_1t\,,\, b+v_2t)\,v_1 + f_y(a+v_1t\,,\, b+v_2t)\,v_2 \big]\Big|_{t=0}\\ &\hskip0.5in=f_x(a,b)\,v_1+f_y(a,b)\,v_2\\ &\hskip0.5in=\llt f_x(a,b)\,,\,f_y(a,b)\rgt \cdot\llt v_1,v_2\rgt \end{align*}
Notice that we have expressed the rate of change as the dot product of the velocity vector with a vector of partial derivatives of \(f\text{.}\) We have seen such a vector of partial derivatives of \(f\) before; in Definition 2.5.4, we defined the gradient of the three variable function \(G(x,y,z)\) at the point \(\big( x_0\,,\,y_0\,,\,z_0\big)\) to be \(\llt G_x\big( x_0\,,\,y_0\,,\,z_0\big)\,,\, G_y\big( x_0\,,\,y_0\,,\,z_0\big)\,,\, G_z\big( x_0\,,\,y_0\,,\,z_0\big)\rgt \text{.}\) Here we see the natural two dimensional analog.
Definition 2.7.1.
The vector \(\llt f_x(a,b)\,,\,f_y(a,b)\rgt \) is denoted \(\vnabla f(a,b)\) and is called “the gradient of the function \(f\) at the point \((a,b)\)”.
In general, the gradient of \(f\) is a vector with one component for each variable of \(f\text{.}\) The \(j^{\rm th}\) component is the partial derivative of \(f\) with respect to the \(j^{\rm th}\) variable.
Now because the dot product \(\vnabla f(a,b)\cdot\vv\) appears frequently, we introduce some handy notation.
Definition 2.7.2.
Given any vector \(\vv=\llt v_1,v_2\rgt\text{,}\) the expression
\begin{equation*} \llt f_x(a,b),f_y(a,b)\rgt \cdot\llt v_1,v_2\rgt =\vnabla f(a,b)\cdot\vv \end{equation*}
is denoted \(D_{\vv}f(a,b)\text{.}\)
Armed with this useful notation we can answer our question very succinctly.
We can compute the rate of change of temperature per unit distance (as opposed to per unit time) in a similar way. The change in temperature between time \(0\) and time \(t\) is \(f(a+v_1t, b+v_2t)-f(a,b)\text{.}\) Between time \(0\) and time \(t\text{,}\) you have travelled a distance \(|\vv|t\text{.}\) So the instantaneous rate of change of temperature per unit distance as you leave \((a,b)\) is
\begin{gather*} \lim_{t\rightarrow 0}\frac{f(a+v_1t, b+v_2t)-f(a,b)}{t|\vv|} \end{gather*}
This is exactly \(\frac{1}{|\vv|}\) times \(\lim\limits_{t\rightarrow 0}\frac{f(a+v_1t, b+v_2t)-f(a,b)}{t}\) which we computed above to be \(D_{\vv}f(a,b)\text{.}\) So
Definition 2.7.5.
\(D_{\frac{\vv}{|\vv|}}\ f(a,b)\) is called the directional derivative of the function \(f(x,y)\) at the point \((a,b)\) in the direction
 1 
Some people require direction vectors to have unit length. We don’t.
\(\vv\text{.}\)

Subsubsection 2.7.1.3 The Implications

We have just seen that the instantaneous rate of change of \(f\) per unit distance as we leave \((a,b)\) moving in direction \(\vv\) is a dot product, which we can write as
\begin{equation*} \vnabla f(a,b)\cdot\frac{\vv}{|\vv|} =|\vnabla f(a,b)| \cos \theta \end{equation*}
where \(\theta\) is the angle between the gradient vector \(\vnabla f(a,b)\) and the direction vector \(\vv\text{.}\) Writing it in this way allows us to make some useful observations. Since \(\cos \theta\) is always between \(-1\) and \(+1\)
  • the direction of maximum rate of increase is that having \(\theta=0\text{.}\) So to get maximum rate of increase per unit distance, as you leave \((a,b)\text{,}\) you should move in the same direction as the gradient \(\vnabla f(a,b)\text{.}\) Then the rate of increase per unit distance is \(|\vnabla f(a,b)|\text{.}\)
  • The direction of minimum (i.e. most negative) rate of increase is that having \(\theta=180^\circ\text{.}\) To get minimum rate of increase per unit distance you should move in the direction opposite \(\vnabla f(a,b)\text{.}\) Then the rate of increase per unit distance is \(-|\vnabla f(a,b)|\text{.}\)
  • The directions giving zero rate of increase are those perpendicular to \(\vnabla f(a,b)\text{.}\) If you move in a direction perpendicular to \(\vnabla f(a,b)\text{,}\) then \(f(x,y)\) remains constant as you leave \((a,b)\text{.}\) At that instant, you are moving so that \(f(x,y)\) remains constant and consequently you are moving along the level curve \(f(x,y)=f(a,b)\text{.}\) So \(\vnabla f(a,b)\) is perpendicular to the level curve \(f(x,y)=f(a,b)\) at \((a,b)\text{.}\) The corresponding statement in three dimensions is that \(\vnabla F(a,b,c)\) is perpendicular to the level surface \(F(x,y,z)=F(a,b,c)\) at \((a,b,c)\text{.}\) Hence a good way to find a vector normal to the surface \(F(x,y,z)=F(a,b,c)\) at the point \((a,b,c\)) is to compute the gradient \(\vnabla F(a,b,c)\text{.}\) This is precisely what we saw back in Theorem 2.5.5.
Now that we have defined the directional derivative, here are some examples.
Example 2.7.6.
Find the directional derivative of the function \(f(x,y)=e^{x+y^2}\) at the point \((0,1)\) in the direction \(-\hi + \hj\text{.}\)
Solution.
To compute the directional derivative, we need the gradient. To compute the gradient, we need some partial derivatives. So we start with the partial derivatives of \(f\) at \((0,1)\text{:}\)
\begin{alignat*}{2} f_x(0,1) &= e^{x+y^2}\Big|_{x=0\atop y=1} &&=e\\ f_y(0,1) &= 2ye^{x+y^2}\Big|_{x=0\atop y=1} &&=2e \end{alignat*}
So the gradient of \(f\) at \((0,1)\) is
\begin{equation*} \vnabla f(0,1) = f_x(0,1)\,\hi + f_y(0,1)\,\hj = e\,\hi + 2e\,\hj \end{equation*}
and the direction derivative in the direction \(-\hi + \hj\) is
\begin{equation*} D_{\frac{-\hi+\hj}{|-\hi+\hj|}} f(0,1) = \vnabla f(0,1)\cdot\frac{-\hi+\hj}{|-\hi+\hj|} = \big(e\,\hi + 2e\,\hj\big)\cdot \frac{-\hi+\hj}{\sqrt{2}} = \frac{e}{\sqrt{2}} \end{equation*}
Example 2.7.7.
Find the directional derivative of the function \(w(x,y,z)=xyz +\ln(xz)\) at the point \((1,3,1)\) in the direction \(\llt 1\,,\,0\,,\,1\rgt\text{.}\) In what directions is the directional derivative zero?
Solution.
First, the partial derivatives of \(w\) at \((1,3,1)\) are
\begin{alignat*}{3} w_x(1,3,1) &= \left[yz+\frac{1}{x}\right]\bigg|_{(1,3,1)} &&=3\times 1+\frac{1}{1}&&=4\\ w_y(1,3,1) &= xz\bigg|_{(1,3,1)} &&=1\times 1&&=1\\ w_z(1,3,1) &= \left[xy+\frac{1}{z}\right]\bigg|_{(1,3,1)} &&=1\times 3 +\frac{1}{1} &&=4 \end{alignat*}
so the gradient of \(w\) at \((1,3,1)\) is
\begin{equation*} \vnabla w(1,3,1) = \llt w_x(1,3,1)\,,\,w_y(1,3,1)\,,\,w_z(1,3,1)\rgt = \llt 4\,,\,1\,,\,4\rgt \end{equation*}
and the direction derivative in the direction \(\llt 1\,,\,0\,,\,1\rgt\) is
\begin{align*} D_{\frac{\llt 1\,,\,0\,,\,1\rgt}{|\llt 1\,,\,0\,,\,1\rgt|}} w(1,3,1) &= \vnabla w(1,3,1)\cdot \frac{\llt 1\,,\,0\,,\,1\rgt}{|\llt 1\,,\,0\,,\,1\rgt|} = \llt 4\,,\,1\,,\,4\rgt\cdot \frac{\llt 1\,,\,0\,,\,1\rgt}{\sqrt{2}}\\ &= \frac{8}{\sqrt{2}}=4\sqrt{2} \end{align*}
The directional derivative of \(w\) at \((1,3,1)\) in the direction \(\vt\ne\vZero\) is zero if and only if
\begin{equation*} 0 = D_{\frac{\vt}{|\vt|}} w(1,3,1) = \vnabla w(1,3,1)\cdot\frac{\vt}{|\vt|} = \llt 4\,,\,1\,,\,4\rgt\cdot \frac{\vt}{|\vt|} \end{equation*}
which is the case if and only if \(\vt\) is perpendicular to \(\llt 4\,,\,1\,,\,4\rgt\text{.}\) So if we walk in the direction of any vector in the plane, \(4x+y+4z=0\) (which has normal vector \(\llt 4\,,\,1\,,\,4\rgt\)) then the directional derivative is zero.
Example 2.7.8.
Let
\begin{equation*} f(x,y)=5-x^2-2y^2\qquad (a,b)=\big(-1,-1\big) \end{equation*}
In this example, we’ll explore the behaviour of the function \(f(x,y)\) near the point \((a,b)\text{.}\)
Note that for any fixed \(f_0 \lt 5\text{,}\) \(f(x,y)=f_0\) is the ellipse \(x^2+2y^2=5-f_0\text{.}\) So the graph \(z=f(x,y)\) consists of a bunch of horizontal ellipses stacked one on top of each other.
  • Since the ellipse \(x^2+2y^2=5-f_0\) has \(x\)-semi-axis \(\sqrt{5-f_0}\) and \(y\)-semi-axis \(\sqrt{\frac{5-f_0}{2}}\text{,}\)
    • the ellipses start with a point on the \(z\) axis when \(f_0=5\) and
    • increase in size as \(f_0\) decreases.
  • The part of the graph \(z=f(x,y)\) in the first octant is sketched in the left hand figure below.
  • Several level curves, \(f(x,y)=f_0\text{,}\) are sketched in the right hand figure below.
  • The gradient vector
    \begin{equation*} \vnabla f(a,b)=\llt -2x,-4y\rgt \big|_{(-1,-1)}=\llt 2,4\rgt =2\llt 1,2\rgt \end{equation*}
    at \((-1,-1)\) is also illustrated in the righ hand sketch.
We have that, at \((a,b)=(-1,-1)\text{,}\)
  • the unit vector giving the direction of maximum rate of increase is the unit vector in the direction of the gradient vector \(2\llt 1,2\rgt\text{,}\) which is \(\frac{1}{\sqrt{5}}\llt 1,2\rgt\text{.}\) The maximum rate of increase is \(|\llt 2,4\rgt |=2\sqrt{5}\text{.}\)
  • The unit vector giving the direction of minimum rate of increase is \(-\frac{1}{\sqrt{5}}\llt 1,2\rgt \) and that minimum rate is \(-|\llt 2,4\rgt |=-2\sqrt{5}\text{.}\)
  • The directions giving zero rate of increase are perpendicular to \(\vnabla f(a,b)\text{.}\) One vector perpendicular
     2 
    Check this by taking the dot product of \(\llt 1,2\rgt\) and \(\llt 2,-1\rgt\text{.}\)
    to \(\llt 1,2\rgt\) is \(\llt 2,-1\rgt\text{.}\) So the unit vectors giving the direction of zero rate of increase are the \(\pm\frac{1}{\sqrt{5}}(2,-1)\text{.}\) These are the directions of the tangent vector at \((a,b)\) to the level curve of \(f\) through \((a,b)\text{,}\) which is the curve \(f(x,y)=f(a,b)\text{.}\)
Example 2.7.9.
What is the rate of change of \(f(x,y,z)=x^2+y^2+z^2\) at \((3,5,4)\) moving in the positive \(x\)-direction along the curve of intersection of the surfaces \(G(x,y,z)=25\) and \(H(x,y,z)=0\) where
\begin{equation*} G(x,y,z)=2x^2-y^2+2z^2 \qquad\text{and}\qquad H(x,y,z)=x^2-y^2+z^2 \end{equation*}
Solution.
As a first check note that \((3,5,4)\) really does lie on both surfaces because
\begin{alignat*}{2} G(3,5,4)&= 2\big(3^2\big)-5^2+2\big(4^2\big) &&= 18-25+32=25\\ H(3,5,4)&=\phantom{2*\ }3^2-5^2+\phantom{2*}4^2&&=\phantom{1}9-25+16 =0 \end{alignat*}
We compute gradients to get the normal vectors to the surfaces \(G(x,y,z)=25\) and \(H(x,y,z)=0\) at \((3,5,4)\text{.}\)
\begin{align*} \vnabla G(3,5,4) &=\Big[4x\,\hi-2y\,\hj+4z\,\hk\Big]_{(3,5,4)}\\ &= 12\,\hi-10\,\hj+16\,\hk = 2\big(6\,\hi-5\,\hj+8\,\hk\big)\\ \vnabla H(3,5,4) &=\Big[2x\,\hi-2y\,\hj+2z\,\hk\Big]_{(3,5,4)}\\ &= 6\,\hi-10\,\hj+8\,\hk = 2\big(3\,\hi-5\,\hj+4\,\hk\big) \end{align*}
The direction of interest is tangent to the curve of intersection. So the direction of interest is tangent to both surfaces and hence is perpendicular to both gradients. Consequently one tangent vector to the curve at \((3,5,4)\) is
\begin{align*} \vnabla G(3,5,4)\,\times \vnabla H(3,5,4) &=4\big(6\,\hi-5\,\hj+8\,\hk\big)\times\big(3\,\hi-5\,\hj+4\,\hk\big)\\ &=4\ \det\left[\begin{matrix} \hi & \hj & \hk \\ 6 & -5 & 8 \\ 3 & -5 & 4 \\ \end{matrix}\right]\\ &= 4\ \big(20\,\hi -15\,\hk\big) = 20\ \big(4\,\hi -3\,\hk\big) \end{align*}
and the unit tangent vector to the curve at \((3,5,4)\) that has positive \(x\) component is
\begin{equation*} \frac{4\,\hi -3\,\hk}{|4\,\hi -3\,\hk|} =\frac{4}{5}\,\hi -\frac{3}{5}\,\hk \end{equation*}
The desired rate of change is
\begin{align*} D_{\frac{4}{5}\,\hi -\frac{3}{5}\,\hk} f(3,5,4) &= \vnabla f(3,5,4)\cdot\left(\frac{4}{5}\,\hi -\frac{3}{5}\,\hk\right)\\ &= \overbrace{\big( 6\,\hi +10\, \hj + 8\,\hk\big)}^ {[2x\,\hi+2y\,\hj+2z\,\hk]_{(x,y,z)=(3,5,4)}}\hskip-0.15in\cdot\, \left(\frac{4}{5}\,\hi -\frac{3}{5}\,\hk\right)\\ &=0 \end{align*}
Actually, we could have known that the rate of change would be zero.
  • indent=-0.1in
  • Any point \((x,y,z)\) on the curve obeys both \(y^2=x^2+z^2\) and \(2x^2-y^2+2z^2=25\text{.}\)
  • Substituting \(y^2=x^2+z^2\) into \(2x^2-y^2+2z^2=25\) gives \(x^2+z^2=25\text{.}\)
  • So, at any point on the curve, \(x^2+z^2=25\) and \(y^2=x^2+z^2=25\) so that \(x^2+y^2+z^2=50\text{.}\)
  • That is, \(f(x,y,z)=x^2+y^2+z^2\) takes the value 50 at every point of the curve.
  • So of course the rate of change of \(f\) along the curve is \(0\text{.}\)
Let’s change things up a little. In the next example, we are told the rates of change in two different directions. From this we are to determine the rate of change in a third direction.
Example 2.7.10.
The rate of change of a given function \(f(x,y)\) at the point \(P_0=(1,2)\) in the direction towards \(P_1=(2,3)\) is \(2\sqrt{2}\) and in the direction towards \(P_2=(1,0)\) is \(-3\text{.}\) What is the rate of change of \(f\) at \(P_0\) towards the origin \(P_3=(0,0)\text{?}\)
Solution.
We can easily determine the rate of change of \(f\) at the point \(P_0\) in any direction once we know the gradient \(\vnabla f(1,2) =a\,\hi+b\,\hj\text{.}\) So we will first use the two given rates of change to determine \(a\) and \(b\text{,}\) and then we determine the rate of change towards \((0,0)\text{.}\)
The two rates of change that we are given are those in the directions of the vectors
\begin{gather*} \overrightarrow{P_0P_1} = \llt 1,1\rgt \qquad \overrightarrow{P_0P_2} = \llt 0,-2\rgt \end{gather*}
As you might guess, the notation \(\overrightarrow{PQ}\) means the vector whose tail is at \(P\) and whose head is at \(Q\text{.}\) So the given rates of change tell us that
\begin{alignat*}{3} 2\sqrt{2}&=D_{\frac{\llt 1,1\rgt}{|\llt 1,1\rgt|}} f(1,2) &&= \vnabla f(1,2)\cdot\frac{\llt 1,1\rgt}{|\llt 1,1\rgt|} &&= \llt a,b\rgt\cdot\frac{\llt 1,1\rgt}{\sqrt{2}}\\ &=\frac{a}{\sqrt{2}} +\frac{b}{\sqrt{2}}\\ -3&=D_{\frac{\llt 0,-2\rgt}{|\llt 0,-2\rgt|}} f(1,2) &&= \vnabla f(1,2)\cdot\frac{\llt 0,-2\rgt}{|\llt 0,-2\rgt|} &&= \llt a,b\rgt\cdot\frac{\llt 0,-2\rgt}{2}\\ &=-b \end{alignat*}
These two lines give us two linear equations in the two unknowns \(a\) and \(b\text{.}\) The second equation directly gives us \(b=3\text{.}\) Substituting \(b=3\) into the first equation gives
\begin{gather*} \frac{a}{\sqrt{2}} +\frac{3}{\sqrt{2}} = 2\sqrt{2} \implies a+3=4 \implies a=1 \end{gather*}
A direction vector from \(P_0=(1,2)\) towards \(P_3=(0,0)\) is
\begin{equation*} \overrightarrow{P_0P_3} = \llt -1,-2\rgt \end{equation*}
and the rate of change (per unit distance) in that direction is
\begin{align*} D_{\frac{\llt -1,-2\rgt}{|\llt -1,-2\rgt|}} f(1,2) &= \vnabla f(1,2)\cdot\frac{\llt -1,-2\rgt}{|\llt -1,-2\rgt|} = \llt a,b\rgt\cdot\frac{\llt -1,-2\rgt}{\sqrt{5}}\\ &= \llt 1,3\rgt\cdot\frac{\llt -1,-2\rgt}{\sqrt{5}} =-\frac{7}{\sqrt{5}} \end{align*}
Example 2.7.11. Optional.
Find all points \((a,b,c)\) for which the spheres \((x-a)^2+(y-b)^2+(z-c)^2 =1\) and \(x^2+y^2+z^2=1\) intersect orthogonally. That is, the tangent planes to the two spheres are to be perpendicular at each point of intersection.
Solution.
Let \((x_0,y_0,z_0)\) be a point of intersection. That is
\begin{align*} (x_0-a)^2+(y_0-b)^2+(z_0-c)^2 & = 1\\ x_0^2+y_0^2+z_0^2&=1 \end{align*}
A normal vector to \(G(x,y,z)=(x-a)^2+(y-b)^2+(z-c)^2 =1\) at \((x_0,y_0,z_0)\) is
\begin{equation*} \vN = \vnabla G(x_0,y_0,z_0) = \llt 2(x_0-a)\,,\,2(y_0-b)\,,\,2(z_0-c)\rgt \end{equation*}
A normal vector to \(g(x,y,z)=x^2+y^2+z^2 =1\) at \((x_0,y_0,z_0)\) is
\begin{equation*} \vn = \vnabla g(x_0,y_0,z_0) = \llt 2x_0\,,\,2y_0\,,\,2z_0\rgt \end{equation*}
The two tangent planes are perpendicular if and only if \(\hN\) and \(\hn\) are perpendicular, which is the case if and only if
\begin{equation*} 0=\hN\cdot\hn = 4x_0(x_0-a) + 4y_0(y_0-b) +4z_0(z_0-c) \end{equation*}
or, dividing the equation by \(4\text{,}\)
\begin{equation*} x_0(x_0-a) + y_0(y_0-b) +z_0(z_0-c)=0 \end{equation*}
Let’s pause to take stock. We need to find all \((a,b,c)\)’s such that the statement
\begin{equation*} (x_0,y_0,z_0)\text{ is a point of intersection of the two spheres} \tag{S1} \end{equation*}
implies the statement
\begin{equation*} \text{the normal vectors $\hN$ and $\hn$ are perpendicular} \tag{S2} \end{equation*}
In equations, we need to find all \((a,b,c)\)’s such that the statement
\begin{align*} (x_0,y_0,z_0)\quad\text{obeys}\quad &x_0^2+y_0^2+z_0^2 = 1\\ &\text{ and }(x_0-a)^2+(y_0-b)^2+(z_0-c)^2 = 1 \tag{S1} \end{align*}
implies the statement
\begin{equation*} (x_0,y_0,z_0)\quad\text{obeys}\quad x_0(x_0-a) + y_0(y_0-b) +z_0(z_0-c)=0 \tag{S2} \end{equation*}
Now if we expand (S2) then we can, with a little care, massage it into something that looks more like (S1).
\begin{align*} &x_0(x_0-a) + y_0(y_0-b) +z_0(z_0-c) =x_0^2+y_0^2+z_0^2 -ax_0 -by_0 - cz_0\\ &=\frac{1}{2}\left\{\big[x_0^2+y_0^2+z_0^2\big] +\big[(x_0-a)^2+(y_0-b)^2+(z_0-c)^2\big] -a^2-b^2-c^2\right\} \end{align*}
If (S1) is true, then \(\big[x_0^2+y_0^2+z_0^2\big]=1\) and \(\big[(x_0-a)^2+(y_0-b)^2+(z_0-c)^2\big]=1\) so that
\begin{equation*} x_0(x_0-a) + y_0(y_0-b) +z_0(z_0-c) =\frac{1}{2}\left\{1 \ +\ 1\ -a^2-b^2-c^2 \right\} \end{equation*}
and statement (S2) is true if and only if
\begin{equation*} a^2+b^2+c^2=2 \end{equation*}
Our conclusion is that the set of allowed points \((a,b,c)\) is the sphere of radius \(\sqrt{2}\) centred on the origin.
Example 2.7.12. Optional — The gradient in polar coordinates.
What is the gradient of a function in polar coordinates?
Solution.
As was the case in Examples 2.4.9 and 2.4.10, figuring out what the question is asking is half the battle. By Definition 2.5.4, the gradient of a function \(g(x,y)\) is the vector \(\llt g_x(x,y),g_y(x,y)\rgt\text{.}\) In this question we are told that we are given some function \(f(r,\theta)\) of the polar coordinates
 3 
Polar coordinates were defined in Example 2.1.8.
\(r\) and \(\theta\text{.}\) We are supposed to convert this function to Cartesian coordinates.
This means that we are to consider the function
\begin{equation*} g(x,y)=f\big(r(x,y),\theta(x,y)\big) \end{equation*}
with
\begin{align*} r(x,y)&=\sqrt{x^2+y^2}\cr \theta(x,y)&= \arctan\,\frac{y}{x} \end{align*}
Then we are to compute the gradient of \(g(x,y)\) and express the answer in terms of \(r\) and \(\theta\text{.}\) By the chain rule,
\begin{align*} \pdiff{g}{x} &=\pdiff{f}{r}\ \pdiff{r}{x} +\pdiff{f}{\theta}\ \pdiff{\theta}{x}\\ &=\pdiff{f}{r}\ \frac{1}{2}\frac{2x}{\sqrt{x^2+y^2}} +\pdiff{f}{\theta}\ \frac{-y/x^2}{1+(y/x)^2}\\ &=\pdiff{f}{r}\ \frac{x}{\sqrt{x^2+y^2}} -\pdiff{f}{\theta}\ \frac{y}{x^2+y^2}\\ &=\pdiff{f}{r}\ \frac{r\cos\theta}{r} -\pdiff{f}{\theta}\ \frac{r\sin\theta}{r^2}\\ \end{align*}

since \(x=r\cos\theta\) and \(y=r\sin\theta\)

\begin{align*} &=\pdiff{f}{r}\ \cos\theta -\pdiff{f}{\theta}\ \frac{\sin\theta}{r} \end{align*}
Similarly
\begin{align*} \pdiff{g}{y} &=\pdiff{f}{r}\ \pdiff{r}{y} +\pdiff{f}{\theta}\ \pdiff{\theta}{y}\\ &=\pdiff{f}{r}\ \frac{1}{2}\frac{2y}{\sqrt{x^2+y^2}} +\pdiff{f}{\theta}\ \frac{1/x}{1+(y/x)^2}\\ &=\pdiff{f}{r}\ \frac{y}{\sqrt{x^2+y^2}} +\pdiff{f}{\theta}\ \frac{x}{x^2+y^2}\\ &=\pdiff{f}{r}\ \sin\theta +\pdiff{f}{\theta}\ \frac{\cos\theta}{r} \end{align*}
So
\begin{equation*} \llt g_x,g_y\rgt= f_r\ \llt\cos\theta,\sin\theta\rgt +\frac{f_\theta}{r}\llt-\sin\theta,\cos\theta\rgt \end{equation*}
or, with all the arguments written explicitly,
\begin{align*} \llt g_x(x,y),g_y(x,y)\rgt &= f_r\big(r(x,y),\theta(x,y)\big)\ \llt\cos\theta(x,y)\,,\,\sin\theta(x,y)\rgt\\ &\ \ +\frac{1}{r(x,y)}f_\theta\big(r(x,y),\theta(x,y)\big)\ \llt-\sin\theta(x,y)\,,\,\cos\theta(x,y)\rgt \end{align*}

Exercises 2.7.2 Exercises

Exercise Group.

Exercises — Stage 1
1. (✳).
Find the directional derivative of \(f(x,y,z) = e^{xyz}\) in the \(\llt 0,1,1\rgt\) direction at the point \((0,1,1)\text{.}\)
2. (✳).
Find \(\vnabla\big(y^2 + \sin(xy)\big)\text{.}\)

Exercise Group.

Exercises — Stage 2
3.
Find the rate of change of the given function at the given point in the given direction.
  1. \(f(x,y)=3x-4y\) at the point \((0,2)\) in the direction \(-2\hi\text{.}\)
  2. \(f(x,y,z)=x^{-1}+y^{-1}+z^{-1}\) at \((2,-3,4)\) in the direction \(\hi+\hj+\hk\text{.}\)
4.
In what directions at the point \((2,0)\) does the function \(f(x,y)=xy\) have the specified rates of change?
  1. \(\displaystyle -1\)
  2. \(\displaystyle -2\)
  3. \(\displaystyle -3\)
5.
Find \(\vnabla f(a,b)\) given the directional derivatives
\begin{equation*} D_{(\hi+\hj)/\sqrt{2}}f(a,b)=3\sqrt{2}\qquad D_{(3\hi-4\hj)/5}f(a,b)=5 \end{equation*}
6. (✳).
You are standing at a location where the surface of the earth is smooth. The slope in the southern direction is \(4\) and the slope in the south-eastern direction is \(\sqrt{2}\text{.}\) Find the slope in the eastern direction.
7. (✳).
Assume that the directional derivative of \(w = f(x,y,z)\) at a point \(P\) is a maximum in the direction of the vector \(2\hi - \hj + \hk\text{,}\) and the value of the directional derivative in that direction is \(3\sqrt{6}\text{.}\)
  1. Find the gradient vector of \(w = f(x,y,z)\) at \(P\text{.}\)
  2. Find the directional derivative of \(w = f(x,y,z)\) at \(P\) in the direction of the vector \(\hi + \hj\)
8. (✳).
A hiker is walking on a mountain with height above the \(z = 0\) plane given by
\begin{equation*} z = f(x,y) = 6 - xy^2 \end{equation*}
The positive \(x\)-axis points east and the positive \(y\)-axis points north, and the hiker starts from the point \(P(2, 1, 4)\text{.}\)
  1. In what direction should the hiker proceed from \(P\) to ascend along the steepest path? What is the slope of the path?
  2. Walking north from \(P\text{,}\) will the hiker start to ascend or descend? What is the slope?
  3. In what direction should the hiker walk from \(P\) to remain at the same height?
9.
Two hikers are climbing a (small) mountain whose height is \(\ z=1000-2x^2-3y^2.\) They start at \(\ (1,1,995)\ \) and follow the path of steepest ascent. Their \((x,y)\) coordinates obey \(\ y=ax^b\ \) for some constants \(a, b\text{.}\) Determine \(a\) and \(b\text{.}\)
10. (✳).
A mosquito is at the location \((3, 2, 1)\) in \(\bbbr^3\text{.}\) She knows that the temperature \(T\) near there is given by \(T = 2x^2 + y^2 - z^2\text{.}\)
  1. She wishes to stay at the same temperature, but must fly in some initial direction. Find a direction in which the initial rate of change of the temperature is \(0\text{.}\)
  2. If you and another student both get correct answers in part (a), must the directions you give be the same? Why or why not?
  3. What initial direction or directions would suit the mosquito if she wanted to cool down as fast as possible?
11. (✳).
The air temperature \(T(x,y,z)\) at a location \((x,y,z)\) is given by:
\begin{equation*} T(x,y,z) = 1 + x^2 + yz. \end{equation*}
  1. A bird passes through \((2,1,3)\) travelling towards \((4,3,4)\) with speed \(2\text{.}\) At what rate does the air temperature it experiences change at this instant?
  2. If instead the bird maintains constant altitude (\(z = 3\)) as it passes through \((2,1,3)\) while also keeping at a fixed air temperature, \(T = 8\text{,}\) what are its two possible directions of travel?
12. (✳).
Let \(f(x,y) = 2x^2 + 3xy + y^2\) be a function of \(x\) and \(y\text{.}\)
  1. Find the maximum rate of change of \(f(x,y)\) at the point \(P\left(1, -\frac{4}{3}\right)\text{.}\)
  2. Find the directions in which the directional derivative of \(f(x,y)\) at the point \(P\left(1, -\frac{4}{3}\right)\) has the value \(\frac{1}{5}\text{.}\)
13. (✳).
The temperature \(T(x, y)\) at a point of the \(xy\)-plane is given by
\begin{equation*} T(x, y) = ye^{x^2} \end{equation*}
A bug travels from left to right along the curve \(y = x^2\) at a speed of \(0.01\)m/sec. The bug monitors \(T(x, y)\) continuously. What is the rate of change of \(T\) as the bug passes through the point \((1, 1)\text{?}\)
14. (✳).
Suppose the function \(T=F(x,y,z)=3+xy-y^2+z^2-x\) describes the temperature at a point \((x,y,z)\) in space, with \(F(3,2,1)=3\text{.}\)
  1. Find the directional derivative of \(T\) at \((3, 2, 1)\text{,}\) in the direction of the point \((0,1,2)\text{.}\)
  2. At the point \((3, 2, 1)\text{,}\) in what direction does the temperature decrease most rapidly?
  3. Moving along the curve given by \(x=3e^t\text{,}\) \(y = 2 \cos t\text{,}\) \(z= \sqrt{1 + t}\text{,}\) find \(\diff{T}{t}\text{,}\) the rate of change of temperature with respect to \(t\text{,}\) at \(t = 0\text{.}\)
  4. Suppose \(\hi+5\hj+a\hk\) is a vector that is tangent to the temperature level surface \(T(x, y, z) = 3\) at \((3, 2, 1)\text{.}\) What is \(a\text{?}\)
15. (✳).
Let
\begin{align*} f(x, y, z) &= (2x + y)e^{-(x^2 +y^2 +z^2)}\\ g(x, y, z) &= xz + y^2 + yz + z^2 \end{align*}
  1. Find the gradients of \(f\) and \(g\) at \((0,1,-1)\text{.}\)
  2. A bird at \((0,1,-1)\) flies at speed \(6\) in the direction in which \(f(x, y, z)\) increases most rapidly. As it passes through \((0,1,-1)\text{,}\) how quickly does \(g(x, y, z)\) appear (to the bird) to be changing?
  3. A bat at \((0,1,-1)\) flies in the direction in which \(f (x, y, z)\) and \(g(x, y, z)\) do not change, but \(z\) increases. Find a vector in this direction.
16. (✳).
A bee is flying along the curve of intersection of the surfaces \(3z + x^2 + y^2 = 2\) and \(z = x^2 - y^2\) in the direction for which \(z\) is increasing. At time \(t = 2\text{,}\) the bee passes through the point \((1, 1, 0)\) at speed \(6\text{.}\)
  1. Find the velocity (vector) of the bee at time \(t = 2\text{.}\)
  2. The temperature \(T\) at position \((x, y, z)\) at time \(t\) is given by \(T = xy - 3x+2yt+z\text{.}\) Find the rate of change of temperature experienced by the bee at time \(t = 2\text{.}\)
17. (✳).
The temperature at a point \((x, y, z)\) is given by \(T(x, y, z) = 5e^{-2x^2-y^2-3z^2}\text{,}\) where \(T\) is measured in centigrade and \(x\text{,}\) \(y\text{,}\) \(z\) in meters.
  1. Find the rate of change of temperature at the point \(P(1, 2, -1)\) in the direction toward the point \((1, 1, 0)\text{.}\)
  2. In which direction does the temperature decrease most rapidly?
  3. Find the maximum rate of decrease at \(P\text{.}\)
18. (✳).
The directional derivative of a function \(w = f(x, y, z)\) at a point \(P\) in the direction of the vector \(\hi\) is 2, in the direction of the vector \(\hi+\hj\) is \(-\sqrt{2}\text{,}\) and in the direction of the vector \(\hi+\hj+\hk\) is \(-\frac{5}{\sqrt{3}}\text{.}\) Find the direction in which the function \(w = f(x, y, z)\) has the maximum rate of change at the point \(P\) . What is this maximum rate of change?
19. (✳).
Suppose it is known that the direction of the fastest increase of the function \(f(x,y)\) at the origin is given by the vector \(\llt 1, 2\rgt\text{.}\) Find a unit vector \(u\) that is tangent to the level curve of \(f(x,y)\) that passes through the origin.
20. (✳).
The shape of a hill is given by \(z = 1000 - 0.02x^2 - 0.01y^2\text{.}\) Assume that the \(x\)-axis is pointing East, and the \(y\)-axis is pointing North, and all distances are in metres.
  1. What is the direction of the steepest ascent at the point \((0, 100, 900)\text{?}\) (The answer should be in terms of directions of the compass).
  2. What is the slope of the hill at the point \((0, 100, 900)\) in the direction from (a)?
  3. If you ride a bicycle on this hill in the direction of the steepest descent at \(5\) m/s, what is the rate of change of your altitude (with respect to time) as you pass through the point (0, 100, 900)?
21. (✳).
Let the pressure \(P\) and temperature \(T\) at a point \((x, y, z)\) be
\begin{equation*} P(x,y,z) = \frac{x^2+2y^2}{1+z^2},\qquad T(x,y,z) = 5 + xy - z^2 \end{equation*}
  1. If the position of an airplane at time \(t\) is
    \begin{equation*} (x(t), y(t), z(t)) = (2t, t^2 - 1, \cos t) \end{equation*}
    find \(\diff{}{t} (PT)^2\) at time \(t = 0\) as observed from the airplane.
  2. 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.)
  3. An ant crawls on the surface \(z^3 + zx + y^2 = 2\text{.}\) When the ant is at the point \((0,-1,1)\text{,}\) in which direction should it go for maximum increase of the temperature \(T = 5 + xy - z^2\text{?}\) Your answer should be a vector \(\llt a, b, c\rgt\text{,}\) 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 \(\llt a, b, c\rgt\) has to be on the tangent plane to the surface.)
22. (✳).
Suppose that \(f(x,y,z)\) is a function of three variables and let \(\vu = \frac{1}{\sqrt{6}} \llt 1, 1, 2\rgt\) and \(\vv = \frac{1}{\sqrt{3}} \llt 1, -1, -1\rgt\) and \(\vw = \frac{1}{\sqrt{3}} \llt 1, 1, 1\rgt\text{.}\) Suppose that at a point \((a,b,c)\text{,}\)
\begin{align*} D_\vu f&=0\\ D_\vv f&=0\\ D_\vw f&=4 \end{align*}
Find \(\vnabla f\) at \((a,b,c)\text{.}\)
23. (✳).
The elevation of a hill is given by the equation \(f(x,y)=x^2y^2e^{-x-y}\text{.}\) An ant sits at the point \((1,1,e^{-2})\text{.}\)
  1. Find the unit vector \(\vu=\llt u_1,u_2\rgt\) that maximizes
    \begin{equation*} \lim_{t\rightarrow 0}\frac{f\big((1,1)+t\vu\big)-f(1,1)}{t} \end{equation*}
  2. Find a vector \(\vv=\llt v_1,v_2,v_3\rgt\) pointing in the direction of the path that the ant could take in order to stay on the same elevation level \(e^{-2}\text{.}\)
  3. Find a vector \(\vv=\llt v_1,v_2,v_3\rgt\) pointing in the direction of the path that the ant should take in order to maximize its instantaneous rate of level increase.
24. (✳).
Let the temperature in a region of space be given by \(T(x,y,z)=3x^2+\half y^2+2z^2\) degrees.
  1. A sparrow is flying along the curve \(\vr(s)=\big(\frac{1}{3}s^3,2s,s^2\big)\) at a constant speed of \(3{\rm ms}^{-1}\text{.}\) What is the velocity of the sparrow when \(s=1\text{?}\)
  2. At what rate does the sparrow feel the temperature is changing at the point \(A\big(\frac{1}{3},2,1\big)\) for which \(s=1\text{.}\)
  3. At the point \(A\big(\frac{1}{3},2,1\big)\) in what direction will the temperature be decreasing at maximum rate?
  4. An eagle crosses the path of the sparrow at \(A\big(\frac{1}{3},2,1\big)\text{,}\) is moving at right angles to the path of the sparrow, and is also moving in a direction in which the temperature remains constant. In what directions could the eagle be flying as it passes through the point \(A\text{?}\)
25. (✳).
Assume that the temperature \(T\) at a point \((x,y,z)\) near a flame at the origin is given by
\begin{equation*} T(x,y,z)=\frac{200}{1+x^2+y^2+z^2} \end{equation*}
where the coordinates are given in meters and the temperature is in degrees Celsius. Suppose that at some moment in time, a moth is at the point \((3,4,0)\) and is flying at a constant speed of \(1 {\rm m/s}\) in the direction of maximum increase of temperature.
  1. Find the velocity vector \(\vv\) of the moth at this moment.
  2. What rate of change of temperature does the moth feel at that moment?
26. (✳).
We say that \(u\) is inversely proportional to \(v\) if there is a constant \(k\) so that \(u=k/v\text{.}\) Suppose that the temperature \(T\) in a metal ball is inversely proportional to the distance from the centre of the ball, which we take to be the origin. The temperature at the point \((1,2,2)\) is \(120^\circ\text{.}\)
  1. Find the constant of proportionality.
  2. Find the rate of change of \(T\) at \((1,2,2)\) in the direction towards the point \((2,1,3)\text{.}\)
  3. Show that at most points in the ball, the direction of greatest increase is towards the origin.
27. (✳).
The depth of a lake in the \(xy\)-plane is equal to \(f(x, y) = 32-x^2-4x-4y^2\) meters.
  1. Sketch the shoreline of the lake in the \(xy\)-plane.
Your calculus instructor is in the water at the point \((-1, 1)\text{.}\) Find a unit vector which indicates in which direction he should swim in order to:
  1. [(b)] stay at a constant depth?
  2. [(c)] increase his depth as rapidly as possible (i.e. be most likely to drown)?

Exercise Group.

Exercises — Stage 3
28.
The temperature \(T(x,y)\) at points of the \(xy\)-plane is given by \(T(x,y)=x^2-2y^2\text{.}\)
  1. Draw a contour diagram for \(T\) showing some isotherms (curves of constant temperature).
  2. In what direction should an ant at position \((2,-1)\) move if it wishes to cool off as quickly as possible?
  3. If the ant moves in that direction at speed \(v\) at what rate does its temperature decrease?
  4. What would the rate of decrease of temperature of the ant be if it moved from \((2,-1)\) at speed \(v\) in direction \(\llt -1,-2\rgt\text{?}\)
  5. Along what curve through \((2,-1)\) should the ant move to continue experiencing maximum rate of cooling?
29. (✳).
Consider the function \(f(x,y,z) = x^2 + \cos(yz)\text{.}\)
  1. Give the direction in which \(f\) is increasing the fastest at the point \((1, 0, \pi/2)\text{.}\)
  2. Give an equation for the plane \(T\) tangent to the surface
    \begin{equation*} S = \Set{(x,y,z)}{f(x,y,z) = 1} \end{equation*}
    at the point \((1, 0, \pi/2)\text{.}\)
  3. Find the distance between \(T\) and the point \((0, 1, 0)\text{.}\)
  4. Find the angle between the plane \(T\) and the plane
    \begin{equation*} P = \Set{(x,y,z)}{x + z = 0}. \end{equation*}
30. (✳).
A function \(T(x,y,z)\) at \(P = (2,1,1)\) is known to have \(T(P) = 5\text{,}\) \(T_x (P) = 1\text{,}\) \(T_y(P) = 2\text{,}\) and \(T_z(P) = 3\text{.}\)
  1. A bee starts flying at \(P\) and flies along the unit vector pointing towards the point \(Q = (3,2,2)\text{.}\) What is the rate of change of \(T(x,y,z)\) in this direction?
  2. Use the linear approximation of \(T\) at the point \(P\) to approximate \(T(1.9,1,1.2)\text{.}\)
  3. Let \(S(x,y,z) = x + z\text{.}\) A bee starts flying at \(P\text{;}\) along which unit vector direction should the bee fly so that the rate of change of \(T(x,y,z)\) and of \(S(x,y,z)\) are both zero in this direction?
31. (✳).
Consider the functions \(F(x,y,z) = z^3 +xy^2 +xz\) and \(G(x,y,z)=3x-y+4z\text{.}\) You are standing at the point \(P(0,1,2)\text{.}\)
  1. You jump from \(P\) to \(Q(0.1\,,\,0.9\,,\,1.8)\text{.}\) Use the linear approximation to determine approximately the amount by which \(F\) changes.
  2. You jump from \(P\) in the direction along which \(G\) increases most rapidly. Will \(F\) increase or decrease?
  3. You jump from \(P\) in a direction \(\llt a\,,\,b\,,\,c\rgt\) along which the rates of change of \(F\) and \(G\) are both zero. Give an example of such a direction (need not be a unit vector).
32. (✳).
A meteor strikes the ground in the heartland of Canada. Using satellite photographs, a model
\begin{equation*} z=f(x,y)=-\frac{100}{x^2+2x+4y^2+11} \end{equation*}
of the resulting crater is made and a plan is drawn up to convert the site into a tourist attraction. A car park is to be built at \((4,5)\) and a hiking trail is to be made. The trail is to start at the car park and take the steepest route to the bottom of the crater.
  1. Sketch a map of the proposed site clearly marking the car park, a few level curves for the function \(f\) and the trail.
  2. In which direction does the trail leave the car park?
33. (✳).
You are standing at a lone palm tree in the middle of the Exponential Desert. The height of the sand dunes around you is given in meters by
\begin{equation*} h(x,y)=100 e^{-(x^2+2y^2)} \end{equation*}
where \(x\) represents the number of meters east of the palm tree (west if \(x\) is negative) and \(y\) represents the number of meters north of the palm tree (south if \(y\) is negative).
  1. Suppose that you walk \(3\) meters east and 2 meters north. At your new location, \((3,2)\text{,}\) in what direction is the sand dune sloping most steeply downward?
  2. If you walk north from the location described in part (a), what is the instantaneous rate of change of height of the sand dune?
  3. If you are standing at \((3,2)\) in what direction should you walk to ensure that you remain at the same height?
  4. Find the equation of the curve through \((3,2)\) that you should move along in order that you are always pointing in a steepest descent direction at each point of this curve.
34. (✳).
Let \(f(x,y)\) be a differentiable function with \(f(1,2)=7\text{.}\) Let
\begin{equation*} \vu=\frac{3}{5}\,\hi+\frac{4}{5}\,\hj,\qquad \vv=\frac{3}{5}\,\hi-\frac{4}{5}\,\hj \end{equation*}
be unit vectors. Suppose it is known that the directional derivatives \(D_\vu f(1,2)\) and \(D_\vv f(1,2)\) are equal to \(10\) and \(2\) respectively.
  1. Show that the gradient vector \(\vnabla f\) at \((1,2)\) is \(10\hi+5\hj\text{.}\)
  2. Determine the rate of change of \(f\) at \((1,2)\) in the direction of the vector \(\hi+2\hj\text{.}\)
  3. Using the tangent plane approximation, estimate the value of \(f(1.01,2.05)\text{.}\)