Definite integrals and asksign



>>>>> "Neilen" == Neilen Marais <nmarais at sun.ac.za> writes:

    Neilen> Hi.
    Neilen> I'm trying to evaluate a definite volume integral in a tetrahedral domain. 

    Neilen> load("vect")
    Neilen> /* the integrand */
    Neilen> (%i42) tmpp: (x2/2+x1/2)*sin((%pi*(-x3/2-(-x3-x2-x1+1)/2+x2/2+x1/2))/2);
    Neilen> (%o42) (x2/2+x1/2)*sin((%pi*(-x3/2-(-x3-x2-x1+1)/2+x2/2+x1/2))/2)

    Neilen> /* The full triple integral */
    Neilen> (%i43) integrate(integrate(integrate(tmpp, x3, 0, 1-x1-x2), x2, 0, 1-x1), x1, 0
    Neilen> ,1);
    Neilen> Is  x2+x1-1  positive, negative, or zero?
    Neilen> ....

    Neilen> It then continues to ask a number of (irrelevant?) sign questions. It
    Neilen> seems to give me the same result irrespective of what combination of 
    Neilen> positive or negative I answer, which is:

    Neilen> (%o43) -(sqrt(2)*%pi^2+12*sqrt(2)*%pi-48*sqrt(2))/%pi^4

    Neilen> If I succesively take indefinite integrals and manually substitute the bounds I
    Neilen> get the same answer, without any asksign questions (I omitted some of the
    Neilen> intermediate results to save space):

    Neilen> (%i34) integrate(tmpp, x3);
    Neilen> (%o34) (x2/2+x1/2)*sin((%pi*x2)/2+(%pi*x1)/2-%pi/4)*x3(%i35) ev(%, x3:1-x2-x1)
    Neilen> - ev(%,x3:0);

I did not investigate the exact reason for why you asked for the sign
of various things, but you should note that definite integrals are
often transformed to different forms to evaluate it.  That is,
definite integration does not necessarily find the indefinite integral
and substitute in the limits, which is what you are doing here by
hand.  If you do integrate(tmpp, x3, 0, 1-x1-x2), you will be asked
for the sign of x1+x2-1.

Ray
    Neilen> (%i44) facts();
    Neilen> (%o44) [kind(.,commutative),kind(order,commutative),kind(x1,real),kind(x2,real),
    Neilen>         kind(x3,real),kind(x4,real),-x3-x2-x1+1>=0,1>=x1,1>=x2,1>=x3,
    Neilen>         x3+x2+x1>=0,x1>=0,x2>=0,x3>=0]

If I do this:

assume(x1>0, x2 > 0, x3 > 0, x1 < 1, 1-x1-x2> 0);

the triple integral only asks for the sign of cos(%pi*x1/2) and
sin(%pi*x1/2).  I guess that's a deficiency in maxima that it doesn't
know the sign of those.

Ray