# [Maxima] extending limit

Richard Hennessy rich.hennessy at verizon.net
Tue Sep 8 14:16:42 CDT 2009

```If you are going to extend limit consider the code I wrote in pw.mac for the pwlimit function.  Although it is rather simple and can't handle very many expressions, it can handle enough to satisfy the needs of pw.mac.

I read Barton's paper and noticed that the limit of many expressions are piecewise functions.  So limit(x^k, k, inf) = piecewise([minf, und, -1, und, -1, 0, 1, 1, 1, inf, inf], x, 'open) which results in an expression wholly unreadable.  I have been somewhat lazy in my work on the piecewise function so if you try to make this mess look comprehensible you get this.

piecewise([minf, und, -1, und, -1, 0, 1, 1, 1, inf, inf], x, 'array);
[ If  x  in  [  minf  ,  - 1  ]  pw(x)  =  und ]
[                                              ]
[ If  x  in  [  - 1   ,  - 1  ]  pw(x)  =  und ]
[                                              ]
[ If  x  in  [  - 1   ,   1   ]  pw(x)  =   0  ]
[                                              ]
[ If  x  in  [   1    ,   1   ]  pw(x)  =   1  ]
[                                              ]
[ If  x  in  [   1    ,  inf  ]  pw(x)  =  inf ]

which has the brackets wrong.  piecewise should use the open interval here (minf, -1) not [minf,-1].   If you say

piecewise([minf, und, -1, und, -1, 0, 1, 1, 1, inf, inf], x, 'array, 'open);

it ignores the 'open which is a bug.  I think I will fix this.  It would not be that hard and the piecewise function would be more useful.

Rich

----- Original Message -----
From: Richard Fateman
To: Raymond Toy
Cc: maxima at math.utexas.edu ; Barton Willis
Sent: Tuesday, September 08, 2009 12:42 PM
Subject: Re: [Maxima] extending limit

I've been critical of Mathematica's use of Intervals  for the result of Limit, but perhaps we could come up with something similar.

Mathematica says this..

Limit[Sin[x],x->Infinity]    is  Interval[{-1,1}]

I object to the overloading of the "interval" arithmetic to represent this,  but I would not mind a notion of a limit set or constraint or something like that.

e.g.  limit(sin(x),x,inf)  might be  bounds(-1,1).

To some extent  bounds(a,b) can be handled arithmetically like an interval   (which Maxima does not have now anyway!)
but it fails to satisfy the epsilon-delta kind of definition of limit, or consequences that follow from that. But I have not
fully thought this through.
RJF

Raymond Toy wrote:
Barton Willis wrote:
I was playing with the idea of appending a simplim%function for the
hypergeometric
functions. To start, I wrote some 100% fake code:

[snip]
Limit assumes continuity?

(%i14) limit(hypergeometric([a],[b],x),x,0);
(%o14) 1

Limit doesn't even try limit-hg?

(%i16) limit(hypergeometric([a],[b],x),a,0);
(%o16) limit(hypergeometric([a],[b],x),a,0)

This is caused by the following in simplimit:

(defmfun simplimit (exp var val &aux op)
(cond
((eq var exp) val)
((or (atom exp) (mnump exp)) exp)
((and (not (infinityp val))
;; *** HERE ***
(not (amongl '(%sin %cos %atanh %cosh %sinh %tanh mfactorial %log)
exp))
(not (inf-typep exp))
(simplimsubst val exp)))

Since hypergeometric isn't among the list of "special" functions,
simplimsubst is called.

This looks like a bug in simplimit.  The list of special functions needs
to expanded.  Or probably better, it should be removed and the rest of
the code adjusted accordingly so that the special limit functions can
decide what to do about continuity and such.

Ray

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

--------------------------------------------------------------------------------

_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090908/a4de3f6e/attachment-0001.htm
```