defint or sqrt bug?



I don't understand why defint is so picky about verifying that the limits 
of integration are real. The code for defint seems
to set up its own private context and makes various assumptions, but I 
don't see where the code simplifies the
integrand in the context that the variable is between the limits of 
integration.  Actually even when the limits are
non-real, an affine change of variable could change them to either 0 to 1 
(or 0 to infinity, or ...)

--Barton

"Edwin Woollett" <woollett at charter.net> wrote on 12/19/2011 01:50:54 PM:

> From: "Edwin Woollett" <woollett at charter.net>
> To: "Barton Willis" <willisb at unk.edu>
> Cc: "maxima mailing list" <maxima at math.utexas.edu>
> Date: 12/19/2011 01:50 PM
> Subject: Re: defint or sqrt bug?
> 
> On Dec. 18, 2011, Barton Willis wrote
> ------------------------------
> >A workaround: (not so terrific when a or b are not real)
> >
> > (%i1) load(abs_integrate)$
> > (%i2) myint(e,x,a,b) := simp_assuming(integrate(e,x,a,b), min(a,b) 
<=x, x 
> > <= max(a,b))$
> >
> > (%i6) myint(myint(1, y, 0,sqrt(1-x^2)),x,-1,1);
> > (%o6) %pi/2
> ----------------------------------------------
> I like your  approach, which I have abbreviated to
> the minimum for my task.  (The user could
> check that a and b are real)
> 
> (%i1) load("unwind_protect.lisp");
> 
> (%o1) 
> "C:/PROGRA~1/MAXIMA~1.1-G/share/maxima/5.25.1/share/contrib/
> unwind_protect.lisp"
> 
> (%i2) simp_assuming(e, [fcts]) ::=
>   buildq([e,fcts], unwind_protect((apply(assume, fcts), expand(e,0,0)), 
> apply(forget,fcts)))$
> 
> (%i3) myint(e,x,a,b) := simp_assuming(integrate(e,x,a,b), min(a,b) <=x, 
x <= 
> max(a,b))$
> 
> (%i4) myint(myint(1, y, 0,sqrt(1-x^2)),x,-1,1);
> 
> (%o4) %pi/2
> 
> (%i5) myint(myint(1, y, -sqrt(1-x^2),sqrt(1-x^2)),x,-1,1);
> 
> (%o5) %pi
> -------------------------------
> Ted
>