function area1 ( n )

%% AREA1 estimates area between X axis and Y=3/4*(1-X^2).

  x_min = -1.5;
  x_max = +1.5;

  x = linspace ( x_min, x_max, n );
  y = f ( x );

  area_estimate = ( x_max - x_min ) * sum ( y ) / n;
  area_exact = 9.0 / 16.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of sample points N = %d\n', n );
  fprintf ( 1, '  Area estimate = %g\n', area_estimate );
  fprintf ( 1, '  Area exact =    %g\n', area_exact );
  fprintf ( 1, '  Area error =    %g\n', abs ( area_estimate - area_exact ) );

  return
end
function value = f ( x )

  value = 0.75 * ( 1.0 - x .^ 2 );

  return
end
