Extrema in 3D

Example 3.10.6   Barr

Define the function

f[x_,y_]=x^3 + x^2 * y - y^2 - 4 y

Note that the domain of this function is the whole real plane.

Calculations we'll need

Calculate the gradient

gradf={D[ f[x,y],x], D[f[x,y],y]}

Note that the gradient is always defined.  Thus, the only critical points occur when the gradient is zero.

Calculate the discriminant.

D[f[x,y],{x,2}] * D[f[x,y],{y,2}] -D[  D[f[x,y],y],x]^2

disc[x_,y_]=-4 (x^2)-2 (6 x+2 y)

Define fxx.

fxx[x_,y_]=D[f[x,y],{x,2}]

Solve for the critical points.

Solve[gradf=={0,0}]

Test each critical point.

First critical point

disc[0,-2]

Since this value is positive, we check fxx.

fxx[0,-2]

Since this value is negative, we have a local max at (0, -2)