maximum:

draw3d(xlabel="x", ylabel="y", zlabel="z",
       title="z=exp(-(x^2+y^2))",
       line_width=2,
       explicit(exp(-x^2-y^2), x,-2.5,2.5, y,-2.5,2.5),
       contour_levels=15,
       contour=both,
       surface_hide=true,
       terminal=wxt)$

draw3d(xlabel="x", ylabel="y", zlabel="z",
       title="z=exp(-(x^2+y^2))",       
       line_width=2,
       explicit(exp(-(x^2+y^2)), x,-2.5,2.5, y,-2.5,2.5),
       contour_levels=15,
       contour=map,
       surface_hide=true,
       terminal=wxt)$

saddle:

draw3d(xlabel="x", ylabel="y", zlabel="z",
       title="z=x^2-y^2",
       line_width=2,
       explicit(x^2-y^2, x,-2.5,2.5, y,-2.5,2.5),
       contour_levels=15,
       contour=both,
       surface_hide=true,
       terminal=wxt)$

draw3d(xlabel="x", ylabel="y", zlabel="z",
       title="z=x^2-y^2",
       line_width=2,
       explicit(x^2-y^2, x,-2.5,2.5, y,-2.5,2.5),
       contour_levels=15,
       contour=map,
       surface_hide=true,
       terminal=wxt)$

monkey saddle:

draw3d(xlabel="x", ylabel="y", zlabel="z",
       title="z=x^3-3*x*y^2",
       line_width=2,
       xu_grid=40,
       yv_grid=40,
       explicit(x^3-3*x*y^2, x,-2.5,2.5, y,-2.5,2.5),
       contour_levels=20,
       contour=both,
       surface_hide=true,
       terminal=wxt)$

draw3d(xlabel="x", ylabel="y", zlabel="z",
       title="z=x^3-3*x*y^2",
       line_width=2,
       xu_grid=120,
       yv_grid=120,
       explicit(x^3-3*x*y^2, x,-2.5,2.5, y,-2.5,2.5),
       contour_levels=20,
       contour=map,
       surface_hide=true,
       terminal=wxt)$

boundary critical points:

draw3d(xlabel="x", ylabel="y", zlabel="z",
       title="z=sqrt(1-x^2-y^2)",
       line_width=2,
       parametric_surface(v*cos(t),v*sin(t),
                          sqrt(1-v^2),
                          v,0,1,t,0,2*%pi),
       surface_hide=true,
       terminal=wxt)$

local min:

draw3d(xlabel="x", ylabel="y", zlabel="z",
       title="z=x^3+y^3-12*x*y",
       line_width=2,
       explicit(x^3+y^3-12*x*y, x,-4,8, y,-4,8),
       contour_levels=20,
       contour=both,
       surface_hide=true,
       terminal=wxt)$

draw3d(xlabel="x", ylabel="y", zlabel="z",
       title="z=x^3+y^3-12*x*y",
       line_width=2,
       explicit(x^3+y^3-12*x*y, x,-4,8, y,-4,8),
       contour_levels=20,
       contour=map,
       surface_hide=true,
       terminal=wxt)$

second derivative test fails:

draw3d(xlabel="x", ylabel="y", zlabel="z",
       title="z=x^4+y^4",
       line_width=2,
       explicit(x^4+y^4, x,-2.5,2.5, y,-2.5,2.5),
       contour_levels=20,
       contour=both,
       surface_hide=true,
       terminal=wxt)$

boundary min/max:

draw3d(xlabel="x", ylabel="y", zlabel="z",
       title="z=x^2-y",
       line_width=2,
       explicit(x^2-y, x,0,1, y,0,1),
       surface_hide=true,
       terminal=wxt)$