Example (i)

f[x_,y_]=2 x y-(x^2)-2 (y^2)+3 x+4;
fx=D[f[x,y],x];
fy=D[f[x,y],y];
fxx[x_,y_]=D[fx,x];
fyy[x_,y_]=D[fy,y];
fxy[x_,y_]=D[fx,y];
descriminant[x_,y_]=fxx[x,y]*fyy[x,y]-(((fxy[x,y]))^2);

Solve[{fx==0,fy==0},{x,y}]

descriminant[3,3/2]
fxx[3,3/2]

f[3,3/2]

Plot3D[f[x,y],{x,1,5},{y,.5,2.5},AxesLabel->{x,y,z}]

Example (ii)

Plot3D[Sin[2 x]*Cos[y],{x,0,Pi},{y,0,2 Pi},AxesLabel->{x,y,z}]

Notice that in the interior of the region, there are two saddle points, a maximum and a minimum.  Also notice that there are two maximums and two minimums on the boundary.  We find these by using calculus I techniques.  That is, the boundary of the region consists of four parts: (i) f(0,y)=0, 0⩽y⩽2π and (ii) f(π,y)=0, 0⩽y⩽2π are constant, so no extreme (or infinity number of extreme). Part (iii) f(x,0)=Sin[2x], 0⩽x⩽π and (iv) f(x,2π)=Sin[2x], 0⩽x⩽π both have two critical values (in a calculus I sense) inside the interval, one is a maximum and one is a minimum.