Mathematics 263                                  Laboratory 5                                      October 13, 1993
	  
Name: _____________________________   Lab Partner: ___________________________
	  
Consulted with:  ____________________________________________________________

Critical Points for Scalar Fields

In this lab we will  investigate scalar fields, using partial derivatives and the Plot3D command.

Part 1:  Partial Derivatives in Mathematica

Mathematica can compute partial derivatives as easily as it can ordinary derivatives.  Consider the function f(x, y) = sin(xy) + ex+y. Compute the first partial derivatives of this function by hand:

We can define this function in Mathematica:

f[x_,y_] := Sin[x y] + E^(x + y)

and compute the partial derivatives using the commands

D[f[x,y],x]

D[f[x,y],y]

Check that your partial derivatives match those computed by Mathematica. In the space below, compute the second order partial derivatives of f. Use the commands below to check your results against Mathematica.

D[f[x,y],{x,2}]

D[f[x,y],x,y]

D[f[x,y],{y,2}]

Finally use Mathematica to compute the third order partial derivatives of f.  Write your results below.  How many distinct third order derivatives does a function of two variables have? (Distinct means having different values; remember that fxy and fyx are not distinct.)

Part 2: Critical Points in Two Dimensions

Recall that in Calculus I we called a point on a function's graph where its derivative is 0 or failed to exist a critical point.  We call such points critical since local (or relative) maximum and minimum values of the function can only occur at such points.  We seek an analogue in more than one dimension.  The scalar field r(x, y) = 1 – x2 – y2 has only one local maximum, as we can tell by plotting its graph; where (in the domain) does the maximum of this function fall?

r[x_,y_] := 1 - x^2 - y^2

Plot3D[r[x,y],{x,-3,3},{y,-3,3},
      AxesLabel->{"x","y","z"},
      ViewPoint->{3.244, 0.813, 0.514}]

Notice on the graph there is one just point where the surface is higher than anywhere else (the maximum of the function). If we look at its first partial derivatives, they are zero at many more than one point. Describe the set of points where each of the first partials is zero below.

The set of all (x, y) for which rx(x, y) = 0 is:

The set of all (x, y) for which ry(x, y) = 0 is:

But the intersection of these two sets is one point, and it is the point giving r its maximum value.

The intersection of the two sets above is:

So we call points where all the first partial derivatives of a function are zero a critical point for that function. Of course, critical points are not always local extrema.  Consider the function
h(x, y) = (x – 2)3 – (y + 1)2, where is its critical point?  We can define the function and its derivatives as follows (Note that the derivatives don't have colons in their defining equal signs!):

h[x_,y_] := (x - 2)^3 - (y + 1)^2

hx[x_,y_] = D[h[x,y],x]

hy[x_,y_] = D[h[x,y],y]

At what point will both these derivatives be zero?  Plot a graph of this function that shows there is not a maximum or a minimum at this point.  Choose an appropriate view point, and explain in a sentence how you plot supports this contention.

Show that c(x, y) = x2 - 2y2 - 3xy has a critical point that is not a local minimum or maximum.  Find the critical point. Create a plot of the function that shows the critical point of this function is not an extremum, and describe on the same sheet (in a sentence or two) what happens at this critical point.

Part 3: Finding Critical Points

Sometimes it is hard to find the critical point(s) of a function.  Consider the function

We can use Mathematica to tame this awful looking function, and find its extreme value.  First we define the function in Mathematica:

p[x_,y_] := (1466 - 844*x + 156*x^2 + 1017*y -
             216*x*y + 219*y^2)/300

We can plot this function to see what it looks like:

Plot3D[p[x,y],{x,-3,3},{y,-3,3},
       AxesLabel->{"x","y","z"}]

Note that the function appears to have a minimum somewherein the domain shown in this plot. The partial derivatives are pretty ugly:

px[x_,y_] = D[p[x,y],x]

py[x_,y_] = D[p[x,y],y]

but Mathematica can easily find where they both equal zero:

critpt = Solve[{px[x,y]==0,py[x,y]==0},{x,y}]

We could get numerical approximations to the coordinates using the NSolve command:

ncritpt = NSolve[{px[x,y]==0,py[x,y]==0},{x,y}]

To find the corresponding value of the function, we can substitute these coordinates into p.

p[x,y] /. critpt (*exact value*)

p[x,y] /. ncritpt (*decimal approximation*)

From the plot we can see that this is the minimum value of p.

Find all the critical points of the function q given below. (There are three of them.) describe whether each critcal point is a minimum, maximum, or neither.  Give the  minimum or maximum value of q.