integrate success depends on domain



The maxima user needs, in general, to
choose the right domain to get either the
correct answer or an answer from integrate, as I 
have written before. I don't know (yet) any
general rules for choosing the domain.

For example:

1. you need domain = real to get integrate(sqrt(log(x)),x,0,1)
   done at all (domain = complex transformations produce a
   form which limit cannot handle).

2. you need domain = complex for integrate (exp(x^5),x,1,2)
    to produce a symbolic result which will give
    the correct float value (domain = real leaves out essential
    factors).

If integrate returns a result, the user has no way to know
if it can be trusted (other than some numerical exploration).

Design of a "nintegrate" utility which first tries to use integrate
may have to in general assume domain=complex, but if that
doesn't work, try domain = real, and cross multiple fingers.
Or perhaps look at the details of the integrand??

example details using 5.27.0-1gcl  plus some updates:
---------------------------------------------------------

(%i1) display2d:false$
(%i2) cfloat(zz):=expand(float(rectform(zz)))$
(%i3) load("c:/work2/comm-new.o")$
(%i4) load("c:/work2/gamma-new.o")$
(%i5) load("c:/work2/limit-new.o")$
(%i6) load("c:/work2/numeric-new.o")$

(%i7) domain;
(%o7) real

(%i8) limit(sqrt(%pi)*%i*erf(%i*sqrt(log(x)))/2+x*sqrt(log(x)),x,0,plus);
(%o8) 'limit(sqrt(%pi)*%i*erf(%i*sqrt(log(x)))/2+x*sqrt(log(x)),x,0,plus)

OK:
(%i9) integrate(sqrt(log(x)),x,0,1);
(%o9) sqrt(%pi)*%i/2

(%i10) domain:complex;
(%o10) complex

NOT OK:
(%i11) integrate(sqrt(log(x)),x,0,1);
(%o11) -'limit(sqrt(%pi)*%i*erf(%i*sqrt(log(x)))/2+x*sqrt(log(x)),x,0,plus)

(%i12) domain:real;
(%o12) real

NOT OK:
(%i13) integrate(exp(x^5),x,1,2);
(%o13) (gamma_incomplete(1/5,-32)-gamma_incomplete(1/5,-1))/5
(%i14) cfloat(%);
(%o14) -5.9556722908249463E+11*%i-8.1972796653425952E+11

(%i15) domain:complex;
(%o15) complex

OK:
(%i16) integrate(exp(x^5),x,1,2);
(%o16) ((-1)^(4/5)*gamma_incomplete(1/5,-32)-(-1)^(4/5)
                                             *gamma_incomplete(1/5,-1))/5
(%i17) cfloat(%);
(%o17) 1.0132394896940175E+12-1.9531250000000001E-4*%i
----------------------------------

(%i18) build_info();
(%o18) ?%build_info("5.27.0","2012-05-08 11:27:57","i686-pc-mingw32",
                    "GNU Common Lisp (GCL)","GCL 2.6.8")
                    
-----------------------------
Ted Woollett