integrate success depends on domain



On May 22, 2012, James Nesta wrote:

>What if one applies diff to the resultant integral
>     and compares it with the original expression?

You are right that the result for an indefinite integral
can be checked by differentiation, and my understanding
is that this step is carried out routinely in the steps 
controlled by the lisp function sinint (see src/sin.lisp).

I should have been clearer that I am mainly concerned with
definite integrals, which are passed off to $defint (see
src/defint.lisp), and a definite integral can be produced
in some cases without first finding the indefinite
integral (I think, I am no expert in the lisp code area).

But to return to the idea of differentiating the result to
see that the integrand is returned, the following shows that
both the domain=real indefinite integral and the
domain=complex indefinite integral for the
case integrate(exp(x^5),x) look correct when viewed
through this single lens, but only the domain=complex
result is suitable for finding a definite integral
result.
--------------------------
(%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) exx : integrate(exp(x^5),x);
(%o8) gamma_incomplete(1/5,-x^5)/5
(%i9) diff(exx,x);
(%o9) %e^x^5

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

(%i11) exxc : integrate(exp(x^5),x);
(%o11) -gamma_incomplete(1/5,-x^5)*x/(5*(-x^5)^(1/5))
(%i12) diff(exxc,x);
(%o12) %e^x^5-gamma_incomplete(1/5,-x^5)/(5*(-x^5)^(1/5))
             -gamma_incomplete(1/5,-x^5)*x^5/(5*(-x^5)^(6/5))
(%i13) ratsimp(%);
(%o13) %e^x^5
-------------------------------
Ted