Section 12.6 Directional Derivatives
Subsection 12.6.1 Functions of Two Variables
We begin with a definition.Definition 12.6.2. Directional Derivatives.
Let z=f(x,y) be continuous on a set S and let →u=⟨u1,u2⟩ be a unit vector. For all points (x,y), the directional derivative of f at (x,y) in the direction of →u is
Theorem 12.6.3. Directional Derivatives.
Let z=f(x,y) be differentiable on a set S containing (x0,y0), and let →u=⟨u1,u2⟩ be a unit vector. The directional derivative of f at (x0,y0) in the direction of →u is
Example 12.6.4. Computing directional derivatives.
Let z=14−x2−y2 and let P=(1,2). Find the directional derivative of f, at P, in the following directions:
toward the point Q=(3,4),
in the direction of ⟨2,−1⟩, and
toward the origin.
The surface is plotted in Figure 12.6.5, where the point \(P=(1,2)\) is indicated in the \(x,y\)-plane as well as the point \((1,2,9)\) which lies on the surface of \(f\text{.}\) We find that \(f_x(x,y) = -2x\) and \(f_x(1,2) = -2\text{;}\) \(f_y(x,y) = -2y\) and \(f_y(1,2) = -4\text{.}\)
-
Let \(\vec u_1\) be the unit vector that points from the point \((1,2)\) to the point \(Q=(3,4)\text{,}\) as shown in the figure. The vector \(\overrightarrow{PQ} = \la 2,2\ra\text{;}\) the unit vector in this direction is \(\vec u_1=\la 1/\sqrt{2}, 1/\sqrt{2}\ra\text{.}\) Thus the directional derivative of \(f\) at \((1,2)\) in the direction of \(\vec u_1\) is
\begin{equation*} D_{\vec u_1}f(1,2) = -2(1/\sqrt{2}) +(-4)(1/\sqrt{2}) = -6/\sqrt{2}\approx -4.24\text{.} \end{equation*}Thus the instantaneous rate of change in moving from the point \((1,2,9)\) on the surface in the direction of \(\vec u_1\) (which points toward the point \(Q\)) is about \(-4.24\text{.}\) Moving in this direction moves one steeply downward.
-
We seek the directional derivative in the direction of \(\la 2,-1\ra\text{.}\) The unit vector in this direction is \(\vec u_2 = \la 2/\sqrt{5},-1/\sqrt{5}\ra\text{.}\) Thus the directional derivative of \(f\) at \((1,2)\) in the direction of \(\vec u_2\) is
\begin{equation*} D_{\vec u_2}f(1,2) = -2(2/\sqrt{5})+(-4)(-1/\sqrt{5}) = 0\text{.} \end{equation*}Starting on the surface of \(f\) at \((1,2)\) and moving in the direction of \(\la 2,-1\ra\) (or \(\vec u_2\)) results in no instantaneous change in \(z\)-value. This is analogous to standing on the side of a hill and choosing a direction to walk that does not change the elevation. One neither walks up nor down, rather just “along the side” of the hill. Finding these directions of “no elevation change” is important.
-
At \(P=(1,2)\text{,}\) the direction towards the origin is given by the vector \(\la -1,-2\ra\text{;}\) the unit vector in this direction is \(\vec u_3=\la -1/\sqrt{5},-2/\sqrt{5}\ra\text{.}\) The directional derivative of \(f\) at \(P\) in the direction of the origin is
\begin{equation*} D_{\vec u_3}f(1,2) = -2(-1/\sqrt{5}) + (-4)(-2/\sqrt{5}) = 10/\sqrt{5} \approx 4.47\text{.} \end{equation*}Moving towards the origin means “walking uphill” quite steeply, with an initial slope of about \(4.47\text{.}\)
Definition 12.6.7. Gradient.
Let z=f(x,y) be differentiable on a set S that contains the point (x0,y0).
The gradient of f is ∇f(x,y)=⟨fx(x,y),fy(x,y)⟩.
The gradient of f at (x0,y0) is ∇f(x0,y0)=⟨fx(x0,y0),fy(x0,y0)⟩.
Key Idea 12.6.8. The Gradient and Directional Derivatives.
The directional derivative of z=f(x,y) in the direction of →u is
In what direction(s) is the change in z the greatest (i.e., the “steepest uphill”)?
In what direction(s) is the change in z the least (i.e., the “steepest downhill”)?
In what direction(s) is there no change in z?
Equation (12.6.1) is maximized when cos(θ)=1, i.e., when the gradient and →u have the same direction. We conclude the gradient points in the direction of greatest z change.
Equation (12.6.1) is minimized when cos(θ)=−1, i.e., when the gradient and →u have opposite directions. We conclude the gradient points in the opposite direction of the least z change.
Equation (12.6.1) is 0 when cos(θ)=0, i.e., when the gradient and →u are orthogonal to each other. We conclude the gradient is orthogonal to directions of no z change.
Theorem 12.6.9. The Gradient and Directional Derivatives.
Let z=f(x,y) be differentiable on a set S with gradient ∇f, let P=(x0,y0) be a point in S and let →u be a unit vector.
The maximum value of D→uf(x0,y0) is ‖∇f(x0,y0)‖; the direction of maximal z increase is ∇f(x0,y0).
The minimum value of D→uf(x0,y0) is −‖∇f(x0,y0)‖; the direction of minimal z increase is −∇f(x0,y0).
At P, ∇f(x0,y0) is orthogonal to the level curve passing through (x0,y0,f(x0,y0)).
Example 12.6.10. Finding directions of maximal and minimal increase.
Let f(x,y)=sin(x)cos(y) and let P=(π/3,π/3). Find the directions of maximal/minimal increase, and find a direction where the instantaneous rate of z change is 0.
We begin by finding the gradient. \(f_x = \cos(x) \cos(y)\) and \(f_y = -\sin(x) \sin(y)\text{,}\) thus
Thus the direction of maximal increase is \(\la 1/4, -3/4\ra\text{.}\) In this direction, the instantaneous rate of \(z\) change is \(\norm{\la 1/4,-3/4\ra} = \sqrt{10}/4 \approx 0.79\text{.}\)
Figure 12.6.11 shows the surface plotted from two different perspectives. In each, the gradient is drawn at \(P\) with a dashed line (because of the nature of this surface, the gradient points “into” the surface). Let \(\vec u = \la u_1, u_2\ra\) be the unit vector in the direction of \(\nabla f\) at \(P\text{.}\) Each graph of the figure also contains the vector \(\la u_1, u_2, \norm{\nabla f\,}\ra\text{.}\) This vector has a “run” of 1 (because in the \(xy\)-plane it moves 1 unit) and a “rise” of \(\norm{\nabla f}\text{,}\) hence we can think of it as a vector with slope of \(\norm{\nabla f}\) in the direction of \(\nabla f\text{,}\) helping us visualize how “steep” the surface is in its steepest direction.
The direction of minimal increase is \(\la -1/4,3/4\ra\text{;}\) in this direction the instantaneous rate of \(z\) change is \(-\sqrt{10}/4 \approx -0.79\text{.}\)
Any direction orthogonal to \(\nabla f\) is a direction of no \(z\) change. We have two choices: the direction of \(\la 3,1\ra\) and the direction of \(\la -3,-1\ra\text{.}\) The unit vector in the direction of \(\la 3,1\ra\) is shown in each graph of the figure as well. The level curve at \(z=\sqrt{3}/4\) is drawn: recall that along this curve the \(z\)-values do not change. Since \(\la 3,1\ra\) is a direction of no \(z\)-change, this vector is tangent to the level curve at \(P\text{.}\)
Example 12.6.12. Understanding when ∇f=→0.
Let f(x,y)=−x2+2x−y2+2y+1. Find the directional derivative of f in any direction at P=(1,1).
We find \(\nabla f = \la -2x+2, -2y+2\ra\text{.}\) At \(P\text{,}\) we have \(\nabla f(1,1) = \la 0,0\ra\text{.}\) According to Theorem 12.6.9, this is the direction of maximal increase. However, \(\la 0,0\ra\) is directionless; it has no displacement. And regardless of the unit vector \(\vec u\) chosen, \(D_{\vec u\,}f = 0\text{.}\)
Figure 12.6.13 helps us understand what this means. We can see that \(P\) lies at the top of a paraboloid. In all directions, the instantaneous rate of change is 0.
So what is the direction of maximal increase? It is fine to give an answer of \(\vec 0 = \la 0,0\ra\text{,}\) as this indicates that all directional derivatives are 0.
Example 12.6.14. The flow of water downhill.
Consider the surface given by f(x,y)=20−x2−2y2. Water is poured on the surface at (1,1/4). What path does it take as it flows downhill?
Let \(\vrt = \la x(t), y(t)\ra\) be the vector-valued function describing the path of the water in the \(xy\)-plane; we seek \(x(t)\) and \(y(t)\text{.}\) We know that water will always flow downhill in the steepest direction; therefore, at any point on its path, it will be moving in the direction of \(-\nabla f\text{.}\) (We ignore the physical effects of momentum on the water.) Thus \(\vrp(t)\) will be parallel to \(\nabla f\text{,}\) and there is some constant \(c\) such that \(c\nabla f = \vrp(t) = \la x'(t), y'(t)\ra\text{.}\)
We find \(\nabla f = \la -2x, -4y\ra\) and write \(x'(t)\) as \(\frac{dx}{dt}\) and \(y'(t)\) as \(\frac{dy}{dt}\text{.}\) Then
This implies
As \(c\) equals both expressions, we have
To find an explicit relationship between \(x\) and \(y\text{,}\) we can integrate both sides with respect to \(t\text{.}\) Recall from our study of differentials that \(\frac{dx}{dt}dt = dx\text{.}\) Thus:
Now raise both sides as a power of \(e\text{:}\)
\begin{align*} x^2 \amp = e^{\ln\abs{y}+C_1}\\ x^2 \amp = e^{\ln\abs{y}}e^{C_1}\qquad \text{(Note that \(e^{C_1}\) is just a constant.)}\\ x^2 \amp = yC_2\\ \frac1{C_2}x^2 \amp =y \qquad \text{ (Note that \(1/C_2\) is just a constant.) }\\ Cx^2 \amp = y\text{.} \end{align*}As the water started at the point \((1,1/4)\text{,}\) we can solve for \(C\text{:}\)
Thus the water follows the curve \(y=x^2/4\) in the \(xy\)-plane. The surface and the path of the water is graphed in Figure 12.6.15.(a). In Figure 12.6.15.(b), the level curves of the surface are plotted in the \(xy\)-plane, along with the curve \(y=x^2/4\text{.}\) Notice how the path intersects the level curves at right angles. As the path follows the gradient downhill, this reinforces the fact that the gradient is orthogonal to level curves.
Subsection 12.6.2 Functions of Three Variables
The concepts of directional derivatives and the gradient are easily extended to three (and more) variables. We combine the concepts behind Definitions 12.6.2 and Definition 12.6.7 and Theorem 12.6.3 into one set of definitions.Definition 12.6.17. Directional Derivatives and Gradient with Three Variables.
Let w=F(x,y,z) be differentiable on a set D and let →u be a unit vector in R3.
The gradient of F is ∇F=⟨Fx,Fy,Fz⟩.
-
The directional derivative of F in the direction of →u is
D→uF=∇F⋅→u.
Theorem 12.6.18. The Gradient and Directional Derivatives with Three Variables.
Let w=F(x,y,z) be differentiable on a set D, let ∇F be the gradient of F, and let →u be a unit vector.
The maximum value of D→uF is ‖∇F‖, obtained when the angle between ∇F and →u is 0, i.e., the direction of maximal increase is ∇F.
The minimum value of D→uF is −‖∇F‖, obtained when the angle between ∇F and →u is π, i.e., the direction of minimal increase is −∇F.
D→uF=0 when ∇F and →u are orthogonal.
Example 12.6.19. Finding directional derivatives with functions of three variables.
If a point source S is radiating energy, the intensity I at a given point P in space is inversely proportional to the square of the distance between S and P. That is, when S=(0,0,0), I(x,y,z)=kx2+y2+z2 for some constant k.
Let k=1, let →u=⟨2/3,2/3,1/3⟩ be a unit vector, and let P=(2,5,3). Measure distances in inches. Find the directional derivative of I at P in the direction of →u, and find the direction of greatest intensity increase at P.
We need the gradient \(\nabla I\text{,}\) meaning we need \(I_x\text{,}\) \(I_y\) and \(I_z\text{.}\) Each partial derivative requires a simple application of the Quotient Rule, giving
The directional derivative tells us that moving in the direction of \(\vec u\) from \(P\) results in a decrease in intensity of about \(-0.008\) units per inch. (The intensity is decreasing as \(\vec u\) moves one farther from the origin than \(P\text{.}\))
The gradient gives the direction of greatest intensity increase. Notice that
That is, the gradient at \((2,5,3)\) is pointing in the direction of \(\la -2,-5,-3\ra\text{,}\) that is, towards the origin. That should make intuitive sense: the greatest increase in intensity is found by moving towards to source of the energy.
Exercises 12.6.3 Exercises
Terms and Concepts
1.
What is the difference between a directional derivative and a partial derivative?
2.
For f(x,y), for what →u is D→uf=fx?
3.
For f(x,y), for what →u is D→uf=fy?
4.
The gradient is to level curves.
5.
The gradient points in the direction of increase.
6.
It is generally more informative to view the directional derivative not as the result of a limit, but rather as the result of a product.
In the following exercises, a function f(x,y) is given. Find ∇f.
In the following exercises, a function f(x,y) and a point P are given. Find the directional derivative of f in the indicated directions. Note: these are the same functions as in Exercises 12.6.3.7–12.6.3.12.
13.
f(x,y)=−x2y+xy2+xy, P=(2,1)
In the direction of →v=⟨3,4⟩
In the direction toward the point Q=(1,−1).
14.
Consider f(x,y)=sin(x)cos(y), at P=(π4,π3).
Find the directional derivative in the direction of →v=⟨1,1⟩.
Find the directional derivative in the direction toward the point Q=(0,0).
15.
f(x,y)=1x2+y2+1, P=(1,1).
In the direction of →v=⟨1,−1⟩.
In the direction toward the point Q=(−2,−2).
16.
Consider f(x,y)=−4x+3y, at P=(5,2).
Find the directional derivative in the direction of →v=⟨3,1⟩.
Find the directional derivative in the direction toward the point Q=(2,7).
17.
f(x,y)=x2+2y2−xy−7x, P=(4,1)
In the direction of →v=⟨−2,5⟩
In the direction toward the point Q=(4,0).
18.
Consider f(x,y)=x2y3−2x, at P=(1,1).
Find the directional derivative in the direction of →v=⟨3,3⟩.
Find the directional derivative in the direction toward the point Q=(1,2).
In the following exercises, a function f(x,y) and a point P are given.
Find the direction of maximal increase of f at P.
What is the maximal value of D→uf at P?
Find the direction of maximal decrease in f at P.
Give a direction →u such that D→uf=0 at P.
Note: these are the same functions and points as in Exercises 12.6.3.13 through Exercise 12.6.3.18.
19.
f(x,y)=−x2y+xy2+xy, P=(2,1)
20.
Given f(x,y)=sin(x)cos(y), P=(π4,π3):
Find the direction of maximal increase of f at P.
What is the maximal value of D→uf at P?
Find the direction of maximal decrease of f at P.
Give a direction →u such that D→uf=0 at P.
21.
f(x,y)=1x2+y2+1, P=(1,1).
22.
Given f(x,y)=−4x+3y, P=(5,4):
Find the direction of maximal increase of f at P.
What is the maximal value of D→uf at P?
Find the direction of maximal decrease of f at P.
Give a direction →u such that D→uf=0 at P.
23.
f(x,y)=x2+2y2−xy−7x, P=(4,1)
24.
Given f(x,y)=x2y3−2x, P=(1,1):
Find the direction of maximal increase of f at P.
What is the maximal value of D→uf at P?
Find the direction of maximal decrease of f at P.
Give a direction →u such that D→uf=0 at P.
In the following exercises, a function w=F(x,y,z), a vector →v and a point P are given.
Find ∇F(x,y,z).
Find D→uF at P, where →u is the unit vector in the direction of →v.