REDUCE

16.42 MRVLIMIT: A new exp-log limits package

Author: Neil Langmead

This package was written when the author was a placement student at ZIB Berlin.

16.42.1 The Exp-Log Limits package

This package arises from the PhD thesis of Dominik Gruntz, of the ETH Zürich. He developed a new algorithm to compute limits of "exp-log" functions. Many of the examples he gave were unable to be computed by the present limits package in REDUCE, the simplest example being the following, whose limit is obviously 0:

load limits;  
 
limit(x^7/e^x,x,infinity);  
 
        7  
       x  
limit(----,x,infinity)  
        x  
       e

This particular problem arises, because L’Hopital’s rule for the computation of indefinite forms (such as 00, or ∞∞-) can only be applied in a CAS a finite number of times, and in REDUCE, this number is 3. Applied 7 times to the above problem would have yielded the correct answer 0. The new algorithm solves this particular problem, and enables the computation of many more limit calculations in REDUCE. We first define the domain in which we work, and then give a statement of the main algorithm that is used in this package.
Definition:
Let [x] be the ring of polynomials in x with real coefficients, and let f be an element in this ring. The field which is obtained from [x] by closing it under the operations f exp(f) and f log |f| is called the L- field (or logarithmico-exponential field, or field of exp-log functions for short).
Hardy proved that every L function is ultimately continuous, of constant sign, monotonic, and tends to ±∞ or to a finite real constant as x +.

Here are some examples of exp-log functions, which the package is able to deal with:

f(x) = ex log(log(x))
f(x) =             −x
log(log(x-+-e--))
ex2 + log(log(x))
f(x) = log(x)log(x)
f(x) = exlog(x)

16.42.2 The Algorithm

A complete statement of the algorithm now follows: Let f be a log-exp function in x, whose limit we wish to compute as x x0. The main steps of the algorithm to do this are as follows:

The algorithm to compute the most rapidly varying subset (the mrv set) of a function f is given below: procedure mrv(f)
if (not (depend(f,x))) → return ({})
               else if f = x → return({x})
               else if f = gh → return(max (mrv(g),mrv(h)))
else if f = g + h → return(max (mrv (g),mrv(h)))
else if f = gc and c ∈ C → return (mrv (g))
else if f = log(g) → return(mrv(g))
          g
else if f = e →
     if limx → ∞ g = ± ∞ →
     return(max ({eg}, mrv (g)))
     else → return mrv (g)
end

The function max() computes the maximum of the two sets of expressions. Max() compares two elements of its argument sets and returns the set which is in the higher comparability class or the union of both if they have the same order of variation.
For further details, proofs and explanations of the algorithm, please consult [Gru96].

For example, we have

mrv(ex) = {ex}
mrv(log(log(log(x + x2 + x3)))) = {x}
mrv(x) = {x}
mrv(ex + ex + x2 + xlog(x)) = {ex,ex}
mrv(eex ) = {ex}

16.42.2.1 Mrv_limit Examples

Consider the following in REDUCE:

mrv_limit(e^x,x,infinity);  
 
infinity  
 
mrv_limit(1/log(x),x,infinity);  
 
0  
 
b:=e^x*(e^(1/x-e^-x)-e^(1/x));  
 
 
           -1        - x  
      x + x      - e  
b := e       *(e         - 1)  
 
 
mrv_limit(b,x,infinity);  
 
 
-1  
 
 
                                       -1  
  ex:=  - log(log(log(log(x))) + log(x))  *log(x)  
 
                       *(log(log(x)) - log(log(log(x)) + log(x)));  
 
 
            - log(x)*(log(log(x)) - log(log(log(x)) + log(x)))  
ex:=     -----------------------------------------------------  
                    log(log(log(log(x))) + log(x))  
 
off mcd;  
 
mrv_limit(ex,x,infinity);  
 
1  
 
 
(log(x+e^-x)+log(1/x))/(log(x)*e^x);  
 
  - x       -1       -1          - x  
e    *log(x)  *(log(x  ) + log(e     + x));  
 
mrv_limit(ws,x,infinity);  
 
0  
 
mrv_limit((log(x)*e^-x)/e^(log(x)+e^(x^2)),x,infinity);  
 
0  

16.42.3 The tracing facility

The package provides a means of tracing the mrv_limit function at its main steps, and is intended to help the user if he encounters problems. Messages are displayed informing the user which Taylor expansion is being computed, all recursive calls are listed, and the value returned by the mrv function is given. This information is displayed when a switch tracelimit is on. This is off by default, but can be switched on with the command

on tracelimit;

For a more complete examination of the workings of the algorithm, the user could also try the command

tr mrv_limit;

This is not recommended, as the amount of information returned is often huge and difficult to wade through. Here is a simple example in REDUCE:

 
Loading image file: /silo/cons/reduce35/Alpha/binary/redu37a.img  
REDUCE Development Version,  4-Nov-96 ...  
 
1: load mrvlimit;  
 
2: on tracelimit;  
 
3: mrv_limit(e^x,x,infinity);  
 
mrv_f is {x}  
 
                     x  
After move_up, f is e  
 
                        -1  
performing taylor on: ww  
 
                      -1  
series expansion is ww  
 
            -1  
series is ww  
 
exponent list is {expt,-1}  
 
leading exponent e0 is {expt,-1}  
 
           x  
mrv_f is {e }  
 
h is x  
 
mrv_f is {x}  
 
                     x  
After move_up, f is e  
 
                        -1  
performing taylor on: ww  
 
                      -1  
series expansion is ww  
 
            -1  
series is ww  
 
exponent list is {expt,-1}  
 
leading exponent e0 is {expt,-1}  
 
                            - x  
small has been changed to e  
 
                                 -1  
After substitution to ww, f is ww  
 
                        -1  
performing taylor on: ww  
 
                      -1  
series expansion is ww  
 
            -1  
series is ww  
 
exponent list is {expt,-1}  
 
leading exponent e0 is {expt,-1}  
 
infinity

Note that, due to the recursiveness of the functions mrv and mrv_limit, many calls to each function are made, and information is given on all calls when the tracelimit switch is on.