# Conflicting limit answers using calculator and wolfram alpha

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?

• If you want to do it by hand you can save some time by rewriting your expression as $\lim_{x\to 0} \frac{\sec x - 1}{\sin^2x}$. – Rolf Hoyer Jun 11 '15 at 0:29
• Your calculator might have some strange way it evaluates operations. I would add more parenthesis to try and get the calculator to do what you want it to do rather than what it thinks you wants to see if it gets a different answer. – Rory Grice Jun 11 '15 at 0:34
• What did you DO with your calculator to get that? The numerator and denominator are both approaching $0$; did you divide $0$ by $0$? If your calculator thinks $0/0=0$, don't believe it. ${}\qquad{}$ – Michael Hardy Jun 11 '15 at 0:54
• @Omnomnomnom was right; 0.0000000001 is too small of a number. 0/0 is math error. using casio fx-991es plus – james Jun 11 '15 at 1:05
• @MichaelHardy the calculator probably knows that $\sin(0.0000000001) \neq 0$. However, it can't calculate $(0.5 + \epsilon) - 0.5$ accurately since it calculates $0.5 + \epsilon = 0.5$ – Omnomnomnom Jun 11 '15 at 1:24

$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.

• Up vote this nice answer. But personally i don't think calculator method can "give you a good answer" anyway. For example, a calculator would almost definitely lead you astray if you would try to find the "value" of $\zeta(1)$ with that. So I suggest you say "help you make a good guess" instead. – Vim Jun 11 '15 at 4:32
• Even 0.001 will give you a nice answer. Checkout this. – ps95 Jun 11 '15 at 5:43
• @Vim I think the calculator method can probably give you a "good enough" answer on an exam like OP's board exam, where time is apparently an issue. – Omnomnomnom Jun 11 '15 at 9:52
• I don't think this answer is quite correct. A calculator that uses floating point numbers is unlikely to round a very small number to zero. My guess is that $\sin 0.0000000001$ and $\tan 0.0000000001$ are so close together that the calculator rounded the two numbers to exactly the same number, meaning that it subtracted two identical numbers, getting zero. – Tanner Swett Jun 11 '15 at 20:45
• @TannerSwett that's what I meant by what I said; maybe I didn't word it clearly. – Omnomnomnom Jun 11 '15 at 20:55

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$.

• You beat me to it! Cleanest approach. – ps95 Jun 11 '15 at 5:34

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$$

• A small nitpick: the symbol $\approx$ makes the expansion look sketchy and somewhat handwavy, which may confuse the reader or OP; while this is fully well-defined and a valid and rigorous statement ($\tan x = x + \frac{1}{3}x^3 + o(x^3)$). – Clement C. Jun 11 '15 at 0:44
• @ClementC. +1. I'm always trying to use $\approx$ as little as possible because it looks flippant. – Vim Jun 11 '15 at 4:26
• I'd say it's rather silly to say $\approx$ looks handwavy, it's so utterly clear from the context that it's shorthand for $\mathcal{O}$(whatever the degree of the next term would have been). Rigorous math doesn't equal notation-anal math... – Benjamin Lindqvist Jun 12 '15 at 16:55

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$.

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*}

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.

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$.