> # MAXIMUM AND MINIMUM VALUES # # We look for the critical points of several functions # of two variables. # > with(plots): # # First function. This function has one critical point, # a local minimum. > f:=x^2+y^2; 2 2 f := x + y > plot3d(f,x=-2..2,y=-2..2,color=red); > contourplot(f,x=-2..2,y=-2..2,color=red); > # Second function: This function has a saddle point. > g:=x^2-y^2; 2 2 g := x - y > plot3d(g,x=-2..2,y=-2..2,color=red); > contourplot(g,x=-2..2,y=-2..2,color=red); > # Third function. This function has local maximum and # local minima. # > h:=(x^2-4)^2+6*y^2; 2 2 2 h := (x - 4) + 6 y > plot3d(h,x=-3..3,y=-2..2,color=red); > contourplot(h,x=-3..3,y=-2..2,color=red); > # Fourth function. We look at this function on a limited domain. # It achieves its absolute maximum on the boundary of the domain. # > q:=x^2+2*x*y-y; 2 q := x + 2 x y - y > plot3d(q,x=-2..2,y=-2..2,color=red); > contourplot(q,x=-2..2,y=-2..2,color=red); >