       Re: Bug in Limit ?

• To: mathgroup at smc.vnet.net
• Subject: [mg26011] Re: [mg25951] Bug in Limit ?
• From: bernd at bio.vu.nl (Bernd Brandt)
• Date: Thu, 16 Nov 2000 03:43:00 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```Hi Bob,

In Mathematica 3.0 and 4.0 I also found a bug in Calculus Limit. I i have included
examples. The bug was reported to Wolfram, their comment was that it is

When approximate numbers are used for parameters with Calculus'Limit'
results are incorrect! Bugs is still present in Mathematica 4.0, but ... it is

Examples are from Fred Simons.

Regards,
Bernd

An obvious example with exponential functions

In:=
<< Calculus`Limit`

In:=
Limit[Exp[-a t] (-S + Exp[a t] S), t -> Infinity]

Out=
S

How does Mathematica know the Limit is S. It  assumes a>0 !!
[N.B. the kernel's Limit does not assume this and returns the expression]

In:=
a = 1; S = 2.5;
Limit[Exp[-a t] (-S + Exp[a t] S), t -> Infinity]

Out=
0

!!! Zero !????

In:=
a = 1; S = 5/2;
Limit[Exp[-a t] (-S + Exp[a t] S), t -> Infinity]

Out=
\!\(5\/2\)

In:=
Limit[ Exp[ 0.t], t -> \[Infinity]]

Out=
1

Why "1" 0. is not exactly zero, the limit could be 0, 1, or infinity

Notice the difference between the Limits below. In the first case the
answer is "1" in the second is should also be "1" then!

In:=
Limit[ 20 Exp[ 0.t], t -> \[Infinity]]

Out=
1

In:=
Limit[ b Exp[ 0.t], t -> \[Infinity]]

Out=
b

BobHanlon at aol.com wrote:

In a message dated 11/14/00 4:27:00 AM, mtpagesj at lg.ehu.es writes:

>This looks like a bug in the package Calculus`Limit`
>
>In:= \$Version
>Out= "4.0 for Power Macintosh (July 20, 1999)"
>
>In:= << Calculus`Limit`
>
>In:= Limit[(2^(n + 1) + 3^(n + 1))/(2^n + 3^n), n -> Infinity]
>Out= 9
>
>The calcultion was done in a G4. The same result was obtained in version
>3
>under windows.
>

It is definitely wrong.  It does much better if you simplify the expression
before taking the limit.

Needs["Calculus`Limit`"];

Limit[(2^(n + 1) + 3^(n + 1))/(2^n + 3^n), n -> Infinity]

9

(2^(n + 1) + 3^(n + 1))/(2^n + 3^n) // FullSimplify

3 - 1/(1 + (3/2)^n)

Limit[%, n -> Infinity]

3

Plot[(2^(n + 1) + 3^(n + 1))/(2^n + 3^n), {n, 0, 20}];

Bob Hanlon

```

• Prev by Date: Re: how to differentiate a list?
• Next by Date: embedding Mathematica equations in MS Word part 2
• Previous by thread: Re: Bug in Limit ?
• Next by thread: NDSolve help needed for nonlinear eq.