What is wrong with the calculation $ \lim\limits_{x \to 0} \frac {x \cos x - \sin x} {x^2 \sin x} $? We are given
$$ \lim _{x \to 0} \frac {x \cos x - \sin x} {x^2 \sin x} $$
We can write
$$ L = \lim _{x \to 0} \frac {x \cos x - \sin x} {x^2 \sin x} = \lim _{x \to 0} \frac {x (cos x - \sin x/x)} {x^2 \sin x} $$
It can be written as
$$ L = \lim _{x \to 0} \frac { \cos x - \sin x/x} {x^2 \sin x/x} $$
We know
$$ \lim _{x \to 0} \frac {\sin x} {x} = 1 $$
The original limit can be written as
$$ L = \lim _{x \to 0} \frac { \cos x - 1} {x^2} $$
Now using $ ( \cos x ) $ expansion formula, the answer will be $ L = -\frac12$ , but the answer is $ L = -\frac13$ , which is not matching.
I want to know what I did wrong in this method. I know the answer using other methods, but I want to know what went wrong with this one.
 A: Your mistake was to replace $\frac {\sin x}x$ by its limit and then take again the limit of the resulting expression.
Generally, as your example shows,
$$\lim_{x\to a}f(x,g(x))\ne
\lim_{x\to a}f(x,\lim_{x\to a}g(x)).$$
A simpler counterexample is:
$$\lim_{x\to0}\frac xx=1\ne0=
\lim_{x\to0}\frac{\lim_{x\to0}x}x.$$
A: To check where it went wrong , let us use Series Expansion :
$ L = \lim _{x \to 0} \frac {x \cos x - \sin x} {x^2 \sin x} $
$ L = \lim _{x \to 0} \frac { x ( 1-x^2/2!+x^4/4!-x^6/6! \cdots ) - ( x-x^3/3!+x^5/5!-x^7/7! \cdots ) } {x^2 ( x-x^3/3!+x^5/5!-x^7/7! \cdots ) } $
$ L = \lim _{x \to 0} \frac { ( x-x^3/2!+x^5/4!-x^7/6! \cdots ) - ( x-x^3/3!+x^5/5!-x^7/7! \cdots ) } { ( x^3-x^5/3!+x^7/5!-x^9/7! \cdots ) } $
$ L = \lim _{x \to 0} \frac { -x^3/3 + (x^5/4!-x^7/6! \cdots ) - (x^5/5!-x^7/7! \cdots ) } { ( x^3 + (-x^5/3!+x^7/5!-x^9/7! \cdots) ) } $
$ L = \lim _{x \to 0} \frac { -1/3 + (x^2/4!-x^4/6! \cdots ) - (x^2/5!-x^4/7! \cdots ) } { ( 1 + (-x^2/3!+x^4/5!-x^6/7! \cdots ) ) } $ [[ Cancelling $x^3$ through out ]]
$ L = \lim _{x \to 0} \frac { -1/3 + 0 - 0 } { ( 1 + 0 ) } $ [[ Setting $x=0$ through out ]]
$ L = -1/3 $ & there is no Doubt about this Answer.
Now we get a clue or hint about what went wrong.
The given limit is $ ( \infty - \infty ) $ where we can not take the Individual limits.
Numerator is in the format $ (x+A_1x^3+A_2x^5 \cdots ) - (x+B_1x^3+B_2x^5 \cdots ) $
Denominator is in the format $ (x^3+C_1x^5+C_2x^7 \cdots ) $
Numerator will be cancelling the $ (x) - (x) $ terms.
Denominator & Numerator will then have Common $ (x^3) $ which will be cancelling throughout.
We want both $ A_1 = -1/2 $ & $ B_1 = -1/6 $ to get the Exact limit $ L = A_1 - B_1 = (-1/2) - (-1/6) = (-1/3) $ which is Correct.
Whereas by taking Individual limit earlier , we are keeping $ A_1 = -1/2 $ while losing $ B_1 = -1/6 $ , hence getting the limit $ L = A_1 = -1/2 $ which is wrong.
Developing that Core Point with Extreme Detail :
We have $ L = \frac{ (x+A_1x^3+A_2x^5 \cdots ) - (x+B_1x^3+B_2x^5 \cdots ) }{ (x^3+C_1x^5+C_2x^7 \cdots ) } $
In the Denominator , we take $x^3=x \cdot x^2$ & leave the $x^2$ in the Denominator , to use the $x$ on the Numerator $A$ & $B$ terms to get :
$ L = \frac{ (x+A_1x^3+A_2x^5 \cdots )/x - (x+B_1x^3+B_2x^5 \cdots )/x }{ (x^2+C_1x^4+C_2x^6 \cdots ) } $
We have $ L = \frac{ \cos x - (1+B_1x^2+B_2x^4 \cdots ) }{ (x^2+C_1x^4+C_2x^6 \cdots ) } $
It is Correct till here.
The trouble starts now.
We are now using $ ( \sin x ) / ( x ) = 1 $ , thereby losing $B_1$ , yet keeping $A_1$ in the $ ( \cos x ) $ term. That is WRONG ! We have to Consistently keep both terms having the Same Power !
When we take over-all limit while keeping both $A$ term & $B$ term having the $x^3$ Power , we get $L=-1/3$ , which is Correct.
A: You should not be taking a limit, then taking it again for what you get after having taken the first limit. The correct way of evaluating the limit would be to split the fraction up at the point of $\frac{\cos{x}-\sin{x}/x}{\sin{x}/x},$
and to proceed from there, eventually applying the Taylor expansion, or just to use l'Hopital's rule.
A: The thing is you can take a partial limit when it only involves products (or quotients). Here there is an additive $\cos(x)$ term so you cannot do that.
Remember that $\cos(x) = 1 - \frac{x^2}{2} + o(x^2)$ and $\frac{\sin x}{x} = 1 - \frac{x^2}{6} + o(x^2)$ therefore $\cos x - \frac{\sin x}{x} = -\frac{x^2}{3} + o(x^2)$ which means that $ \frac { \cos x - \sin x/x} {x^2 }\to -\frac{1}{3}. $
Therefore $$\lim_{x \to 0} \frac { \cos x - \sin x/x} {x^2 \sin x/x} = \lim_{x \to 0} \frac { -\frac{1}{3} } {\sin x/x} = -\frac{1}{3}  $$
