Skip to main content

Section 6.1 Directional Derivatives

Firstly, note that 2D vectors are a convenient way to specify directions in the xy-plane. For example, we could say the slope of the function in the direction of the vector i=1,0 is fx(x0,y0) while in the direction of the vector j=0,1 it is fy(x0,y0). Thus the problem we are looking at is that of finding the slope of the function at the point (x,y)=(x0,y0) in the direction given by some vector u=u1,u2. Mathematically, we would say that we are trying to find the directional derivative of the function f(x,y) at the point (x0,y0) in the direction u. The notation that we use to denote this directional derivative is

Duf(x0,y0).

One way to approach the problem of finding the directional derivative Duf(x0,y0) is to use the tangent plane to the function at the point (x0,y0), i.e.

L(x,y)=f(x0,y0)+fx(x0,y0)(xx0)+fy(x0,y0)(yy0).

Then the slope of the function f(x,y) in the direction of u is the slope of L(x,y) in that direction. If u^=u1,u2 is a unit vector in the direction of u then the required slope is the amount by which the value of L changes as the independent variables change from (x0,y0) to (x0+u1,y0+u2), i.e.

Duf(x0,y0)=L(x0+u1,y0+u2)L(x0,y0)=[f(x0,y0)+fx(x0,y0)(x0+u1x0)+fy(x0,y0)(y0+u2y0)]f(x0,y0)=fx(x0,y0)u1+fy(x0,y0)u2

Consider the function z(x,y)=5x2+y22. Figure 6.1.2 shows the graph of this function along with its the tangent plane at (x,y)=(2,1). Also shown on the diagram are the vectors u=2,2 and v=2,1 drawn in the xy-plane with their tails at the point (x,y)=(2,1). Then the directional derivative Du(f(2,1)) will be the slope of the line joining the points (2,1,z(2,1)) and (4,3,L(4,3)) while the directional derivative Dv(f(2,1)) will be the slope of the line joining the points (2,1,z(2,1)) and (4,0,L(4,0)).

Figure 6.1.2.

To summarise:

Definition 6.1.3. Directional Derivative.

The directional derivative of the differentiable function f(x,y) at the point (x0,y0) in the direction of the unit vector u^=u1,u2 is given by

Du^f(x0,y0)=fx(x0,y0)u1+fy(x0,y0)u2.

Find the directional derivative of f(x,y)=yln(x) at (1,3) in the direction u=4,3.

Answer.

Du^f(1,3)=125.

Solution.

For the given function

fx=yx and fy=ln(x).

Thus

fx(1,3)=3 and fy(1,3)=0.

Now the unit vector in the direction of 4,3 is

u^=45,35.

Thus the required directional derivative is

Du^f(1,3)=(3)(45)+(0)(35)=125.

Find the directional derivative of f(x,y)=sin(x+2y) in the direction of the angle (from the positive x-axis) θ=3π4.

Answer.

Du^f(x,y)=12cos(x+2y)

Solution.

For the given function

fx=cos(x+2y) and fy=2cos(x+2y).

Now, the unit vector in the direction of the angle θ=3π4 is

u^=12,12.

Thus the required directional derivative is

Du^f(x,y)=cos(x+2y)(12)+2cos(x+2y)(12)=12cos(x+2y)

Note that the directional derivative Duf(x0,y0) can be expressed in the terms of the scalar product if we use the following definition.

Definition 6.1.6. Gradient Vector.

The vector

f(x0,y0)=fx(x0,y0),fy(x0,y0)

is called the gradient vector of f(x,y) at (x0,y0).

With this definition the directional derivative can be written as:

Duf(x0,y0)=fx(x0,y0),fy(x0,y0)u1,u2=f(x0,y0)u^

Find the gradient vector for the function f(x,y)=exsin(y). Hence find f(0,π/3) and the directional derivative in the direction of the origin.

Answer.

f=exsin(y),excos(y)

f(0,π/3)=32,12

Du^f(0,π3)=12.

Solution.

For the given function

fx=exsin(y) and fy=excos(y),

and so the gradient vector is

f=exsin(y),excos(y).

Thus

f(0,π/3)=e0sin(π3),e0cos(π3)=32,12.

Now, the unit vector in the direction of the origin from the point (0,π3) is

u^=0,1.

Thus the required directional derivative is

Du^f(0,π3)=32,120,1=12.

The gradient vector has some interesting facts associated with it. Note in the following we are assuming that f0,0.

  1. f points in the direction in which the directional derivative takes on its largest value. To see this, note that

    Duf(x,y)=f(x,y)u^=fu^cos(θ)=fcos(θ)

    At a given point f is fixed and so the largest value of Duf(x,y) will occur when cos(θ)=1, i.e. when θ=0 or put another way, when u^ is parallel to f. We can also see from this that the largest value that the directional derivative can take is f.

    Similarly, the directional derivative takes on its smallest value in the direction of f and has value f.

  2. f(x0,y0) is orthogonal (i.e. at right angles) to the level curve passing through (x0,y0).

    For the function z=f(x,y) the level curve passing through the point (x0,y0) is given by

    f(x,y)=f(x0,y0).

    Now, as shown in Figure 6.1.8, a vector parallel to the tangent to this curve at the point (x0,y0) will be 1,dydx.

    Figure 6.1.8.

    Thus a vector normal to the curve at the point (x0,y0) will be dydx,1. We will see subsequently, via implicit differentiation, that for the curve f(x,y)=k,

    dydx=fxfy

    and so a vector normal to the curve at the point (x0,y0) will be fx(x0,y0)fy(x0,y0),1, which is parallel to f(x0,y0).

    Notice that since f(x0,y0) is orthogonal to the level curve passing through the point (x0,y0) and that f(x0,y0) is the direction in which the directional derivative takes on its largest value, the “path of steepest ascent” on any surface z=f(x,y) is always at right angles to its contours. See the following diagram for an attempt to show this.

    Figure 6.1.9.

For the function f(x,y)=x2y33x find the directions in which the directional derivative at the point (2,4) is maximised, minimised and 0.

Answer.

Maximised in the direction u=259,192; minimised in the direction u=259,192; and 0 when u=192,259

Solution.

For the given function

fx=2xy33 and fy=3x2y2,

and so

f(2,4)=259,192.

Thus the directional derivative, Du^f(2,4), will be maximised in the direction

u=f(2,4)=259,192

and minimised in the direction

u=f(2,4)=259,192.

Finally Du^f(2,4) will be 0 when

f(2,4)u=0259u1+192u2=0

i.e. when

u=192,259

or some scalar multiple of this.

For the function f(x,y)=x2y find the level curve, the tangent line and the gradient vector at the point (3,1).

Answer.

The level curve is y=x28.

The tangent line is y=6x17.

The gradient vector is f(3,1)=6,1

Solution.

Since f(3,1)=8 the level curve through the point (3,1) is x2y=8 or y=x28. We can find the equation of the tangent by standard calculus to obtain

y=6x17.

Next, the gradient vector is

f(3,1)=fx(3,1),fy(3,1)=6,1.

As can be seen in the diagram below, the gradient vector is orthogonal to the level curve.

Figure 6.1.12.

Suppose you are climbing a hill whose shape is given by the equation

z=10000.01x20.02y2

and you are standing at the point with coordinates (60,100,764).

  1. In which direction should you proceed initially in order to be ascending most rapidly?

  2. If you climb in that direction, at what angle to the horizontal will you be climbing initially?

Answer.
  1. Head in the direction of f(60,100)=1.2,4.

  2. The angle to the horizontal will be θ=tan1(4.17)1.33c.

Solution.
  1. Since we want to travel on the path of steepest ascent we will want to head in the direction of f(60,100). Now

    f(x,y)=0.02x,0.04y
    and hence
    f(60,100)=1.2,4.

  2. In this direction we know that

    Du^f(60,100)=f(60,100)4.17.
    Thus the angle, θ, to the horizontal will be
    θ=tan1(4.17)1.33c.

Exercises Example Tasks

1.

Find the directional derivative for f(x,y)=(x2y)2+5x2 at the point (3,1) in the direction of the point (1,4).

2.

Find the maximum value of the rate of change of h(s,t)=1s2+t2 at (3,4).

3.

For the curve exln(y)xy=0 use the gradient vector of a two variable function to find the tangent line and the normal line at the point (2,e2).

4.

For the following contour plot for some unspecified function of two variables estimate the sign of the directional derivatives at:

Figure 6.1.14.
  1. The point A and in the direction of u=1,2.

  2. The point B and in the direction of w=1,1.

  3. The point A and in the direction of the origin.

  4. The point B and in the direction of the origin.