Maxima asks about sign of integration(!) variable



On 9/25/2013 1:08 AM, David Scherfgen wrote:
> Hi,
>
> when I do:
>
> expr : sqrt(1+(4*x^(1/3)-1/16*x^((-1)/3))^2);
> integrate(expr, x, -8, 512);
>
> Maxima asks "Is x positive or negative?".
> Why does it ask that? x is the integration variable ... it shouldn't 
> ask anything about it.
>
> Also, when I answer "positive;", Maxima keeps asking the same question 
> again two more times.
> Only then, it gives me an answer.
>
> The whole asking thing seems very buggy to me ...
>
> David
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima

Well, your whole question has problems too.  x^(1/3)  is potentially 3 
different
values, and the square root has 2 values.


  Admittedly the question about "x"
seems wrong because the truth is   -8<=x<=512  so x is sometimes 
negative and
sometimes positive.

I tried a few times with different answers to the 3 questions and each 
time got
97965/8    or about 12245.625.

Interestingly, using Macsyma (commercial version)  no questions were 
asked and the
answer came out 98739/8  or about 12342.4

In Mathematica, the answer came out
3/16 (65697 + 127 I Sqrt[3])
or 12318.2 + 41.2445 I

Doing NIntegrate in Mathematica provided

12318.1 + 41.2326 I

Since the integrand seems to be real only for x>0, there seem to be some 
issues.

All the programs agree if you choose to integrate from 0 to 512.

Since the integrand is (depending somewhat on your choice of roots)
equivalent to (64*x^(2/3)+1)/(16*x^(1/3)), you might consider if that is
really what you want.  If it is not what you want  (and it is STILL 
ambiguous
if you ask me...)  then maybe you have a better way of stating your 
question.


Is there a bug? yeah, probably.  Although the online documentation is kind
of limited, perhaps it should do a better job of explaining what it is
trying to do heuristically and then algebraically.  Most of the integration
program (with the except of some parts of definite integration) is mostly
ignorant of complex analysis.

RJF