Strange behaviour of limit on unknown signs.



Hi,

I was playing with some limits that have exponentials in them and came
across the following rather strange phenomenon:

(%i1) limit(exp(a*s), s, inf);
Is  a  positive, negative, or zero?

neg;
                                           a s
(%o1)                           limit    %e
                                s -> inf
(%i2) assume(a<0);
(%o2)                               [a < 0]
(%i3) limit(exp(a*s), s, inf);
(%o3)                                  0


What seems to happen is that $limit calls

 (1) LIMIT
 (2) GRUNTZ1
 (3) LIMIT (using Taylor)

If $a isn't known to be negative, LIMIT fails to find an answer the
first time around (since it decides that a*s goes to INFINITY, which
itself seems strange: what if a = 0?)

Then the Gruntz algorithm fails (in MRV-SIGN) because it can't decide
the sign of a*s. Fair enough.

The question gets asked in a call to $TAYLOR but, of course exp(a*x)
isn't analytic at infinity, so this is no help and we return a noun
form.

I started to roll my metaphorical sleeves up to try to fix this but
realised that I'm not sure what's supposed to happen. Should we be
asking signs earlier? If either step (1) or (2) above had asked the sign
of $a, we'd have got a sensible answer. But asking about signs is
icky. Maybe we should force Taylor not to ask for a sign? But then we
fail to compute the limit, which we *almost* managed.

I'm sort of fine with either approach, but it seems perverse to have a
situation where the user asks for a computation and is asked enough
follow-up information, but then gets a noun form even though Maxima
would have successfully worked out the answer if the information had
been provided "up front"!

A hacky work around would be something like trying LIMIT (without Taylor
expansion) and GRUNTZ again after Taylor fails if we can tell that the
assumptions database has changed. Would that be the simplest fix? Or is
there something more sensible to do?

I'm happy to write code, but not sure what the right solution is.


Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20120612/f5553290/attachment-0001.pgp>;