15.7 Maximum and Minimum Values
Example1
Find the local maxima and minima off(x,y) = (x^2)y - 2 x y + 2(y^2)-15y.

Solution:

f = (x^2)y - 2 x y + 2(y^2)-15y;

The first and second partial derivatives are:

D[f,x]

D[f,y]

D[f,x,x]

D[f,y,y]

D[f,x,y]

The crititcal points are:

cps = Solve[{D[f,x] == 0, D[f,y]==0}]

Next we apply the Second Derivative Test at the criticial points.

d = D[f,x,x]D[f,y,y]-D[f,x,y]^2

Plug the critical points into d:

d /. cps

D[f,x,x] /. cps

f /. cps

Since d(-3,0) =-64 < 0and d(5,0) =-64< 0, the graph of f curves in different directions at each of these points and thus f has saddle points at (-3,0) and (5,0).
Since d(1,4)= 32>0and (Subscript[f, xx])(1,4) = 8 > 0, the graph of f is curved up in all d irections at (1,4) and therefore has a local mininum there, f(1,4) = -32.

Plot3D[f,{x,-5,7},{y,-5,10}, BoxRatios->{1,1,2},AxesLabel->{x,y,z}]

Example2
Find the local maxima and minima off(x,y) = (x^3)- 6(x^2)-3(y^2).
Solution:

f =(x^3)- 6(x^2)-3(y^2);

The first and second partial derivatives are:

D[f,x]

D[f,y]

D[f,x,x]

D[f,y,y]

D[f,x,y]

The crititcal points are:

cps = Solve[{D[f,x] == 0, D[f,y]==0}]

we apply the Second Derivative Test at the criticial points.

d = D[f,x,x]D[f,y,y]-D[f,x,y]^2

Plug the critical points into d:

d /. cps

D[f,x,x] /. cps

f /. cps

Since d(0,0) =72 > 0, and (Subscript[f, xx])(0,0) =- 12 < 0, the graph of f curves down in all directions at this point and thus f has a local maximum at (0,0).
Since d(4,0)= -72<0, the graph of f curves in different directions at this point and f has a saddle point at (4,0).

Plot3D[f,{x,-3,7},{y,-5,5}, BoxRatios->{1,1,2},AxesLabel->{x,y,z}]

Example3
Find the local maxima and minima off(x,y) = (x^2)- 2 x y + (y^2).
Solution:

f = (x^2)- 2 x y + (y^2);

The first and second partial derivatives are:

D[f,x]

D[f,y]

D[f,x,x]

D[f,y,y]

D[f,x,y]

The crititcal points are:

cps = Solve[{D[f,x] == 0, D[f,y]==0}]

d = D[f,x,x]D[f,y,y]-D[f,x,y]^2

f /. cps

The Second Derivative Test is inconclusive since d is always 0. There is a whole line of critical points, y = x, where the function has the value 0. In fact, the function is a perfect square, f(x,y) = (((x - y))^2)≥0, and thus has an absolute minumum of 0 along the line y = x.

Plot3D[f,{x,-5,5},{y,-5,5}, BoxRatios->{1,1,2},AxesLabel->{x,y,z}]