Why values close to critical point in limit are giving different outputs?

71 Views Asked by At

In evaluation of limits , there's a critical point c at which the output becomes indeterminate, like 0/0 etc. Now I came across some weird examples where when I tried putting values close to that critical value, but I got output different from the answer analytical evaluation gave me.

Example 1: $$f(x)=\frac{\sin\left(\pi {\left(\cos\left(x\right)\right)}^{2}\right)}{{x}^{2}}$$ In this function if we take limit as x-->0 then we should get π. But I tried putting values close to zero in desmos: enter image description here

Everything goes fine till 10^-5 but after that values start getting deflected from π and after that the value goes to ZERO!!

Example 2: $$f(x)=(\frac{1-5{x}^{2}}{1-3{x}^{2}}{)}^{\frac{1}{{x}^{2}}}$$ In this example if we take limit as x-->0 I should get e^2 which is approx 7.38905609893. But this is what happened in desmos:

enter image description here

At x=10^-7 , the output suddenly became more INACCURATE and more inaccurate at 10^-8 and then goes straight to ONE!!

Main question: Why are the output values different from the expected answer from analytical method and more importantly why are they following this ambiguous pattern?

1

There are 1 best solutions below

0
On

To help illustrate my comment. Look at your second example, though as given in Desmos, not the altered version you reproduced in the question:

$$h(x)=\left(\frac{1+5x^2}{1+3x^2}\right)^{\frac 1{x^2}}$$

The double precision floating point number that is commonly used for computing can store numbers to about 16 digits of accuracy. That is, starting with the leading non-zero digit in the actual number, It can store roughly only the next 16 digits ("roughly" because it actually stores the number in binary, not decimal). Now look what happens when you try to calculate $h(x)$ for $x = 10^{-9})$. First, it calculates

  • $1 + 5x^2 = 1 + 5\times 10^{-18} = 1.000,000,000,000,000,005$, except that is 19 digits, and it can only store about 16. So it rounds it to the nearest number it can store: $1$.
  • $1 + 3x^2 = 1.000,000,000,000,000,003$. Again, this is rounded to $1$.

Since the ratio of $1$ to $1$ is $1$, and $1$ raised to any power is $1$, it calculates $h(10^{-9}) = 1$.

At $x=10^{-8}$, it can just barely fit in a bit of extra information (though you need to look at the actual binary representation to see why), but that information is not enough to accurately calculate the value, so you get the bad result. Even at $x = 10^{-7}$, there is not enough precision to get more than a couple digits of accuracy.