Mathematics 263                                          Laboratory 6                               October 20, 1993
	  
Name: _____________________________   Lab Partner: ___________________________
	  
Consulted with:  ____________________________________________________________

The Gradient

In this laboratory, we introduce the gradient, a vector composed of partial derivatives.

Part 1: Directional Derivatives (No Computer)

Recall that the directional derivative of f (x, y) in the direction of a unit vector u at a point (a, b) is the rate of change of the value of f (x, y) as (x, y) moves away from (a, b) in the direction of u.  We use the notation  Du f (a, b).  In lecture last time we showed that, if u = u1i + u2j, then

The vector fx(a, b)i + fy(a, b)j is called the gradient of f, denoted by —f (a, b).

Recall that the dot product of two vectors is defined by v◊w = ||v|| ||w|| cosq. Use this definition to answer the following questions.

Which unit vector u gives the largest possible Du f (a, b)?

Which unit vector u gives the most negative ("smallest") Du f (a, b)?

A unit vector u that has Du f (a, b) = 0 must be related in what way to —f (a, b)?

In the remainder of this lab you will use Mathematica to investigate the gradient graphically.

Part 2:  A Simple Example

Consider the function that measures the distance from a point (x, y) in the plane to the origin:

Compute the gradient of this function, and write your answer below.  (You may perform the calculations in Mathematica or by hand, whichever is more convenient.)

—f (x, y) =

Suppose we are at a point (x, y) and we wish to increase our distance from the origin as quickly as possible.  Which way does common sense tell us we should walk?

Based on your answer above, the gradient —f (a, b) should be parallel to what vector?

We can use Mathematica to illustrate this idea.  First load the package PlotField by entering the command

<<Graphics`PlotField`

Now insert the gradient of f into the command below and enter it to have Mathematica draw the gradient vectors for selected points in the range. (This may take a minute or two on the old computers, and don't worry if you get four error messages--two "infinite expressions" and two "indeterminate expressions".)

fgrad = PlotVectorField[{x/f[x,y],y/f[x,y]},
                {x, -2, 2}, {y, -2, 2}]

Notice that every gradient vector points directly away from the origin.  Explain the relationship between this fact and your answers to the first two questions in this part of the lab.

Explain what it would mean if all the gradient vectors pointed in, towards a point (a, b) instead of out, away from the point.

Part 3:  Gradients and Level Curves

We continue to consider the function f (x, y) defined in part 2.  Suppose we are at a point (a, b) in the xy-plane ant we want to move in such a way that our distance from the origin doesn't change at all. Which way does common sense tell us we should walk?

What does your answer have to do with the level curves of f ?

This is related to the gradient of f as well.  To discover the relationship, first recall that at any given point on a curve, the "direction" of the curve is is given by the direction vector of the tangent line. (Remember the derivatives of vector-valued functions?)  So, how are the direction vectors of the tangent lines to level curves related to the gradient?

Just as the slopes of perpendicular lines are negative reciprocals, the direction vectors for perpendicular lines have the components switched with one of them made negative.  That is, the vectors ai + bj and bi – aj are always perpendicular.  Write a vector (function of x and y) that will always be orthogonal to —f (x, y) below.

Make a copy of the PlotVectorField command in part 2, and put the vector you defined above into the command; enter the new command.

How are the vectors in this new plot related to the level curves of f ?

Part 4:  Some Examples

1)  The function g(x, y) = 5 – (x – y)2 has what maximum value?

Where in the domain does the maximum occur?

How is this reflected in a plot of the vector field —g(x, y)?

2)  The function k(x, y) = x3 + 4y3 – 3x2 – 9x – 12y has a relative maximum and a relative minimum within four units of the origin.  Estimate the coordinates of the points in the domain where these occur by zooming in on likely looking points using plots of the gradient.  Support your estimates by printing out plots of the gradient nearby. (Plot3D may help you get started.)