Section 7.5 Directional Derivatives
¶We still have not answered one of our first questions about the steepness of a surface: starting at a point on a surface given by \(f(x,y)\text{,}\) and walking in a particular direction, how steep is the surface? We are now ready to answer the question.
We already know roughly what has to be done: as shown in Figure 7.3, we extend a line in the \(x\)\(y\)plane to a vertical plane, and we then compute the slope of the curve that is the crosssection of the surface in that plane. The major stumbling block is that what appears in this plane to be the horizontal axis, namely the line in the \(x\)\(y\)plane, is not an actual axis—we know nothing about the “units” along the axis. Our goal is to make this line into a \(t\) axis; then we need formulas to write \(x\) and \(y\) in terms of this new variable \(t\text{;}\) then we can write \(z\) in terms of \(t\) since we know \(z\) in terms of \(x\) and \(y\text{;}\) and finally we can simply take the derivative.
So we need to somehow “mark off” units on the line, and we need a convenient way to refer to the line in calculations. It turns out that we can accomplish both by using the vector form of a line. Suppose that \(\vect{u}\) is a unit vector \(\langle u_1,u_2\rangle\) in the direction of interest. A vector equation for the line through \((x_0,y_0)\) in this direction is \(\vect{v}(t)=\langle u_1t+x_0,u_2t+y_0\rangle\text{.}\) The height of the surface above the point \((u_1t+x_0,u_2t+y_0)\) is \(g(t)=f(u_1t+x_0,u_2t+y_0)\text{.}\) Because \(\vect{u}\) is a unit vector, the value of \(t\) is precisely the distance along the line from \((x_0,y_0)\) to \((u_1t+x_0,u_2t+y_0)\text{;}\) this means that the line is effectively a \(t\) axis, with origin at the point \((x_0,y_0)\text{,}\) so the slope we seek is
Here we have used the Chain Rule and the derivatives \({d\over dt}(u_1t+x_0)=u_1\) and \({d\over dt}(u_2t+y_0)=u_2\text{.}\) The vector \(\langle f_x,f_y\rangle\) is very useful, so it has its own symbol, \(\nabla f\text{,}\) pronounced “del f” ; it is also called the gradient of \(f\text{.}\)
Example 7.37. Slope.
Find the slope of \(z=x^2+y^2\) at \((1,2)\) in the direction of the vector \(\langle 3,4\rangle\text{.}\)
We first compute the gradient at \((1,2)\text{:}\) \(\nabla f=\langle 2x,2y\rangle\text{,}\) which is \(\langle 2,4\rangle\) at \((1,2)\text{.}\) A unit vector in the desired direction is \(\langle 3/5,4/5\rangle\text{,}\) and the desired slope is then \(\langle 2,4\rangle\cdot\langle 3/5,4/5\rangle=6/5+16/5=22/5\text{.}\)
Example 7.38. Tangent Vector.
Find a tangent vector to \(z=x^2+y^2\) at \((1,2)\) in the direction of the vector \(\langle 3,4\rangle\) and show that it is parallel to the tangent plane at that point.
Since \(\langle 3/5,4/5\rangle\) is a unit vector in the desired direction, we can easily expand it to a tangent vector simply by adding the third coordinate computed in the previous example: \(\langle 3/5,4/5,22/5\rangle\text{.}\) To see that this vector is parallel to the tangent plane, we can compute its dot product with a normal to the plane. We know that a normal to the tangent plane is
and the dot product is \(\langle 2,4,1\rangle\cdot\langle 3/5,4/5,22/5\rangle=6/5+16/522/5=0\text{,}\) so the two vectors are perpendicular. (Note that the vector normal to the surface, namely \(\langle f_x,f_y,1\rangle\text{,}\) is simply the gradient with a \(1\) tacked on as the third component.)
The slope of a surface given by \(z=f(x,y)\) in the direction of a (twodimensional) vector \(\vect{u}\) is called the directional derivative of \(f\text{,}\) written \(D_{\vect{u}}f\text{.}\) The directional derivative immediately provides us with some additional information. We know that
if \(\vect{u}\) is a unit vector; \(\theta\) is the angle between \(\nabla f\) and \(\vect{u}\text{.}\) This tells us immediately that the largest value of \(D_{\vect{u}}f\) occurs when \(\cos\theta=1\text{,}\) namely, when \(\theta=0\text{,}\) so \(\nabla f\) is parallel to \(\vect{u}\text{.}\) In other words, the gradient \(\nabla f\) points in the direction of steepest ascent of the surface, and \(\nabla f\) is the slope in that direction. Likewise, the smallest value of \(D_{\vect{u}}f\) occurs when \(\cos\theta=1\text{,}\) namely, when \(\theta=\pi\text{,}\) so \(\nabla f\) is antiparallel to \(\vect{u}\text{.}\) In other words, \(\nabla f\) points in the direction of steepest descent of the surface, and \(\nabla f\) is the slope in that direction.
Example 7.39. Direction of Steepest Ascent and Descent.
Investigate the direction of steepest ascent and descent for \(z=x^2+y^2\text{.}\)
The gradient is \(\langle 2x,2y\rangle=2\langle x,y\rangle\text{;}\) this is a vector parallel to the vector \(\langle x,y\rangle\text{,}\) so the direction of steepest ascent is directly away from the origin, starting at the point \((x,y)\text{.}\) The direction of steepest descent is thus directly toward the origin from \((x,y)\text{.}\) Note that at \((0,0)\) the gradient vector is \(\langle 0,0\rangle\text{,}\) which has no direction, and it is clear from the plot of this surface that there is a minimum point at the origin, and tangent vectors in all directions are parallel to the \(x\)\(y\)plane.
If \(\nabla f\) is perpendicular to \(\vect{u}\text{,}\) \(D_{\vect{u}}f=\nabla f\cos(\pi/2)=0\text{,}\) since \(\cos(\pi/2)=0\text{.}\) This means that in either of the two directions perpendicular to \(\nabla f\text{,}\) the slope of the surface is 0; this implies that a vector in either of these directions is tangent to the level curve at that point. Starting with \(\nabla f=\langle f_x,f_y\rangle\text{,}\) it is easy to find a vector perpendicular to it: either \(\langle f_y,f_x\rangle\) or \(\langle f_y,f_x\rangle\) will work.
If \(f(x,y,z)\) is a function of three variables, all the calculations proceed in essentially the same way. The rate at which \(f\) changes in a particular direction is \(\nabla f\cdot\vect{u}\text{,}\) where now \(\nabla f=\langle f_x,f_y,f_z\rangle\) and \(\vect{u}=\langle u_1,u_2,u_3\rangle\) is a unit vector. Again \(\nabla f\) points in the direction of maximum rate of increase, \(\nabla f\) points in the direction of maximum rate of decrease, and any vector perpendicular to \(\nabla f\) is tangent to the level surface \(f(x,y,z)=k\) at the point in question. Of course there are no longer just two such vectors; the vectors perpendicular to \(\nabla f\) describe the tangent plane to the level surface, or in other words \(\nabla f\) is a normal to the tangent plane.
Example 7.40. Gradient.
Suppose the temperature at a point in space is given by \(T(x,y,z)=T_0/(1+x^2+y^2+z^2)\text{;}\) at the origin the temperature in Kelvin is \(T_0>0\text{,}\) and it decreases in every direction from there. It might be, for example, that there is a source of heat at the origin, and as we get farther from the source, the temperature decreases. The gradient is
The gradient points directly at the origin from the point \((x,y,z)\)—by moving directly toward the heat source, we increase the temperature as quickly as possible.
Example 7.41. Tangent Plane.
Find the points on the surface defined by \(x^2+2y^2+3z^2=1\) where the tangent plane is parallel to the plane defined by \(3xy+3z=1\text{.}\)
Two planes are parallel if their normals are parallel or antiparallel, so we want to find the points on the surface with normal parallel or antiparallel to \(\langle 3,1,3\rangle\text{.}\) Let \(f=x^2+2y^2+3z^2\text{;}\) the gradient of \(f\) is normal to the level surface at every point, so we are looking for a gradient parallel or antiparallel to \(\langle 3,1,3\rangle\text{.}\) The gradient is \(\langle 2x,4y,6z\rangle\text{;}\) if it is parallel or antiparallel to \(\langle 3,1,3\rangle\text{,}\) then
for some \(k\text{.}\) This means we need a solution to the equations
but this is three equations in four unknowns—we need another equation. What we haven't used so far is that the points we seek are on the surface \(x^2+2y^2+3z^2=1\text{;}\) this is the fourth equation. If we solve the first three equations for \(x\text{,}\) \(y\text{,}\) and \(z\) and substitute into the fourth equation we get
so \(\ds k=\pm{2\sqrt2\over 5}\text{.}\) The desired points are \(\ds\left({3\sqrt2\over5},{\sqrt2\over10},{\sqrt2\over 5}\right)\) and \(\ds\left({3\sqrt2\over5},{\sqrt2\over10},{\sqrt2\over 5}\right)\text{.}\)
Exercises for Section 7.5.
Exercise 7.5.1.
Find \(D_{\vect{u}} f\) for \(\ds f=x^2+xy+y^2\) in the direction of \(\vect{u}=\langle 2,1\rangle\) at the point \((1,1)\text{.}\)
Answer\(9\sqrt5/5\)
Exercise 7.5.2.
Find \(D_{\vect{u}} f\) for \(\ds f=\sin(xy)\) in the direction of \(\vect{u}=\langle 1,1\rangle\) at the point \((3,1)\text{.}\)
Answer\(\sqrt2\cos3\)
Exercise 7.5.3.
Find \(D_{\vect{u}} f\) for \(\ds f=e^x\cos(y)\) in the direction 30 degrees from the positive \(x\) axis at the point \((1,\pi/4)\text{.}\)
Answer\(e\sqrt2(\sqrt31)/4\)
Exercise 7.5.4.
The temperature of a thin plate in the \(x\)\(y\)plane is \(\ds T=x^2+y^2\text{.}\) How fast does temperature change at the point \((1,5)\) moving in a direction 30 degrees from the positive \(x\) axis?
Answer\(\sqrt3+5\)
Exercise 7.5.5.
Suppose the density of a thin plate at \((x,y)\) is \(\ds 1/\sqrt{x^2+y^2+1}\text{.}\) Find the rate of change of the density at \((2,1)\) in a direction \(\pi/3\) radians from the positive \(x\) axis.
Answer\(\sqrt6(2+\sqrt3)/72\)
Exercise 7.5.6.
Suppose the electric potential at \((x,y)\) is \(\ds\ln\sqrt{x^2+y^2}\text{.}\) Find the rate of change of the potential at \((3,4)\) toward the origin and also in a direction at a right angle to the direction toward the origin.
Answer\(1/5\text{,}\) \(0\)
Exercise 7.5.7.
A plane perpendicular to the \(x\)\(y\)plane contains the point \((2,1,8)\) on the paraboloid \(z=x^2+4y^2\text{.}\) The crosssection of the paraboloid created by this plane has slope 0 at this point. Find an equation of the plane.
Answer\(4(x2)+8(y1)=0\)
Exercise 7.5.8.
A plane perpendicular to the \(x\)\(y\)plane contains the point \((3,2,2)\) on the paraboloid \(36z=4x^2+9y^2\text{.}\) The crosssection of the paraboloid created by this plane has slope 0 at this point. Find an equation of the plane.
Answer\(2(x3)+3(y2)=0\)
Exercise 7.5.9.
Suppose the temperature at \((x,y,z)\) is given by \(\ds T=xy+\sin(yz)\text{.}\) In what direction should you go from the point \((1,1,1)\) to decrease the temperature as quickly as possible? What is the rate of change of temperature in this direction?
Answer\(\langle 1,1\cos1,\cos1\rangle\text{,}\) \(\sqrt{2+2\cos1+2\cos^21}\)
Exercise 7.5.10.
Suppose the temperature at \((x,y,z)\) is given by \(\ds T=xyz\text{.}\) In what direction can you go from the point \((1,1,1)\) to maintain the same temperature?
AnswerAny direction perpendicular to \(\nabla T=\langle 1,1,1\rangle\text{,}\) for example, \(\langle 1,1,0\rangle\)
Exercise 7.5.11.
Find an equation for the plane tangent to \(\ds x^23y^2+z^2=7\) at \((1,1,3)\text{.}\)
Answer\(2(x1)6(y1)+6(z3)=0\)
Exercise 7.5.12.
Find an equation for the plane tangent to \(\ds xyz=6\) at \((1,2,3)\text{.}\)
Answer\(6(x1)+3(y2)+2(z3)=0\)
Exercise 7.5.13.
Find an equation for the line normal to \(\ds x^2+2y^2+4z^2=26\) at \((2,3,1)\text{.}\)
Answer\(\langle 2+4t,312t,18t\rangle\)
Exercise 7.5.14.
Find an equation for the line normal to \(\ds x^2+y^2+9z^2=56\) at \((4,2,2)\text{.}\)
Answer\(\langle 4+8t,2+4t,236t\rangle\)
Exercise 7.5.15.
Find an equation for the line normal to \(\ds x^2+5y^2z^2=0\) at \((4,2,6)\text{.}\)
Answer\(\langle 4+8t,2+20t,612t\rangle\)
Exercise 7.5.16.
Find the directions in which the directional derivative of \(f(x,y)=x^2+\sin(xy)\) at the point \((1,0)\) has the value 1.
Answer\(\langle 0,1\rangle\text{,}\) \(\langle 4/5,3/5\rangle\)
Exercise 7.5.17.
Show that the curve \(\vect{r}(t) = \langle\ln(t),t\ln(t),t\rangle\) is tangent to the surface \(xz^2yz+\cos(xy) = 1\) at the point \((0,0,1)\text{.}\)
Exercise 7.5.18.
A bug is crawling on the surface of a hot plate, the temperature of which at the point \(x\) units to the right of the lower left corner and \(y\) units up from the lower left corner is given by \(T(x,y)=100x^23y^3\text{.}\)

If the bug is at the point \((2,1)\text{,}\) in what direction should it move to cool off the fastest? How fast will the temperature drop in this direction?
Answer\(\langle 4,9\rangle\) 
If the bug is at the point \((1,3)\text{,}\) in what direction should it move in order to maintain its temperature?
Answer\(\langle 81,2\rangle\) or \(\langle 81,2\rangle\)
Exercise 7.5.19.
The elevation on a portion of a hill is given by \(f(x,y) = 100 4x^2  2y\text{.}\) From the location above \((2,1)\text{,}\) in which direction will water run?
Answerin the direction of \(\langle 8,1\rangle\)
Exercise 7.5.20.
Suppose that \(g(x,y)=yx^2\text{.}\) Find the gradient at the point \((1, 3)\text{.}\) Sketch the level curve to the graph of \(g\) when \(g(x,y)=2\text{,}\) and plot both the tangent line and the gradient vector at the point \((1,3)\text{.}\) (Make your sketch large). What do you notice, geometrically?
Answer\(\ds \nabla g(1,3)=\langle 2,1\rangle\)
Exercise 7.5.21.
The gradient \(\nabla f\) is a vector valued function of two variables. Prove the following gradient rules. Assume \(f(x,y)\) and \(g(x,y)\) are differentiable functions.
\(\nabla(fg)=f\nabla(g)+g\nabla(f)\)
\(\nabla(f/g)=(g\nabla f  f \nabla g)/g^2\)
\(\nabla((f(x,y))^n)=nf(x,y)^{n1}\nabla f\)