Set up. Start by opening Maple, and entering the command
with(plots);Look at all the function names this gives you! Recall that in Maple you can get help with a command like plot3d by entering
? plot3dat the command. Consider the familiar function f(x,y)=x^2+y^2. What do you expect the graph of f to look like?
Graphs. Draw a sketch for -3< x < 3 and -5< y< 5 by hand. Recall that you can graph f in Maple for x in [-3,3] and y in [-5,5] by using the command
plot3d(x^2+y^2,x=-3..3, y=-5..5);Do this. Does the Maple graph look like your sketch? Make sure you can explain any differences.
Level Sets. Draw a sketch of the level sets of f. Maple will also draw the level sets of the function f if you enter the command
contourplot(x^2+y^2,x=-3..3, y=-5..5);For this command to operate, you must have entered with(plots); above; if contourplot doesn't return a contour plot, check that command first. This contourplot is blank near the origin. You can tell Maple which contours to draw by specifying them explicitly by the command
contourplot(x^2+y^2,x=-3..3, y=-5..5,contours=[.5,1,1.5,2,2.5,3,3.5,4]);Does this controurplot have the same domain as your previous one? Are these the contours you were expecting from your sketch? Make sure you can explain any differences! Maple can also locate the contours at the height corresponding to the contour (the level set corresponding to f(x,y)=5 will be graphed at height 5) by the command
contourplot3d(x^2+y^2,x=-3..3, y=-5..5);
Extremal Values I. The function f has maximum and minimum value on the domain x in [-3,3] and y in [-5,5]. You know several methods to find the max and min values.
1. You can use your knowledge of the shape of the graph of the function f.
2. You can find critical points of f. You can then evaluate if the critical points are local maxima, local minima, or neither by analyzing the Hessian. If you are in search of a global maximum or minimum, you also find the maximum and minimum values of f on the boundary of the domain. You compare the maxima and minima from the boundary to those from the inside to find global maxima and minima.
3. You graph the function using Maple on the appropriate domain, and look at the graphs and contour plots.
Extremal Values II. Maple can also help you with the calculus of finding maxima and minima. We will need to use linear algebra functions, so load them into Maple by the command
with(linalg);What functions do you get with a familiar name with this command? Maple can calculate the gradient of the function f by the command
grad(x^2+y^2, vector([x,y]));Notice that the command above allows us to declare which letters are variables. Compare what happens when you enter
grad(x^2+z*y^2, vector([x,y]));If instead you wanted a graph of the gradient, enter
gradplot(x^2+y^2,x=-3..3,y=-5..5);How do you expect the gradient to relate to the level sets? Is that what Maple gave you? In order to solve for where grad(f)=0, we can use Maple's equation solving skills. If we want to solve the equations 2x=0 and 2y=0 so that grad(f)=(0,0), enter
solve({2*x=0,2*y=0})What did you get? What happens if you ask Maple to solve
solve({2*x=0,2*y^2=1}); ?How about
solve(x^2*y=1,{x}); ?Now that you have the critical points, its time to evaluate the Hessian! Maple calculates the Hessian with the command
hessian(x^2+y^2,[x,y]);You can get it to evaluate the previous line at x=0,y=0 by entering
eval(%,[x=0,y=0]);and then calculate the determinant by
det(%)
1. Print out the text above, do what you're told to do, and answer the questions.
2. For each of the following functions, find all critical points. Use the Hessian to determine if each critical point is a local maximum, a local minimum, or a saddle. Show enough work to explain your answer -- either yours work or Maple's. Generate a Maple graph, contourplot, or both, to show behavior of the function near the critical point(s).
a. (y-8x^2)(y-x^2)
b. 4x+3y+exp(-x^2-y^2-2x-3y)
c. (x^2+4y^2)exp(1-x^2-y^2)
d. sin(xy)
3. Find the maximum or minimum values (if they exist) of the functions in the preceding question on the domain R^2.
4.Find the maximum and minimum values (they exist! why?) of 4x+3y+exp(-x^2-y^2-2x-3y) on the set x in [-100,100] and y in [-100,100].
5. Find the points on the surface x^2+(y/2)^2+(z/9)^2=1 that are closest to the point (2,2,3).