[Maxima] infinitesimal limit wizard

miguel lopez miguel39123 at hotmail.com
Fri Dec 22 08:40:31 CST 2006

```Stavros Macrakis <macrakis <at> alum.mit.edu> writes:
Can you show that your result is
> correct?
>
>               -s
> This is the source code, I think is simple enough to understand, it can be
improved easily.  But is not tested, I have done it this morning, perhaps I can
document the code.

h(x):= block([re],re:g(x), if re=false then x else re);

lst1:[sin,asin,sinh,tan,atan,tanh];
lst2:[cos,cot];

inflag:true;
var:x;
x0:0;

g(x):=block([o,a,re],
if atom(x) then return(x),
o: op(x),u:args(x)[1],
if o ="^"  then
(re:g(u), if re = false then return(x) else return (re^args(x)[2])),
if op(x)="*"  then return(map(h,x)),
if member(o,lst1) then return(try(u)),
if member(o,lst2) then return(try(%pi/2 - u)),
if o='log then return(try(u-1)) else return(x));

try(a):= block([ga],ga:g(a),
if ga # a then return (g(ga)),
if limit(a,var,x0)=0 then pr(a) else false);

pr(f):= block([re],re: first(ratdisrep(taylor(f,var,x0,20))),
if (re # 0) then re else f);

```