Integration bug



Valery,

Though defint's result is not correct, I don't think your formula is
correct, either.  (I am using prebuilt 5.9.0, not CVS.)

Consider:

  integrand: t^2*sqrt(1-t^2)/(1+b^2*t^2);
  vp_int: %pi/b^2*(1-1/sqrt(1+b^2));
  defint: integrate(integrand,t,-1,1);

  table:
makelist(float([romberg(''integrand,t,-1,1),''vp_int,''defint]),
           b,[0.001,0.234,0.753,1.0])$
  fpprec:6$
  apply(matrix,cons(["b","Romberg","vp_int","Defint"],table));

         [   b     Romberg      vp_int      Defint    ]
         [                                            ]
         [ 0.001    0.3927      1.5708    3.14159E+12 ]
         [                                            ]
         [ 0.234    0.3823      1.5091      1076.51   ]
         [                                            ]
         [ 0.753    0.3098     1.11451      12.542    ]
         [                                            ]
         [  1.0     0.2695      0.9202      4.71239   ]
         [                                            ]
         [ 100.0  1.53968E-4  3.11018E-4  1.57111E-4  ]

For that matter, look at the case b=0 analytically:

  integrandb0: subst(0,b,integrand) => t^2 sqrt(1-t^2)
  indefintb0: integrate(integrandb0,t) 
    Verify: ratsimp(diff(indefintb0,t)) == integrandb0
  subst(1,t,indefintb0)-subst(-1,t,indefintb0) => %pi/8
  integrate(integrandb0,t,-1,1) => %pi/8

and numerically:

  romberg(''integrandb0,t,-1,1) => 0.392693 ~~ %pi/8

But

  limit(vp_int,b,0) => %pi/2

Maxima's indefinite integral is not correct, either:

  subst([t=0,b=1],integrand) => 0
  subst([t=0,b=1],diff(integrate(integrand,t),t)) => 2