Next: About this document ...
The purpose of this lab is to acquaint you with using Maple to compute
partial derivatives, directional derivatives, and the gradient.
To assist you, there is a worksheet associated with this lab that
contains examples. You can
copy that worksheet to your home directory with the following command,
which must be run in a terminal window, not in Maple.
cp ~bfarr/Pardiff_start.mws ~
You can copy the worksheet now, but you should read through the lab
before you load it into Maple. Once you have read to the exercises,
start up Maple, load
the worksheet Pardiff_start.mws, and go through it
carefully. Then you can start working on the exercises.
For a function of a single real variable, the derivative
gives information on whether the graph of is increasing or
decreasing. Finding where the derivative is zero was important in
finding extreme values. For a function of two (or more)
variables, the situation is more complicated.
A differentiable function, , of two variables has two partial
. As you have learned in class, computing partial derivatives is
very much like computing regular derivatives. The main difference is
that when you are computing
, you must treat
the variable as if it was a constant and vice-versa when computing
The Maple commands for computing partial derivatives are D
and diff. The Getting Started worksheet has examples
of how to use these commands to compute partial derivatives.
The partial derivatives
of can be thought of as the rate of change of in
the direction parallel to the and axes, respectively. The
is a unit vector, is the rate of change of in the
direction . There are several different ways that the
directional derivative can be computed. The method most often used
for hand calculation relies on the gradient, which will be described
below. It is also possible to simply use the definition
to compute the directional derivative. However, the following
computation, based on the definition, is often simpler to use.
One way to think about this that can be helpful in understanding
directional derivatives is to realize that
a straight line in the plane. The plane perpendicular to the
plane that contains this straight line intersects the surface in a curve whose coordinate is
. The derivative of
at is the rate of change of at
the point moving in the direction .
Maple doesn't have a simple command for computing directional
derivatives. There is a command in the tensor package that
can be used, but it is a little confusing unless you know something
about tensors. Fortunately, the method described above and the method
using the gradient described below are both easy to implement in
Maple. Examples are given in the Getting Started worksheet.
The gradient of , written , is most easily computed as
As described in the text, the gradient has several important
properties, including the following.
Maple has a fairly simple command grad in the linalg
package (which we used for curve computations). Examples of computing
gradients, using the gradient to compute directional derivatives, and
plotting the gradient field are all in the Getting Started
- Compute the three distinct second order partial derivatives of
You may use either the
D or diff commands or both, as you wish.
- In the last lab, you worked with the function
over the domain
represented the the deviation, in inches, of last year's rainfall
from the average annual rainfall
in a certain area. Compute the
directional derivative at the point in the direction of the vector
using each of the two methods
demonstrated in the Getting Started worksheet. Then, explain
why your answer is the same as the value of
evaluated at the point .
- Using the method from the Getting Started worksheet,
plot the gradient field and the contours of on the same
plot. Can you use the plot to explain the value you computed for the
directional derivative in the previous exercise? That is, can you
explain why the value of the directional derivative was positive,
negative or zero in terms of the contours and the gradient field?
Next: About this document ...
William W. Farr