7.32 bug in algebraic symbolic integration in maple v.4 and maple v.5 (26.9.97)

7.32.1 luca ciotti

I found a very strange bug in the symbolic integration routine in MapleV4, working with a very simple algebraic function:

                   f:=  A/( (1+x^2)^(3/2) * (1 + sqrt(1 + x^2))) 
                    int(f, x=0..infinity) = 0 <===========

a result obviously wrong.

Three important facts must be noticed :

1)The previous result is obtained when the exponent 3/2 is replaced by 5/2, 7/2, 9/2 etc, but NOT for EVEN exponents

2)Most strange, CORRECT result is obtained when the symbolic constant A (or any other symbolic constant) is REPLACED in the definition of f with a NUMBER, i.e., this strange behavior is present ONLY when the numerator of f is SYMBOLIC.

3)I found the IDENTICAL behavior in MapleV.3

Both the versions of Maple I’m using are under Unix.

It is corrected with Maple 6. (U. Klein)

7.32.2 Douglas B. Meade (29.9.97)

I found your posting interesting. In this response I first present my findings concerning the computations you report, then present a different approach to the problem that appears to be more promising. You should be able to copy either Maple session directly into a Maple worksheet (R4).

I do not obtain the result that you report. I, too, am working with Release 4 on UNIX (Solaris). While my results are different, they are not what you might expect. Here’s what I found:

> restart; 
> interface( version ); 
Maple Worksheet Interface, Release 4, SUN SPARC SOLARIS, Apr 19, 1997 
> interface( patchlevel ); 
> f:=  A/( (1+x^2)^(3/2) * (1 + sqrt(1 + x^2))); 
                  f := ----------------------------- 
                             2 3/2            2 1/2 
                       (1 + x )    (1 + (1 + x )   ) 
> int( f, x=0..infinity ); 
                    infinity - signum(A) infinity 
> int( subs(A=1,f), x=0..infinity ); 
                             - 1/2 Pi + 2 
> evalf( Int( subs(A=1,f), x=0..infinity ) ); 

For additional information on Maple’s evaluation of this integral you might insert the command:

> infolevel[int]:=5;

before the int command. The extra output will provide some insight into Maple’s processing. In this case it appears that the problem is divided into two elliptic integrals that converge only under certain conditions. While the conditions are displayed in the userinfo, they do not appear to be carried forward with the result.

The "even" exponents are not as much of a problem because of the elimination of one of the square roots from the denominator. These roots are likely to be the ultimate source of the difficulties for this problem.

In fact, the repeated occurrence of sqrt(1+x^2) suggests a substitution that might yield a more tractable formulation of the problem. The changevar command from Maple’s student package can be used (WITH CAUTION - it’s not a problem here, but I seem to remember that changevar can become confused, e.g., limits of integration for non-monotone substitutions) to complete the change of variables.

> restart; 
> with( student ): 
> f := A/((1+x^2)^p*(1+(1+x^2)^(1/2))); 
                   f := --------------------------- 
                              2 p            2 1/2 
                        (1 + x )  (1 + (1 + x )   ) 
> F := Int( f, x=0..infinity ); 
                 |                       A 
           F :=  |          --------------------------- dx 
                 |                2 p            2 1/2 
                /           (1 + x )  (1 + (1 + x )   ) 
> G := changevar( (1+x^2)=u^2, F ); 
                  |                     A u 
            G :=  |          -------------------------- du 
                  |            2 p                2 1/2 
                 /           (u )  (u + 1) (-1 + u ) 
> value( subs(p=3/2,G) ); 
                            2 A - 1/2 Pi A 
> value( subs(p=4/2,G) ); 
                           -2 A + 3/4 Pi A 
> value( subs(p=5/2,G) ); 
                           8/3 A - 3/4 Pi A 
> value( subs(p=6/2,G) ); 
                          - 8/3 A + -- Pi A 
> value( subs(p=7/2,G) ); 
                           16/5 A - -- Pi A 

I hope you have found this useful and informative.

7.32.3 Ferdinand Gleisberg (30.9.97)

I add to Luca’s observations:


> assume(A>0);

the correct result is obtained !

Ferdinand Gleisberg.

7.32.4 Willard, Daniel, Dr., DUSA-OR (30.9.97)

Would it work better if you defined f as f:=x-> etc?

7.32.5 luca ciotti (3.10.97)

Thank you very much for all your interesting comments!

I would like to add the observation that assuming A<0 the previous integral is returned infinity!

Obviously, my problem is not the specific evaluation of the previous integral (it can be solved very easily by hand), but a more general problem. In fact, suppose you have a VERY LONGE symbolic problem that you cannot control step by step, a problem like the previous can be quite dangerous.

Moreover, I think that a "normal" user cannot know ALL what Maple is doing solving a problem (suppose maple use the previous integral in doing a much more complex integration as an intermediate step...) Certainly, many evident errors (like the previous one) can certainly be handled with some "interactive" work, but unfortunately not always such work is doable.....