Earlier this week a colleagues approached me with a problem he was trying to solve with Maple.

The basic problem is to compute the asymptotic expansion of an expression. It's not difficult to see the leading term of this expansion, but Maple's result does not match this expectation. Let me demonstrate:

B := (n,h) -> (n+h)!/r^(n+h) * (1+(P0+h*P1)*r/n);

/ (P0 + h P1) r\

factorial(n + h) |1 + -------------|

\ n /

(n, h) -> ------------------------------------

(n + h)

r

simplify( asympt( B(n,1)/B(n,0)-1, n, 3 ) );

n + O(1)

asympt( simplify( B(n,1)/B(n,0)-1 ), n, 3 );

2

n 1 + r P1 - r P0 r + r P1 - r P0 + (-1 - r P1 + r) P0 r

- + ------------ + ------------------------------------------

r r r n

/ 2 \

\-r P1 + P0 r P1/ P0 /1 \

+ --------------------- + O|--|

2 | 3|

n \n /

The real issue is the drastically different results from the previous two commands. The only difference in the commands is the explicit simplify before or after the call to asympt.

It would be best if this last expression could be seen in the form:

(n+1)/r + (P1-1) + (1-r*P0)*P1/n - r*(1-r*P0)*P0*P1/n^2 + O(1/n^3);

n + 1 (1 - P0 r) P1 r (1 - P0 r) P0 P1 /1 \

----- + P1 - 1 + ------------- - ------------------ + O|--|

r n 2 | 3|

n \n /

What's the difference in the two uses of asympt? This simpler example appears to show the essence of what is going on. On one hand,

B := (n,h) -> 1/r^(n+h);

1

(n, h) -> --------

(n + h)

r

simplify( asympt( B(n,1)/B(n,0)-1, n, 3 ) );

Error, (in asympt) unable to compute series

while on the other hand

asympt( simplify( B(n,1)/B(n,0)-1 ), n, 3 );

r - 1

- -----

r