Question: Integration inconsistencies

Dear Fellow Maplers,

I am seeing some puzzling inconsistencies in Maple's numerical integration routines, and am reaching out to the Maple community to see if someone out there can help shed some light on what the source of problem might be. 

To illustrate the problem I have constructed a minimal anomalous example.  Consider the following function of two variables:

      g := (1-x) * ln(sqrt(x^2 + y^2 + 1) +1 );

which is smooth in the unit square (0,1]x(0,1].  We shall compute the integral of the y=0.5 slice of this function, from x=0..1 in two different ways that are mathematically equivalent.  We shall find that the answers Maple provides for the two equivalent techniques, however, are different.

1) The first, and obvious, way to compute the integral of the y=0.5 slice of g, from x=0..1, is:

    h: = subs(y = 0.5, g);

    h1 := evalf(int(h, x = 0..1);

then h is then the y=0.5 slice of g, and h1 is the integral of h from x=0 to x=1.

2) The second way to do this, only slightly less obvious, is to perform a definite integration with respect to x first

    g2 := int(g, x = 0..1);

yielding a function of just y, which must then be evaluated at y=0.5

    h2 := evalf(subs(y = 0.5, g2));

 

Plainly, h1 and h2 ought to agree.  However, Maple (both versions 13 and 14) report different answers.  In the Mac OS X version of Maple 14, for example:

    h1 is 0.3910827618

    h2 is 1.176480926

 

Please note that the above computation, in and of itself, is not my real objective.  It is merely an example, constructed to illustrate a larger issue.

The real objective is to understand why Maple produces different answers for the two methods--and to have a clear picture of whether (a) this is a "bug" in Maple, or (b) if I, as a user, have failed in some aspect of my computational responsibility. 

If (b), then in practical terms: if the original g was much more complicated, how would I as a user, be expected to validate whether h1 or h2 was the right answer?  Or worse, if I had just used the 2nd method, how would I go about suspecting that Maple gave me h2, a wrong answer?


Thank you in advance for your time and consideration.

Sincerely,

Bilal Khan
Professor of Mathematics and Computer Science
City University of New York / John Jay College

Please Wait...