 
    clear ; close;

    disp('     We first graph the function f(x,y) = 4xy +2x^2y -xy^2  ')
    disp('    over the rectangle [-3, 1] x [ -1 5]   ')
    
    f = inline('4*x.*y +2*x.^2.*y - x.*y.^2','x', 'y');
    x = linspace( -3,1, 51);
    y = linspace( -1,5, 51);
    [X,Y] = meshgrid(x,y);
    surf(X,Y,f(X,Y)); shading flat;
    pause
    disp(' ')
    disp(' Next we look at the level curves of f ')
    disp(' There are critical points at ( 0,0), ( -2,0), (4,0), and ( -2/3, 4/3)')
    
    clear x y X Y
    x = linspace( -3, 1, 101);
    y = linspace( -1,5, 101);
    [X,Y] = meshgrid(x,y);
    levels = [ -5 -4 -1 -.8 -.6 -.4 -.2 0 .2 .4 .6 .8 1 2 4 6 8 10 20];
    contour(X,Y,f(X,Y), levels)