In[]:=
​​f[x_,y_]=x^3-2y^3-3x+6y+1​​
Out[]=
1-3x+
3
x
+6y-2
3
y
In[]:=
grad=Grad[f[x,y],{x,y}]
Out[]=
{-3+3
2
x
,6-6
2
y
}
In[]:=
​​sol=Solve[grad=={0,0},{x,y},Reals]​​
Out[]=
{{x-1,y-1},{x1,y-1},{x-1,y1},{x1,y1}}
In[]:=
hessian=Grad[grad,{x,y}]​​ 
Out[]=
{{6x,0},{0,-12y}}
In[]:=
​
Syntax
:Expression "Sign[hessian[[0,1]] has no closing ].
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},PlotRange200,​​ClippingStyleNone,Mesh{5,0},PlotStyleOpacity[.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[]=