Re: mathematica gets a simple limit wrong?
- To: mathgroup at smc.vnet.net
- Subject: [mg24654] Re: [mg24633] mathematica gets a simple limit wrong?
- From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
- Date: Mon, 31 Jul 2000 09:23:23 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
on 7/28/00 11:24 PM, danckel at my-deja.com at danckel at my-deja.com wrote:
> Could anyone explain the following output of mathematica 4.0:
> In:= 1+Limit[a-Sqrt[a^2-a],a->Infinity]
> Out:= 3/2
> Out:= 1 ????!!!!!!!!!!!
> Huh? I just moved the 1 inside the brackets and got a wrong answer?
> Makes me wonder about mathematica.
> Sent via Deja.com http://www.deja.com/
> Before you buy.
This is clearly a bug, (though perhaps an understandable one). However, I
feel the first thing that needs to be said is that in this, as in most other
cases, Mathematica offers lots of ways to get the right answer. This is
indeed its greatest strength. Personally I would never even think of using
limit in a case like this (or most other cases) since the following approach
is far more reliable:
f[x_] := 1 + x - Sqrt[x^2 - x]
Normal[f[x] + O[x, Infinity]^2]
There are also two ways to get the right answer by laoding standard
Limit[f[x], x -> Infinity]
NLimit[f[x], x -> Infinity]
Actually, even when all such answers agree I do not think you should rely on
an answer given not just by Mathematica but by any symbolic algebra program.
They should only be treated as "guesses" whcih should be justified
mathematically. But this is another issue.
There is also the question of how the bug arises. Of course not having
access to the source code one can't be sure but one can make a guess.
Starting with a new kernel (to remove the effects of the external packages):
f[x_] := 1 + x - Sqrt[x^2 - x];g[x_] := f[1/x];
-2 1 1
1 - Sqrt[x - -] + -
Limit[g[x], x -> 0]
1 - x
1 + x - Sqrt[-----] x
Limit[Together[g[x]], x -> 0]
It seems that in the second case Mathematica correctly used the l'Hospital
rule. It is not clear to me how Mathematica arrives at its (wrong) answer 1
in the first case, though it seems to me not entirely surprising that it
"can't see" the, not entirely obvious, need to apply Together before using
the l'Hospital rule.
Toyama International University, JAPAN
For Mathematica related links and resources try:
Prev by Date:
Re: Help on Partitions, Again!!!
Next by Date:
RE: Need help defining an Octahedron
Previous by thread:
mathematica gets a simple limit wrong?
Next by thread: