Conflicting limit answers using calculator and wolfram alpha

2.5k Views Asked by At

I want to evaluate $\lim\limits_{x\to0} \dfrac{\tan(x) - \sin(x)}{(\sin(x))^3}$,

Calculator says it's 0 when substituted with 0.0000000001.

Wolfram Alpha says it's 1/2.

The Problem Set says the answer is 1/2.

I think I believe Wolfram Alpha more but I've been using the calculator method so I can answer stuff really fast (because it's for a board exam, shouldn't spend too much time deriving) is there a way for me to know?

7

There are 7 best solutions below

7
On BEST ANSWER

$0.0000000001$ is too small of a number: the calculator got such a small answer for the top that it assumed it was zero (since the values subtracted in the numerator were rounded to the same value). The bottom was non-zero, so there was no division by zero error. Zero divided by anything non-zero is zero.

If you're going to use the calculator method, I would try with a bigger number. I think $10^{-5} = 0.00001$ should be small enough to give you a good answer without causing you to run into this situation.

3
On

One way to do it by hand is to use Taylor Series. For $x\to 0$, $\tan x = x+\frac 13x^3+o(x^3), \sin x = x - \frac 16x^3+o(x^3)$ So $$\frac {\tan x - \sin x}{\sin^3 x}= \frac {\frac12x^3+o(x^3)}{x^3}=\frac12+o(1)\to\frac12$$

0
On

The problem is not just that $\tan x - \sin x$ is approaching zero rapidly; the real problem is that as $x$ approaches zero, $\tan x - \sin x$ approaches zero much more rapidly than either $\tan x$ or $\sin x$, because (as shown by Ross Millikan) $\tan x - \sin x \approx \frac12 x^3$ but $\tan x \approx x + \frac13 x^3$ and $\sin x \approx x - \frac16 x^3.$ At some point, for very small $x$, $x^3$ is so much smaller than $x$ that $x + \frac13 x^3$ and $x - \frac16 x^3$ round to the same number inside the calculator, with the result that $\tan x - \sin x$ is evaluated to $0$ exactly. This is an extreme example of cancellation error, a well-known bugaboo of numeric computing methods.

For example, Google says (tan(0.0000001)-sin(0.0000001))/(sin(0.0000001))^3 is $0.5029258124$ but (tan(0.00000001)-sin(0.00000001))/(sin(0.00000001))^3 is $0.$ Trying various other values of $x$ such as $0.001,$ $0.0001,$ $0.00001,$ and $0.000001$ shows that the value calculated by Google actually starts to diverge away from $\frac12$ (presumably due to cancellation error) for input much smaller than $x=0.0001$.

0
On

If you can use the standard limits \begin{equation*} \lim_{x\rightarrow 0}\frac{\tan x-x}{x^{3}}=\frac{1}{3},\ \text{and}\ \lim_{x\rightarrow 0}\frac{x-\sin x}{x^{3}}=\frac{1}{6},\ \ \ \ \text{and}\ \ \ \ \ \lim_{x\rightarrow 0}\frac{x}{\sin x}=1 \end{equation*} then, \begin{eqnarray*} \lim_{x\rightarrow 0}\frac{\tan x-\sin x}{\sin ^{3}x} &=&\lim_{x\rightarrow 0}\frac{\tan x-\sin x}{x^{3}}\cdot \left( \frac{x}{\sin x}\right) ^{3}= \\ &=&\lim_{x\rightarrow 0}\left( \frac{\tan x-x}{x^{3}}+\frac{x-\sin x}{x^{3}}% \right) \cdot \left( \frac{x}{\sin x}\right) ^{3} \\ &=&\left( \frac{1}{3}+\frac{1}{6}\right) \cdot \left( 1\right) ^{3} \\ &=&\frac{1}{2}. \end{eqnarray*}

1
On

As a rule of thumb, try express everything in term of either $\sin(x)$ or $\cos(x)$ to see whether there is any obvious cancellation. For this case, we have $$\frac{\tan(x) - \sin(x)}{\sin(x)^3} = \frac{\frac{\sin(x)}{\cos(x)} - \sin(x)}{\sin (x)^3} = \frac{1-\cos(x)}{\cos(x)(1-\cos(x)^2)} = \frac{1}{\cos(x)(1+\cos(x))}$$ you don't need any calculator to know the limit is $\frac12$.

0
On

tan(x) and sin(x) are equal numbers in a calculator for small enough x because the calculator does not represent enough digits. Hence the numerator turns to 0.

In the Windows calculator, your example works fine, but: sin(0.0000000000000001) = tan(0.0000000000000001) = 1.7453292519943295769236907684886e-18

The difference is in the mantissa (the first part), which cannot properly represent such tiny sines and tangents. It needs more digits because that's where the difference between sine and tangent show up with such tiny x. This would be important in any formula that relied on those functions with such tiny values -- the output of the formula would be junk. After all, if sin(x) = tan(x) for every tiny number, well, now what?

Note that it will happily cube the sin, though. 1.7453292519943295769236907684886e-18 cubed is

5.3165769342077880959321527892834e-54

And 0 divided by that is still 0 (the original problem result). Note sin cubed of a junk sin value (also equal to tan) is also meaningless. It's the mantissa (the first part) not the exponent (the second part) that has strayed into meaninglessness.

0
On

The problem is rounding and precision. Assuming that we are using radians $$ \sin(0.0000000001)\doteq0.0000000000999999999999999999998333333333 $$ and $$ \tan(0.0000000001)\doteq0.0000000001000000000000000000003333333333 $$ both of which, when rounded to $20$ significant places are $$ 0.000000000100000000000000000000 $$ Thus, assuming the calculator has no more than $20$ significant digits, the difference computed by the calculator would be zero.


Since $$ \sin(x)=x-\frac16x^3+\frac1{120}x^5+O(x^7) $$ and $$ \tan(x)=x+\frac13x^3+\frac2{15}x^5+O(x^7) $$ we get $$ \frac{\tan(x)-\sin(x)}{\sin^3(x)}=\frac{\frac12x^3+\frac18x^5+O(x^7)}{x^3-\frac12x^5+\frac{13}{120}x^7+O(x^9)}=\frac12+\frac38x^2+O(x^4) $$ Therefore, if the calculator had enough precision, it would have gotten $$ \frac{\tan(x)-\sin(x)}{\sin^3(x)}\doteq0.500000000000000000003750000000 $$ for $x=0.0000000001$.