function line_integral_test ( )

%*****************************************************************************80
%
%% line_integral_test() tests line_integral().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 July 2023
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'line_integral_test():\n' );
  fprintf ( 1, '  line_integral() estimates integral ( p1 <= x <= p2 ) f(x) dx\n' );

  p1 = 0.0;
  p2 = 3.0;
  f = @ ( x ) x .* x .* ( 4.0 - x ) + 1.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, '        n     Integral estimate\n' );
  fprintf ( 1, '\n' );
  n = 1;
  for logn = 0 : 20
    q = line_integral ( p1, p2, n, f );
    fprintf ( 1, '  %7d  %14.6g\n', n, q );
    n = 2 * n;
  end

  return
end
