Directional Derivatives
Math 211  Prof. Leise

Email completed labs to tleise@amherst.edu by noon next Wednesday.

Material for this week’s lab was adapted from a lab by Prof Jonathan Rogness at the University of Minnesota.

The goal of this lab is to interpret partial derivatives as steepness of a surface in the x- and y-directions and to relate this with the idea of directional derivative, which tells us the steepness of the surface in any desired direction.  

Recall that if you're standing at a point on a surface z=f(x,y), where you visualize the surface as some terrain, then partial derivative of f with respect to x tells you how steep the surface is in the positive x-direction at that point.  If it's positive, then the surface goes "uphill" in that direction.  If it's negative, then the surface goes "downhill."  The partial derivative with respect to y tells you the same sort of information about what's happening in the positive y-direction.

What about other directions?  If you're a mountain climber on a 24,000ft mountain (the surface of which could be the graph of a function), you want to know what's going on in more than just the positive x- and y-direction.  

(Let's think of the x- and y-directions as east and north, respectively; imagine you're looking down at the xy-plane, and think of the axes as lying on a compass.  The x-axis points east, to the right, and the y-axis points up, to the north.)

Back on the mountain you're climbing, you want to know: what about northeast?  Or south-southwest?  Or any of the infinitely many directions in between?  That's where the directional derivative comes in.  It can tell you how steep a surface is in any given direction, and whether that "steepness" goes up or down.

Take a look at the following graph, which could represent a mountain and a valley, side-by-side in an otherwise nearly flat plain.

f[x_,y_]=2 y (E^(-(x^2)-(y^2)))
Plot3D[f[x,y],{x,-1,3},{y,-2,2}]

Look at a point like (1,0,0) near the middle of the graph.  A mountain climber at that point on the surface could walk either uphill or downhill -- or even along a path which remains flat.

There are two ways to calculate the directional derivative: directly using the limit definition or by taking the dot product of the gradient with the unit vector representing the direction (which is usually the easier way to calculate it and what we’ll use here).

Remember that moving in the direction of the gradient takes you on the steepest possible path uphill, while moving perpendicular to the gradient follows level curves (contours) of the surface along which the height does not change.

Gradient vectors and level curves of f(x, y):

Exercise 1. Find the gradient of the function f(x, y) given above, at the point (1, 0, 0).

Exercise 2. Calculate the directional derivative of f(x, y) at (1,0,0) in the following directions (remember to convert to unit vectors):
(a) v = i + j  (northeast)
(b) v = -i      (west)
(c) v = j       (north)
(d) v = -i - j   (southwest)

Exercise 3. Plot the graph of the function f(x, y) = x^2-y^2 for -2<x<2 and -2<y<2.

Exercise 4. Plot level curves of the function f(x, y) = x^2-y^2 using ContourPlot over the same domain.

Exercise 5. For the surface z = x^2-y^2 at the point (0,1,-1):
(a) In what direction(s) does the directional derivative take its maximum value? What is that maximum value?
(b) In what direction(s) does the directional derivative take its minimum value?
(c) In what direction(s) does the directional derivative equal 0? 
(d) In what direction(s) does the directional derivative equal half of its maximum value?