In[]:=
f[x_,y_]=x^3-2y^3-3x+6y+1
Out[]=
1-3x++6y-2
3
x
3
y
In[]:=
grad=Grad[f[x,y],{x,y}]
Out[]=
{-3+3,6-6}
2
x
2
y
In[]:=
sol=Solve[grad=={0,0},{x,y},Reals]
Out[]=
{{x-1,y-1},{x1,y-1},{x-1,y1},{x1,y1}}
In[]:=
hessian=Grad[grad,{x,y}]
Out[]=
{{6x,0},{0,-12y}}
In[]:=
In[]:=
Sign[Det[hessian]/.sol]
Out[]=
{-1,1,1,-1}
In[]:=
f[x,y]/.sol
Out[]=
{-1,-5,7,3}
In[]:=
Show[Plot3D[f[x,y],{x,-3,3},{y,-3,3},PlotRange200,ClippingStyleNone,Mesh{5,0},PlotStyleOpacity[.65],BoxRatios{1,1,3/4},ViewPoint{1.2,-2.5,0}],Graphics3D[{PointSize[.04],Riffle[{Red,Blue,Green},Point[{x,y,f[x,y]}]/.sol]}]]
Out[]=
