Re: [Maxima-bugs] [ maxima-Bugs-1281737 ] limit(atan(x)/(1/exp(1)-exp(-(1+x)^2)),x,inf,plus) - wrong



Milan Lukic wrote:
> I would like to try to address to issues here. First, why would Maxima
> introduce the logarithm in the result here. 
> Second, the idea that this bug is caused by Maxima thinking that 
> lim(log(.)) = log(lim), and the log(-1). 

I can't tell you why it does so, but at one point, Maxima decides to
convert atan(x) to log form.  In this particular case, it seems better
if it didn't do that.  I didn't investigate that possibility.

> 
>    I am puzzled by the introduction of log(-1) in the result. The
> problem in the bug is lim(f/g) type problem, where both lim(f) and
> lim(g) are finite, lim(g) # 0. I am wondering if Maxima's limit
> algorithm does include treating that kind of basic case, and if so,
> does Maxima "know" that limit(atan(x),x,inf)=%pi/2, and that
> limit(exp(-t),t,inf)=0?

I thought the same, but for some reason, maxima didn't try f/g.  But
clearly maxima does know the limits for atan and exp.

> 
> Back to the bug: For problems like one in the bug, I would like to
> believe that Maxima ought to be able to handle those staying in the
> domain of real numbers, and do "simple" evaluation lim(f)/lim(g). 
> Perhaps yours "add %log to one of the special cases in simplimit
> (clause 3)." is going to do exactly that. I apologize if I missed that

Unfortunately, no, that doesn't do that.  What it does is prevent maxima
from doing lim(f(x)) = f(lim x) for finite x.  This is wrong of course
if f(x) has discontinuities for finite values.  I also don't understand
why sin, cos, and others are listed here.

There are probably other possible approaches for the issue in bug
1281737.  The fix I made is really meant for the log bug, which
concidentally fixes bug 1281737.

>   However, if Maxima has to run into limit(log(w(z)),z,a) type of
> thing, the it seems that the lim(log) =log(lim) does not hold if the
> limit point happens to be in the negative real axis. Your approach to
> evaluate limits of both real and imaginary part seem to be a good way
> to go, with a proviso - the sign of the imaginary part should be kept
> constant to ensure approach to the limit point either through the
> second or the third quadrant. 

I believe it does preserve the sign.

Ray