Limit seems to be zero when ploting but its not

53 Views Asked by At

When ploting the following function $$f(x)=\frac 1x e^{x^2}(1-e^{-xe^{-x^2}})$$ we are tempted to say that $\lim_\infty f(x)=0$ (the function is extremely close to $0$ until $10^8$ where it disappears for computer reasons), but when computing the real limit, we find $\lim_\infty f(x)=1$. I really want to see when does the function start going to $1$ and how it starts behaving in an other way than just being constantly $0$.

3

There are 3 best solutions below

0
On

Let $y = g(x) = e^{x^2}/x$. Then $y \to \infty$ as $x \to \infty$, and

$$f(g^{-1}(y)) = y (1 - e^{-1/y}).$$ So it suffices to look at the limit of this function as $y \to \infty$, which is much easier for computers to handle.

0
On

For what its worth, showing the limit is $1$ is not very hard. $$\exp(-x\exp(-x^2))=\frac{1}{\exp(x\exp(-x^2))}=\frac{1}{\exp\left(\frac{x}{\exp(x^2)}\right)}\approx \frac{1}{1+\frac{x}{\exp(x^2)}} \\ =\frac{\exp(x^2)}{\exp(x^2)+x}$$ And so $$1-\exp(-x\exp(-x^2))\approx \frac{x}{\exp(x^2)+x}$$ These approximations become exact as $x\to \infty$ that is to say $$1-\exp(-x\exp(-x^2))\asymp \frac{x}{\exp(x^2)+x} \\ \text{as}~x\to\infty$$ So $$\lim_{x\to\infty}f(x)=\lim_{x\to\infty}\frac{\exp(x^2)}{x}\frac{x}{\exp(x^2)+x} \\ =\left(\lim_{x\to\infty}\frac{\exp(x^2)+x}{\exp(x^2)}\right)^{-1} =\left(1+\lim_{x\to\infty}\frac{x}{\exp(x^2)}\right)^{-1} \\ =1.$$

0
On

Expand the second term between brackets in a Taylor series. This leads to the expression:

$$f(x) = 1 - (1/2) x e^{-x^2} + (1/6)x^2 e^{-2x^2} - ....$$

This shows that $f$ is equal to $1$, both for $x=0$ and for $x$ in the limit to $+\infty$. For values in between $f$ is slightly smaller than $1$. If you take only the constant term and the next one, you find that the minimum occurs around $x = (1/2)\sqrt2 \simeq 0.7$.