Applications of the Gradient

A. Errors

First of all, we mention the use of the total differential to estimate the error in a quantity computed from quantities in which the error is known. For instance, the gravitational attraction between masses m 1 , m 2 at distance r is given by

m 1 m 2 r 2 = f ( m 1 , m 2 , r )

We might ask: If we have found m 1 and m 2 each to be 1000  grams ± .01  g. and r = 10  cm. ± .001  cm. , then how large an error can result in calculating the force, using these numbers? Since we are only interested in an estimate, we neglect the error term in the expression for d f and find

\begin{aligned} df &= \frac{m_2}{r^2} dm_1 + \frac{m_1}{r^2} dm_2 - \frac{2m_1 m_2}{r^3} dr \\ &= \frac{10^3}{10^2} dm_1 + \frac{10^3}{10^2} dm_2 - \frac{2 \cdot 10^6}{10^3} dr \cdot \end{aligned}

The absolute value of this is greatest when d m 1 = + .01 = d m 2 , d r = .001 . Then we have

d f = 10 ( .01 ) + 10 ( .01 ) + 2 10 3 ( .001 ) = 2.2

Thus our estimate of the maximum error in the force is ± 2.2 dynes.

B. Maxima and Minima

We can make a simple test for relative maxima and minima of functions of several variables. We shall speak in terms of functions of two variables, but the extension to functions of more variables will be clear. A point ( x 0 , y 0 ) is called a relative maximum of f ( x , y ) if there is a neighborhood of ( x 0 , y 0 ) such that for all points ( x , y ) of this neighborhood,

f ( x , y ) f ( x 0 , y 0 )

A relative minimum is similarly defined. Assume that f x and f y exist at the relative maximum ( x 0 , y 0 ) . Then the function g ( x ) = f ( x , y 0 ) has a relative maximum at x 0 , so g'(x_0) = f_x(x_0, y_0) = 0. Likewise, h ( y ) = f ( x 0 , y ) has a relative maximum at y 0 , so h'(y_0) = f_y(x_0, y_0) = 0. Thus we conclude:

Theorem 1

If f ( x , y ) has a relative maximum or minimum at ( x 0 , y 0 ) , then

f x ( x 0 , y 0 ) = 0 = f y ( x 0 , y 0 )

The converse is no more true than in the case of functions of one variable. There are higher derivative tests as before, but we shall not discuss them here.

C. Tangent Planes and Normal Lines to Surfaces

Next consider the set of points ( x , y , z ) such that f ( x , y , z ) = c , where c is some constant and f ( x , y , z ) has continuous first derivatives. Such a set of points is called a level surface for the function f ( x , y , z ) . It is completely analogous to the level curves for the functions f ( x , y ) of two variables which we used in drawing our contour maps. A particular case of a level surface is the "graph" of a function g ( x , y ) of two variables. The points we plot in this case are the points ( x , y , g ( x , y ) ) , and these are exactly the level surface f ( x , y , z ) = 0 where

f ( x , y , z ) = z g ( x , y )

An example which is not of this type is the sphere of radius 5 about the origin, which is the level surface

x 2 + y 2 + z 2 = 25

We wish to find the normal line and tangent plane to such a surface at a point ( x 0 , y 0 , z 0 ) of the surface. If we can find a vector perpendicular, in some sense, to the surface at ( x 0 , y 0 , z 0 ) , then we shall be done. For this will be a vector A parallel to the normal line and perpendicular to the tangent plane. What we shall show is that grad f, evaluated at ( x 0 , y 0 , z 0 ) , is such a vector A .

But what is it to mean for a vector to be perpendicular to the surface at ( x 0 , y 0 , z 0 ) ? If we knew there were lines on the surface through ( x 0 , y 0 , z 0 ) , we might say that the vector should be perpendicular to all such lines. But there are no lines on the sphere, for instance; so we next try to find a vector perpendicular at ( x 0 , y 0 , z 0 ) to all curves on the surface passing through ( x 0 , y 0 , z 0 ) . Therefore let X ( t ) = ( x ( t ) , y ( t ) , z ( t ) ) be a curve on the surface, and let ( x 0 , y 0 , z 0 ) = X ( t 0 ) . Since the curve lies on the surface, we know that

f ( x ( t ) , y ( t ) , z ( t ) ) = c for all  t

Therefore

d d t ( f ( x ( t ) , y ( t ) , z ( t ) ) ) = d c d t = 0

But we have seen that

\frac{d}{dt} (f(x(t), y(t), z(t))) = (\text{grad } f) \cdot X'(t),

so

(\text{grad } f) \cdot X'(t) = 0 \cdot

In particular,

((\text{grad } f)(x_0, y_0, z_0)) \cdot X'(t_0) = 0 \cdot

But X'(t_0) is a vector parallel to the tangent to the curve X ( t ) at t = t 0 . Since ( grad  f ) ( x 0 , y 0 , z 0 ) is perpendicular to X'(t_0), it is perpendicular to the tangent to the curve at t 0 , and this is true for any curve on the surface passing through ( x 0 , y 0 , z 0 ) . Thus ( grad  f ) ( x 0 , y 0 , z 0 ) is the desired vector A . This gives a geometric interpretation to the direction of grad f: grad f, evaluated at ( x 0 , y 0 , z 0 ) , is perpendicular to the level surface f ( x , y , z ) = f ( x 0 , y 0 , z 0 ) at the point ( x 0 , y 0 , z 0 ) . We shall give an interpretation of its length in the next paragraph.

D. Directional derivative

Let f ( x , y , z ) be a function of three variables (although n variables would do as well). Let A = ( a 1 , a 2 , a 3 ) be a given non-zero vector, and let X 0 = ( x 0 , y 0 , z 0 ) be a given point. When we find f x , f y , f z at X 0 , we are finding the rates of change of f with respect to distance traveled from the point X 0 in one of the three directions parallel to the respective axes. Now suppose instead that we locate the vector A with the point X 0 as initial point and travel along A , or in other words, we travel from X 0 in the same direction as A , and we wish to measure the rate of change of f with respect to distance traveled. If we go from X 0 to X 0 + d X , the "average rate" will be

f ( x 0 + d x , y 0 + d y , z 0 + d z ) f ( x 0 , y 0 , z 0 ) | d X |

Now the vector d X = ( X 0 + d X ) X 0 is to have the same direction as A , so d X = h A for some h > 0 . Therefore | d X | = h | A | . Moreover,

f ( x 0 + d x , y 0 + d y , z 0 + d z ) f ( x 0 , y 0 , z 0 ) = ( grad  f ) d X + error ,

where

error | d X | 0 as  | d X | 0

The "instantaneous rate", which we call the directional derivative of f ( x , y , z ) at X 0 in the direction of A , will be the limit as | d X | 0 of the average rate, or since | d X | 0 means the same as h 0 ,

lim h 0 ( grad  f ) h A h | A | + error h | A |

But we have seen that the second term goes to zero, and the first is simply

( grad  f ) A | A |

This result gives us a simple formula for finding the directional derivative.

Now observe that if θ is the angle between A and grad f, then ( grad  f ) A = | grad  f | | A | cos θ , or the directional derivative is simply | grad  f | cos θ . This is of course largest when cos θ = 1 , i.e., when A has the same direction as grad f, and in that case it is just | grad  f | . Thus we have our interpretation for | grad  f | : It is the maximum value for the directional derivative of f in any direction. Note also that the minimum value for the directional derivative of f occurs when the direction is opposite to that of grad f, and that this minimum value is | grad  f | .

EXERCISES

Exercise 1.

Investigate the following functions for relative maxima and minima:
a) f ( x , y , z ) = 3 x 2 y 2 z 2
b) f ( x , y ) = 1 2 ( x 2 + y 2 )
c) f ( x , y ) = 1 2 ( x 2 y 2 )

Exercise 2.

Let f ( x , y , z ) = z e x sin y , P = ( log 3 , 3 π 2 , 3 ) .
Find:
a) grad f at P;
b) the normal line at P to the level surface for f which passes through P ;
c) the tangent plane to this surface at P ;
d) the directional derivative of f at P in the direction of the vector ( 1 , 2 , 2 ) .
e) the maximum and minimum values for the directional derivative of f at P .

Exercise 3.

Consider the formula for kinetic energy: K = 1 2 m v 2 . Suppose that m is found to be 20  grams , with a maximum error of ± .01  gram , and v is found to be 100  cm/sec , with a maximum error of ± 2  cm/sec . Estimate the maximum error resulting in the computation of the kinetic energy, as well as the percentage error in K .

Exercise 4.

Show that f ( x , y , z ) is a constant if and only if grad f = 0 .