  clear;close

  disp('                    RIEMANN SUMS  ')

  disp(' ')
  disp('      f(x,y) = x^2 + x^3 + y^2  ')
  disp('   ')
  disp(' We calculate the Riemann sums using the midpoint rule  ')
  disp(' over the rectangle [0,2] x [ -1,1].')
  disp('  ')
  disp(' The exact value of the integral is 14 + 2/3  ')
  disp(' ')
  f = inline(' x.^2 + x.^3 + y.^2', 'x', 'y');

  corners = [0 2 -1 1];
  qsurf(f, corners); shading interp; colormap(cool);
  pause

  for j = 1:3
     figure
     riemann(f, corners, 'graph') 
     pause
  end

   close all
