Bug in limit or integrate



"Sometime ago, I wrote a bit of code that attempts to determine when an 
expression is continuous."

I came up with this bit of code.  It works pretty well.

continuousp(__e, __x, __p):=block
(
    [inflag : true, ratprint:false, _p, _l],
    _p : errcatch
    (
        if is(equal(_l : limit(__e, __x, __p, 'plus), limit(__e, __x, __p, 
'minus))) then
            if is(equal(_l, at(__e, [__x=__p]))) = true then
                true
            else
                false
        else
            false
    ),
    if emptyp(_p) then
        if is(equal(error, ["expt: undefined: 0 to a negative 
exponent."]))=true then
            false
        else
            []
    else
        first(_p)
);

-----Original Message----- 
From: Barton Willis
Sent: Saturday, December 31, 2011 8:57 AM
To: rich.hennessy at verizon.net
Cc: maxima at math.utexas.edu
Subject: Re: [Maxima] Bug in limit or integrate

The function x |->  -gamma_incomplete(1/4,x^4)*x/(4*abs(x)) is not 
continuous at zero. To do
the calculation correctly, you need to consider the intervals (-inf,0) and 
(0, inf) separately.
Doing that, the definite integral is correct, I think.

Sometime ago, I wrote a bit of code that attempts to determine when an 
expression is continuous. I know
that in general this is algorithmically impossible--I was aiming for a 
satisficing (good enough) method.

--Barton

-----maxima-bounces at math.utexas.edu wrote: -----


I get this incorrect result for the following calculations:

(%i4) kill(all);

(%o0) done
(%i1) exp(-x^4);

(%o1) %e^-x^4
(%i2) integrate(%o1,x,minf,inf);

(%o2) gamma(1/4)/2
(%i3) integrate(%o1,x);

(%o3) -gamma_incomplete(1/4,x^4)*x/(4*abs(x))
(%i4) limit(%o3,x,inf)-limit(%o3,x,minf);

(%o4) 0

The limit should give the same answer as the more direct definite  integral. 
I can’t take the analysis much further because I know very  little 
about the gamma_incomplete function.  It looks like a bug.

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