A disappointing result

Lets look at a simple example.

Romberg(x->sin(x),0..Pi,4,16,true);

Math

  i  T[i] 
  0  +0.00000000 
  1  +1.57079633 +2.09439510 
  2  +1.89611890 +2.00455975 +1.99857073 
  3  +1.97423160 +2.00026917 +1.99998313 +2.00000555 
  4  +1.99357034 +2.00001659 +1.99999975 +2.00000002 +1.99999999 

Math

Math 

Observe the order of convergence in the columns. Now we want to apply this quadrature to our integral. We first define the function. Note that f(0) is not defined, but we set f(0)=0, which is a common practice in this cases. Of course this does not alter the value of the integral.

F := proc(x) local r;
if is(x = 0) then r := 0;
else r := (1-x)/((1+x)*sqrt(x)) fi;
r end:

Romberg(x -> F(x), 0..1,5,12,true);

Math

  i  T[i] 
  0  +0.00000000 
  1  +.23570226 +.31426968 
  2  +.45909044 +.53355316 +.54817206 
  3  +.64271142 +.70391841 +.71527610 +.71792854 
  4  +.78278699 +.82947884 +.83784954 +.83979515 +.84027306 
  5  +.88568327 +.91998204 +.92601558 +.92741504 +.92775865 +.92784417 

Math

Math

The result is disastrous. The main diagonal displays values which are worse than the initial approximations! Total failure! What happened? Let's look at the integrand.

plot(F(x),x=0..1);

[Plot]

The function is monotone and smooth - except for the point x=0. Here the value goes to infinity, the function has a so called 'algebraic singularity'. This spoils our approach. What a pity! The Romberg quadrature was not designed for integrals like ours.