Absolute Extrema

Absolute Extrema
In beginning calculus, the domain of a function y = f(x) was defined by an interval such as 0 < x < 4. To check for
absolute extrema required the endpoints and the critical points into the function. For a three dimensional function, the
domain is a region of the xy plane. To determine the absolute extrema, the boundaries of the domain are substituted
into the function and the extrema determined.
Suppose we want to find the absolute extrema of the function z = x2 - y2 - x y - x + 8 y + 1 over the domain enclosed
by the semicircle y =
In[20]:=
16 - x2 and the line y = 1. First, examine the graph of the function over this domain.
z@x_, y_D := x2 - y2 - x y - x + 8 y + 1;
ü Initial Graph
A contour plot and a surface for the same function over the rectangular domain -4 § x § 4, 0 § y § 4 is shown below.
In[21]:=
Grid@88
ContourPlot@z@x, yD, 8x, - 4, 4<, 8y, 0, 4<,
ColorFunction Ø "TemperatureMap", Contours Ø 25, ImageSize Ø 300D,
Plot3D@z@x, yD, 8x, - 4, 4<, 8y, 0, 4<,
BoxRatios Ø 82, 1, 3<,
ColorFunction Ø "TemperatureMap",
MeshFunctions -> 8Ò3 &<, Mesh Ø 25, ImageSize Ø 300D<<D
Out[21]=
ü Refine the Graph
Using the RegionFunction option, we can restrict the domain to a portion of the circle.
2
absoluteextrema.nb
In[22]:=
GridB::
ContourPlotBz@x, yD, 8x, - 4, 4<, 8y, 0, 4<,
ColorFunction Ø "TemperatureMap", Contours Ø 25,
ImageSize Ø 300, RegionFunction Ø FunctionB8x, y, z<, y ¥ 1 && y §
16 - x2 FF,
Plot3DBz@x, yD, 8x, - 4, 4<, 8y, 0, 4<,
BoxRatios Ø 82, 1, 3<,
ColorFunction Ø "TemperatureMap",
MeshFunctions -> 8Ò3 &<, Mesh Ø 25, ImageSize Ø 300,
RegionFunction Ø FunctionB8x, y, z<, y ¥ 1 && y §
16 - x2 FF>>F
Out[22]=
Critical Points
To find the location and type of the critical points, set the first derivatives equal to zero and use the second derivative
test.
In[23]:=
Out[23]=
p1 = Solve@8D@z@x, yD, xD ã 0, D@z@x, yD, yD ã 0<, 8x, y<D
88x Ø 2, y Ø 3<<
2
The second derivative test uses zxx zyy - Izxy M . Plugging our critical point into this formula
In[24]:=
Out[24]=
D@z@x, yD, x, xD * D@z@x, yD, y, yD - HD@z@x, yD, x, yDL2 ê. 8x, y< -> p1
-5
absoluteextrema.nb
gives a negative result so p1 is a saddle point.
Plugging p1 into the original function determines the z value.
In[25]:=
Out[25]=
localpt = 8x, y, z@x, yD< ê. p1
882, 3, 12<<
Check the Boundaries
To check for absolute extrema, substitute each part of the boundary into the original equation.
ü Along the First Boundary
In[26]:=
y1@x_D := 1;
b1@x_D := z@x, y1@xDD;
PlotBb1@xD, :x, -
15 ,
15 >F
30
25
20
Out[28]=
15
10
-4
In[29]:=
Out[29]=
In[30]:=
Out[30]=
In[31]:=
Out[31]=
-2
2
4
critpt1 = Solve@b1 '@xD ã 0, xD
88x Ø 1<<
firstset = ::-
15 , 1,
15 , critpt1@@1, 1, 2DD,
15 >
15 >
tab1 = Table@8firstset@@iDD êê N, y1@firstset@@iDDD, z@firstset@@iDD, 1D êê N<,
8i, 1, Length@firstsetD<D
88- 3.87298, 1, 30.746<, 81., 1, 7.<, 83.87298, 1, 15.254<<
ü Along the second bondary
Next, use the boundary y =
16 - x2 .
3
4
absoluteextrema.nb
In[32]:=
y2@x_D :=
16 - x2 ;
b2@x_D := z@x, y2@xDD;
PlotBb2@xD, :x, -
15 ,
15 >, AxesOrigin Ø 80, 0<F
35
30
25
20
Out[34]=
15
10
5
-4
In[35]:=
Out[35]=
In[36]:=
Out[36]=
In[37]:=
Out[37]=
-2
2
4
critpt2 = NSolve@b2 '@xD ã 0, xD
88x Ø 3.80685<, 8x Ø - 3.29755<, 8x Ø 1.97477<<
secondset = 8critpt2@@2, 1, 2DD, critpt2@@3, 1, 2DD, critpt2@@1, 1, 2DD<
8- 3.29755, 1.97477, 3.80685<
tab2 = Table@8secondset@@iDD, y2@secondset@@iDDD, z@secondset@@iDD, y2@secondset@@iDDDD<,
8i, 1, Length@secondsetD<D
88- 3.29755, 2.2641, 35.624<, 81.97477, 3.47855, 11.7837<, 83.80685, 1.22795, 15.3264<<
Put the results together
Putting the local point and the two set of boundary points together, we have the following table.
In[38]:=
TableFormBJoin@localpt, tab1, tab2D,
TableHeadings Ø ::"saddle point", "corner", "along y=1", "corner",
16 - x2 ", "along y=
"along y=
16 - x2 ", "along y=
16 - x2 ">, 8x, y, z<>F
Out[38]//TableForm=
saddle point
corner
along y=1
corner
x
2
- 3.87298
1.
3.87298
y
3
1
1
1
z
12
30.746
7.
15.254
along y=
16 - x2
- 3.29755
2.2641
35.624
along y=
16 - x
2
1.97477
3.47855
11.7837
along y=
16 - x2
3.80685
1.22795
15.3264
From this table, we can pick out that the absolute maximum point is at H-3.29755, 2.2641, 35.624L and the absolute
minimum point is at H1, 1, 7L.