13 Functions of Several Variables

13.6 Directional Derivatives

Partial derivatives give us an understanding of how a surface changes when we move in the x and y directions. We made the comparison to standing in a rolling meadow and heading due east: the amount of rise/fall in doing so is comparable to fx. Likewise, the rise/fall in moving due north is comparable to fy. The steeper the slope, the greater in magnitude fy.

But what if we didn’t move due north or east? What if we needed to move northeast and wanted to measure the amount of rise/fall? Partial derivatives alone cannot measure this. This section investigates directional derivatives, which do measure this rate of change.

We begin with a definition.

Definition 13.6.1      Directional Derivatives

Let z=f(x,y) be continuous on an open 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

Duf(x,y)=limh0f(x+hu1,y+hu2)-f(x,y)h.

The partial derivatives fx and fy are defined with similar limits, but only x or y varies with h, not both. Here both x and y vary with a weighted h, determined by a particular unit vector u. This may look a bit intimidating but in reality it is not too difficult to deal with; it often just requires extra algebra. However, the following theorem reduces this algebraic load.

Theorem 13.6.1      Directional Derivatives

Let z=f(x,y) be differentiable at (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

Duf(x0,y0)=fx(x0,y0)u1+fy(x0,y0)u2.
  • Proof


    We will use Theorem 13.5.1, with x=g(t)=u1t+x0 and y=h(t)=u2t+y0. This means that

    Duf(x0,y0) =dfdt(x0,y0)
    =fx(x0,y0)dxdt(0)+fy(x0,y0)dydt(0)
    =fx(x0,y0)u1+fy(x0,y0)u2.
Example 13.6.1 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:

  1. 1.

    toward the point Q=(3,4),

  2. 2.

    in the direction of 2,-1, and

  3. 3.

    toward the origin.

Solutionmargin: Figure 13.6.1: Understanding the directional derivative in Example 13.6.1. The surface is plotted in Figure 13.6.1, 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. We find that fx(x,y)=-2x and fx(1,2)=-2; fy(x,y)=-2y and fy(1,2)=-4.

  1. 1.

    Let u1 be the unit vector that points from the point (1,2) to the point Q=(3,4), as shown in the figure. The vector PQ=2,2; the unit vector in this direction is u1=1/2,1/2. Thus the directional derivative of f at (1,2) in the direction of u1 is

    Du1f(1,2)=-2(1/2)+(-4)(1/2)=-6/2.

    Thus the instantaneous rate of change in moving from the point (1,2,9) on the surface in the direction of u1 (which points toward the point Q) is -32. Moving in this direction moves one steeply downward.

  2. 2.

    We seek the directional derivative in the direction of 2,-1. The unit vector in this direction is u2=2/5,-1/5. Thus the directional derivative of f at (1,2) in the direction of u2 is

    Du2f(1,2)=-2(2/5)+(-4)(-1/5)=0.

    Starting on the surface of f at (1,2) and moving in the direction of 2,-1 (or u2) 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.

  3. 3.

    At P=(1,2), the direction towards the origin is given by the vector -1,-2; the unit vector in this direction is u3=-1/5,-2/5. The directional derivative of f at P in the direction of the origin is

    Du3f(1,2)=-2(-1/5)+(-4)(-2/5)=10/5.

    Moving towards the origin means “walking uphill” quite steeply, with an initial slope of 25.

As we study directional derivatives, it will help to make an important connection between the unit vector u=u1,u2 that describes the direction and the partial derivatives fx and fy. We start with a definition and follow this with a Key Idea.

Definition 13.6.2      Gradient

Let z=f(x,y) be differentiable on an open set S that contains the point (x0,y0).

  1. 1.

    The gradient of f is f(x,y)=fx(x,y),fy(x,y).

  2. 2.

    The gradient of f at (x0,y0) is f(x0,y0)=fx(x0,y0),fy(x0,y0).

margin: Note: The symbol “” is named “nabla,” derived from the Greek name of a Jewish harp. Oddly enough, in mathematics the expression f is pronounced “del f.”

To simplify notation, we often express the gradient as f=fx,fy. It is often useful to think of the gradient as an operator:

=x,y.

The operator only has any meaning when it operates on a function; it doesn’t mean anything by itself. But this notation does help us to apply it correctly to find the gradient. The gradient allows us to compute directional derivatives in terms of a dot product.

Key Idea 13.6.1      The Gradient and Directional Derivatives

The directional derivative of z=f(x,y) in the direction of the unit vector u is

Duf=fu.

The properties of the dot product previously studied allow us to investigate the properties of the directional derivative. Given that the directional derivative gives the instantaneous rate of change of z when moving in the direction of u, three questions naturally arise:

  1. 1.

    In what direction(s) is the change in z the greatest (i.e., the “steepest uphill”)?

  2. 2.

    In what direction(s) is the change in z the least (i.e., the “steepest downhill”)?

  3. 3.

    In what direction(s) is there no change in z?

Using the key property of the dot product, we have

fu=fucosθ=fcosθ, (13.4)

where θ is the angle between the gradient and u. (Since u is a unit vector, u=1.) This equation allows us to answer the three questions stated previously.

  1. 1.

    Equation (13.4) 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.

  2. 2.

    Equation (13.4) 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.

  3. 3.

    Equation (13.4) 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.

This result is rather amazing. Once again imagine standing in a rolling meadow and face the direction that leads you steepest uphill. Then the direction that leads steepest downhill is directly behind you, and side-stepping either left or right (i.e., moving perpendicularly to the direction you face) does not change your elevation at all.

Recall that a level curve is defined as a curve in the x-y plane along which the z-values of a function do not change. Let a surface z=f(x,y) be given, and let’s represent one such level curve as a vector-valued function, r(t)=x(t),y(t). As the output of f does not change along this curve, f(x(t),y(t))=c for all t, for some constant c.

Since f is constant for all t, dfdt=0. By the Multivariable Chain Rule, we also know

dfdt =fx(x,y)x(t)+fy(x,y)y(t)
=fx(x,y),fy(x,y)x(t),y(t)
=fr(t)
=0.

This last equality states fr(t)=0: the gradient is orthogonal to the derivative of r. Our conclusion: at any point on a surface, the gradient at that point is orthogonal to the level curve that passes through that point.

We restate these ideas in a theorem, then use them in an example.

Theorem 13.6.2      The Gradient and Directional Derivatives

Let z=f(x,y) be differentiable on an open set S with gradient f, let P=(x0,y0) be a point in S and let u be a unit vector.

  1. 1.

    The maximum value of Duf(x0,y0) is f(x0,y0); the direction of maximal z increase is f(x0,y0).

  2. 2.

    The minimum value of Duf(x0,y0) is -f(x0,y0); the direction of minimal z increase is -f(x0,y0).

  3. 3.

    At P, f(x0,y0) is orthogonal to the level curve passing through (x0,y0,f(x0,y0)).

Example 13.6.2 Finding directions of maximal and minimal increase

Let f(x,y)=sinxcosy 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.

SolutionWe begin by finding the gradient. We see that fx=cosxcosy and fy=-sinxsiny, thus

f=cosxcosy,-sinxsinyand, at P,f(π3,π3)=14,-34.

Thus the direction of maximal increase is 1/4,-3/4. In this direction, the instantaneous rate of z change is 1/4,-3/4=10/4.

Figure 13.6.2 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 u=u1,u2 be the unit vector in the direction of f at P. Each graph of the figure also contains the vector u1,u2,f. This vector has a “run” of 1 (because in the x-y plane it moves 1 unit) and a “rise” of f, hence we can think of it as a vector with slope of f in the direction of f, helping us visualize how “steep” the surface is in its steepest direction.

margin: (a) (b) Figure 13.6.2: Graphing the surface and important directions in Example 13.6.2.

The direction of minimal increase is -1/4,3/4; in this direction the instantaneous rate of z change is -10/4.

Any direction orthogonal to f is a direction of no z change. We have two choices: the direction of 3,1 and the direction of -3,-1. The unit vector in the direction of 3,1 is shown in each graph of the figure as well. The level curve at z=3/4 is drawn: recall that along this curve the z-values do not change. Since 3,1 is a direction of no z-change, this vector is tangent to the level curve at P.

Example 13.6.3 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).

SolutionWe find f=-2x+2,-2y+2. At P, we have f(1,1)=0,0. According to Theorem 13.6.2, this is the direction of maximal increase. However, 0,0 is directionless; it has no displacement. And regardless of the unit vector u chosen, Duf=0.

margin: Figure 13.6.3: At the top of a paraboloid, all directional derivatives are 0.

Figure 13.6.3 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 0=0,0, as this indicates that all directional derivatives are 0.

The fact that the gradient of a surface always points in the direction of steepest increase/decrease is very useful, as illustrated in the following example.

Example 13.6.4 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?

SolutionLet r(t)=x(t),y(t) be the vector-valued function describing the path of the water in the x-y plane; we seek x(t) and y(t). 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 -f. (We ignore the physical effects of momentum on the water.) Thus r(t) will be parallel to f, and there is some constant c such that cf=r(t)=x(t),y(t).

We find f=-2x,-4y and write x(t) as dxdt and y(t) as dydt. Then

cf =x(t),y(t)
-2cx,-4cy =dxdt,dydt.

This implies

-2cx=dxdtand-4cy=dydt, i.e.,
c=-12xdxdtandc=-14ydydt.

As c equals both expressions, we have

12xdxdt=14ydydt.

To find an explicit relationship between x and y, we can integrate both sides with respect to t. Recall from our study of differentials that dxdtdt=dx. Thus:

12xdxdt𝑑t =14ydydt𝑑t
12x𝑑x =14y𝑑y
12ln|x| =14ln|y|+C1
2ln|x| =ln|y|+C1
ln|x2| =ln|y|+C1
Now raise both sides as a power of e:
x2 =eln|y|+C1
x2 =eln|y|eC1  (Note that eC1 is just a constant.)
x2 =yC2
1C2x2 =y  (Note that 1/C2 is just a constant.)
Cx2 =y.

As the water started at the point (1,1/4), we can solve for C:

C(1)2=14C=14.
margin: (a)

-4

-2

2

4

-2

2

x

y
(b)
Figure 13.6.4: A graph of the surface described in Example 13.6.4 along with the path in the x-y plane with the level curves.

Thus the water follows the curve y=x2/4 in the x-y plane. The surface and the path of the water is graphed in Figure 13.6.4(a). In part (b) of the figure, the level curves of the surface are plotted in the x-y plane, along with the curve y=x2/4. 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.

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 13.6.1 and 13.6.2 and Theorem 13.6.1 into one set of definitions.

Definition 13.6.3       Directional Derivatives and Gradient with Three Variables

Let w=F(x,y,z) be differentiable on an open ball B and let u be a unit vector in 3.

  1. 1.

    The gradient of F is F=Fx,Fy,Fz.

  2. 2.

    The gradient of F at (x0,y0,z0) is

    F(x0,y0,z0)=fx(x0,y0,z0),fy(x0,y0,z0),fz(x0,y0,z0).
  3. 3.

    The directional derivative of F in the direction of u is

    DuF=Fu.

The same properties of the gradient given in Theorem 13.6.2, when f is a function of two variables, hold for F, a function of three variables.

Theorem 13.6.3       The Gradient and Directional Derivatives with Three Variables

Let w=F(x,y,z) be differentiable on an open set S with gradient F, let P=(x0,y0,z0) be a point in S, and let u be a unit vector.

  1. 1.

    The maximum value of DuF(x0,y0,z0) is F(x0,y0,z0); the direction of maximal increase is F(x0,y0,z0).

  2. 2.

    The minimum value of DuF(x0,y0,z0) is -F(x0,y0,z0); the direction of minimal increase is -F(x0,y0,z0).

  3. 3.

    At P, DuF(x0,y0,z0)=0 when F(x0,y0,z0) and u are orthogonal.

We interpret the third statement of the theorem as “the gradient is orthogonal to level surfaces,” the three-variable analogue to level curves.

Example 13.6.5 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.

SolutionWe need the gradient I, meaning we need Ix, Iy and Iz. Each partial derivative requires a simple application of the Quotient Rule, giving

I =-2x(x2+y2+z2)2,-2y(x2+y2+z2)2,-2z(x2+y2+z2)2
I(2,5,3) =-41444,-101444,-61444
DuI =I(2,5,3)u
=-172166.

The directional derivative tells us that moving in the direction of u from P results in a slight decrease in intensity. (The intensity is decreasing as u moves one farther from the origin than P.)

The gradient gives the direction of greatest intensity increase. Notice that

I(2,5,3) =-41444,-101444,-61444
=21444-2,-5,-3.

That is, the gradient at (2,5,3) is pointing in the direction of -2,-5,-3, 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.

The directional derivative allows us to find the instantaneous rate of z change in any direction at a point. We can use these instantaneous rates of change to define lines and planes that are tangent to a surface at a point, which is the topic of the next section.

Exercises 13.6

 

Terms and Concepts

  1. 1.

    What is the difference between a directional derivative and a partial derivative?

  2. 2.

    For what u is Duf=fx?

  3. 3.

    For what u is Duf=fy?

  4. 4.

    The gradient is              to level curves.

  5. 5.

    The gradient points in the direction of              increase.

  6. 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.

Problems

In Exercises 7–12, a function z=f(x,y) is given. Find f.

  1. 7.

    f(x,y)=-x2y+xy2+xy

  2. 8.

    f(x,y)=sinxcosy

  3. 9.

    f(x,y)=1x2+y2+1

  4. 10.

    f(x,y)=-4x+3y

  5. 11.

    f(x,y)=x2+2y2-xy-7x

  6. 12.

    f(x,y)=x2y3-2x

In Exercises 13–18, a function z=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 712.

  1. 13.
    f(x,y)=-x2y+xy2+xy, P=(2,1) (a) In the direction of v=3,4 (b) In the direction toward the point Q=(1,-1).
  2. 14.
    f(x,y)=sinxcosy, P=(π4,π3) (a) In the direction of v=1,1. (b) In the direction toward the point Q=(0,0).
  3. 15.
    f(x,y)=1x2+y2+1, P=(1,1). (a) In the direction of v=1,-1. (b) In the direction toward the point Q=(-2,-2).
  4. 16.
    f(x,y)=-4x+3y, P=(5,2) (a) In the direction of v=3,1. (b) In the direction toward the point Q=(2,7).
  5. 17.
    f(x,y)=x2+2y2-xy-7x, P=(4,1) (a) In the direction of v=-2,5 (b) In the direction toward the point Q=(4,0).
  6. 18.
    f(x,y)=x2y3-2x, P=(1,1) (a) In the direction of v=3,3 (b) In the direction toward the point Q=(1,2).

In Exercises 19–24, a function z=f(x,y) and a point P are given.

  1. (a)

    Find the direction of maximal increase of f at P.

  2. (b)

    What is the maximal value of Duf at P?

  3. (c)

    Find the direction of minimal increase of f at P.

  4. (d)

    Give a direction u such that Duf=0 at P.

Note: these are the same functions and points as in Exercises 1318.

  1. 19.

    f(x,y)=-x2y+xy2+xy, P=(2,1)

  2. 20.

    f(x,y)=sinxcosy, P=(π4,π3)

  3. 21.

    f(x,y)=1x2+y2+1, P=(1,1).

  4. 22.

    f(x,y)=-4x+3y, P=(5,4).

  5. 23.

    f(x,y)=x2+2y2-xy-7x, P=(4,1)

  6. 24.

    f(x,y)=x2y3-2x, P=(1,1)

In Exercises 25–28, a function w=F(x,y,z), a vector v and a point P are given.

  1. (a)

    Find F(x,y,z).

  2. (b)

    Find DuF at P, where u is the unit vector in the direction of v.

  1. 25.

    F(x,y,z)=3x2z3+4xy-3z2, v=1,1,1, P=(3,2,1)

  2. 26.

    F(x,y,z)=sin(x)cos(y)ez, v=2,2,1, P=(0,0,0)

  3. 27.

    F(x,y,z)=x2y2-y2z2, v=-1,7,3, P=(1,0,-1)

  4. 28.

    F(x,y,z)=2x2+y2+z2, v=1,1,-2, P=(1,1,1)

In Exercises 29–30, a function w=F(x,y,z) and a point P are give. Find the direction of maximum increase and the maximal value of the directional derivative for F at P

  1. 29.

    F(x,y,z)=x2+y2-z2+xyz at P=(2,1,3)

  2. 30.

    F(x,y,z)=1x2+2y2+3z2 at P=(1,0,1)

Modern Campus CMS