Class Example 3

p1=Plot3D[x*y^2,{x,0,1},{y,0,1},RegionFunction->Function[{x,y,z},x^2+y^2<1]];
p2=Plot3D[x*y^2,{x,0,1},{y,-1,0},RegionFunction->Function[{x,y,z},y-x>-1]];
p3=Show[p1,p2,PlotRange->All,AxesLabel->{"X","Y","f(X,Y)"}]

By rotating and examining this plot, you should be able to see the function’s behavior both inside the region R and on all of its three boundary sections. For example, rotate the plot so that the 3rd section, which is the segment [0<=x<=1, y=x-1], faces you.  Experiment with it until you see that on it, the function looks like the graph shown below (but perhaps a little squashed):

p4=Plot[x*(x-1)^2,{x,0,1}]

This graph is that of  f(x,y=x-1), which is the expression for the values of the function  f(x,y)  on that boundary, as we have found in class.

You may see the role of the critical point  x=1/3  of the function G(x)=x(((x-1))^2) by placing that point on the above 2D graph:

p5=Graphics[{PointSize[0.03],Green,Point[{1/3,4/27}]}];
Show[p4,p5,PlotRange->All]

It is helpful to view the 3D graph of f(x,y) with the critical points on both the 2nd and 3rd boundary sections together superimposed on the function graph:

p6=Graphics3D[{PointSize[0.04],Red,Point[{{1/3,-2/3,4/27},   {Sqrt[1/3],Sqrt[2/3],Sqrt[4/27]}}]}];

Show[p3,p6]

Which of these two points was found to be the absolute maximum? 
What is the absolute minimum of the function in that region? (Consult the example if you cannot see the answer from the plot.)

Finally, it is also helpful to view the contour plot of f(x,y) in region R. Since R consists of two distinct subregions, a quarter-circle and a triangle, we will have to make that contour plot in two steps, just as we did it with the 3D plots above:

cp1=ContourPlot[x*y^2,{x,0,1},{y,0,1},RegionFunction->Function[{x,y,z},x^2+y^2<1], Contours->30];
cp2=ContourPlot[x*y^2,{x,0,1},{y,-1,0},RegionFunction->Function[{x,y,z},y-x>-1], Contours->30];
cp3=Show[cp1,cp2,PlotRange->All]

See if you can identify the absolute extrema from this contour plot, using the skills you gained in Lab 4.

Sec. 14.7, # 35  (8th Edition)

q1=Plot3D[x^2+2y^2-2*x-4*y+1,{x,0,2},{y,0,3},AxesLabel->{"X","Y","f(x,y)"}]

This is the function from one of the non-WebAssign homework problems (in your WebAssign assignment, you have other functions with similar behavior). Examine the plot to get an idea of where you should expect to find its absolute maximum and minimum values.

Note:
Even though such an inspection may entice you to check only those points which you have identified from the graph as the likely candidates for the absolute extrema, I strongly recommend that you do the complete analysis as shown in class with Example 3. 
The reason is simple: A shortcut may save you time and give you correct answers for WebAssign, but not mastering the method will hurt you big-time on a quiz and a test, because there I will grade your work, not your answers.

Here are the plots of the function along two different sections of the boundary of the rectangle.

Plot[2y^2-4y,{y,0,3}]

Plot[x^2-2x+5,{x,0,2}]

You should identify which sections these are by comparing these two 2D plots with the full 3D plot. 

Finally, I have added two points to the 3D graph. Their coordinates are chosen at random. When you determine the locations and values of the absolute minimum and maximum, change those coordinates accordingly and make sure that the two points end up on the surface. (Reminder: Your WebAssign answers may be slightly different.)

absmin = Graphics3D[{PointSize[0.04],Point[{1,2,3}]}];
absmax = Graphics3D[{PointSize[0.04],Green,Point[{2,1,0}]}];
Show[q1,absmin,absmax,PlotRange->All]

You may also use the contour plots to see if it shows the absolute extrema  that you have found by calculation. Note that since the region here is a simple rectangle, then the ContourPlot command will  not  need to use the RegionFunction->Function option, as in the Example at the beginning of this notebook.

You are encouraged to use this notebook to visualize other related homework problems in a similar way.

Sec. 14.7, # 37 (8th Edition)

r1=Plot3D[2x^3+y^4,{x,-1,1},{y,-1,1},RegionFunction->Function[{x,y,z},x^2+y^2<1]]

Plot the value of the function along the boundary to eyeball the locations of its extrema.

Plot[ ...  ,{t,... }]

Finally, when you have determined the coordinates of the absolute extrema, put them into the commands below to verify your work:

absmin = Graphics3D[{PointSize[0.04],Point[{1,2,3}]}];
absmax = Graphics3D[{PointSize[0.04],Green,Point[{3,2,1}]}];
Show[r1,absmin,absmax,PlotRange->All]

Use the contour plots to see if it shows the absolute extrema  that you have found by calculation. Here you will again need to use the RegionFunction->Function option, as in the Example at the beginning of this notebook.