Simple limit returning NaN: f(x) = exp(-1/x)

16 ビュー (過去 30 日間)
Niklas Kurz
Niklas Kurz 2021 年 4 月 12 日
編集済み: John D'Errico 2021 年 4 月 12 日
By intuition and some opinions on Mathstack the limit of this function should be coming close to 0.
However
syms x; limit(exp(-1/x),x,0)
ans = 
NaN
holds another solutions. So?
  1 件のコメント
KSSV
KSSV 2021 年 4 月 12 日
syms x
f = exp(-1/x) ;
limit(f,x,0,'left')
ans = 
limit(f,x,0,'right')
ans = 
0

サインインしてコメントする。

採用された回答

John D'Errico
John D'Errico 2021 年 4 月 12 日
編集済み: John D'Errico 2021 年 4 月 12 日
Think of it like this. For a limit to exist at x==0, it MUST have the same limit as x approaches 0 from above, as it does when x approaches 0 from below.
Is that true? For positive values of x, we can just try a few.
format short g
x = 10.^(-6:1)
x = 1×8
1e-06 1e-05 0.0001 0.001 0.01 0.1 1 10
exp(-1./x)
ans = 1×8
0 0 0 0 3.7201e-44 4.54e-05 0.36788 0.90484
And clearly that seems to approach 0 for small positive values of x. Intuitively, we can guess the limit is zero from above.
syms X
limit(exp(-1/X),X,0,'right')
ans = 
0
As you can see, MATLAB agrees with that. But what happens when x is negative?
x = -0.1;
exp(-1/x)
ans =
22026
Now when x is a small NEGATIVE number, then -1/x is a large positive number. The limit would seem unlikely to be zero when taken from below.
limit(exp(-1/X),X,0,'left')
ans = 
MATLAB agrees with that claim. So the limit is inf when viewed from the left. And as I said, if the limit differs when viewed from different directions, the limit is undefined at that point. If that is the case, then the limit is only defined when viewed from a specific direction.
So don't believe everything you read on the internet, it is not always correct. Whoever claimed that on Mathstack was simply wrong, or perhaps you read what they said incorrectly.

その他の回答 (1 件)

Matt J
Matt J 2021 年 4 月 12 日
編集済み: Matt J 2021 年 4 月 12 日
The function you have shown does not have a well-defined limit as x-->0, but this does:
syms x; limit(exp(-1/abs(x)),x,0)
ans = 
0

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by