integrate(1/x,x,0,1)



There appear to be several problems (three at least) with Ahmet's example.

First, Maxima asks a question that is not relevant in the first place, given
the integration limits:

(%i1) integrate(1/x,x,0,1);
Is  x + 1  positive, negative, or zero?


Second, this question doesn't appear if the integral is evaluated again
immediately; however, it does appear if we do something else in between:

(%i1) integrate(1/x,x,0,1);
Is  x + 1  positive, negative, or zero?

pos;
Integral is divergent
 -- an error.  To debug this try debugmode(true);
(%i2) integrate(1/x,x,0,1);

Integral is divergent
 -- an error.  To debug this try debugmode(true);
(%i3) 2*2;
(%o3)                                  4
(%i4) integrate(1/x,x,0,1);
Is  x + 1  positive, negative, or zero?

pos;
Integral is divergent
 -- an error.  To debug this try debugmode(true);


Third, if we tell Maxima that x+1 is zero or negative, we get a stack
overflow:

(%i1) integrate(1/x,x,0,1);
Is  x + 1  positive, negative, or zero?

neg;
Maxima encountered a Lisp error:

 Error in MACSYMA-TOP-LEVEL [or a callee]: Bind stack overflow.

Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.


Viktor




-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of Stavros Macrakis
Sent: Monday, June 02, 2008 9:45 AM
To: ahmet alper parker
Cc: maxima at math.utexas.edu
Subject: Re: [Maxima] integral of 1/(x^4+3*x^2+1) fails

On Mon, Jun 2, 2008 at 8:44 AM, ahmet alper parker <aaparker at gmail.com>
wrote:
> integrate(1/x, x, 0, 1);
> zero (or negative)
> give an error message.
> Should not it give a result (whether the result is not found/meaningful or
> not) instead of an error message?

This is certainly not a bug in the sense that it is by design. And
here is the rationale:

Presumably you would want he result to be 'inf'; but the problem with
that is that subsequent operations may give incorrect or meaningless
results, e.g.

       0*integrate(1/x,x,0,1)

would give 0, not und.  Even if it returns a noun form,
'integrate(1/x,x,0,1), multiplying this by 0 will return 0, which is
of course incorrect.  Perhaps if and when 0*inf, inf-inf, etc. are
changed to simplify to und, there will be an argument for changing
this behavior.

Of course, currently divergent integrals which aren't recognized as
divergent already simplify incorrectly, e.g.

     0 * integrate(exp(1/x),x,0,1) => 0

Not sure how best to handle that....

             -s
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima