function trapezoid_power_test ( )

%*****************************************************************************80
%
%% trapezoid_power_test() tests the trapezoid rule on the power-singular integrand.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    15 November 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'TRAPEZOID_POWER_TEST\n' );
  fprintf ( 1, '  Test the trapezoidal rule on the power-singular integrand.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '        N        Estimate           Error\n' );
  fprintf ( 1, '\n' );
  n = 17;
  v2 = integral_power ( );
  for nlog = 5 : 12
    n = ( n - 1 ) * 2 + 1;
    h = 1.0 / ( n - 1 );
    x = linspace ( 0.0, 1.0, n );
    x(1) = 0.5 * ( x(1) + x(2) );
    f = integrand_power ( n, x );
    v1 = h * ( sum ( f ) - 0.5 * ( f(2) + f(n) ) );
    fprintf ( 1, '  %7d  %14.6g  %14.6g\n', n, v1, abs ( v1 - v2 ) );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, '    Exact: %14.6g\n', v2 );

  return
end

