Example 2: Generalized for quadric surfaces

quad: a*x^2 + 2*b*x*y + c*y^2;

Case I: Elliptic paraboloid

f: quad, a=1,b=0,c=1;

draw3d(enhanced3d=true, view=[70,20],
       explicit(f,x,-2,2,y,-2,2),
       xlabel="x", ylabel="y");

wxdraw3d(color=red, contour=map, contour_levels=[0,0.5,4],
       explicit(f,x,-2,2,y,-2,2),
       user_preamble="unset clabel", xlabel="x", ylabel="y");

Critical point and second derivative test

del_f: [diff(f,x), diff(f,y)];

realonly: true;

sol: solve([del_f[1]=0, del_f[2]=0]);

f_xx: diff(f,x,2);

D: diff(f,x,2)*diff(f,y,2) - diff(f,x,1,y,1)^2;

Case II: Hyperbolic paraboloid

f: quad, a=1,b=2,c=1;

draw3d(enhanced3d=true, view=[70,20],
       explicit(f,x,-2,2,y,-2,2),
       xlabel="x", ylabel="y");

wxdraw3d(color=red, contour=map, contour_levels=[-4,0.5,4],
       explicit(f,x,-2,2,y,-2,2),
       user_preamble="unset clabel", xlabel="x", ylabel="y");

Critical point and second derivative test

del_f: [diff(f,x), diff(f,y)];

realonly: true;

sol: solve([del_f[1]=0, del_f[2]=0]);

f_xx: diff(f,x,2);

D: diff(f,x,2)*diff(f,y,2) - diff(f,x,1,y,1)^2;

Section 14-7: Maximum and Minimum

Example 3: Second derivatives test

f: x^4+y^4-4*x*y+1;

draw3d(enhanced3d=true, view=[60,30],
       explicit(f,x,-2,2,y,-2,2),
       xlabel="x", ylabel="y");

wxdraw3d(color=red, contour=map, contour_levels={-0.5,0,0.5,0.9,1,1.1,1.5,2,3},
       explicit(f,x,-2,2,y,-2,2),
       user_preamble="unset clabel", xlabel="x", ylabel="y");

Find all critical points

del_f: [diff(f,x), diff(f,y)];

realonly: true;

sol: solve([del_f[1]=0, del_f[2]=0]);

sol[1];

Second derivatives test for each critical point

f_xx: diff(f,x,2);

D: diff(f,x,2)*diff(f,y,2) - diff(f,x,1,y,1)^2;

sol[1]; f_xx, sol[1]; D, sol[1];

sol[2]; f_xx, sol[2]; D, sol[2];

sol[3]; f_xx, sol[3]; D, sol[3];