<s>[INST] Calculate limit with L'Hopital's rule I want to calculate the limit $\displaystyle{\lim_{x\rightarrow 0}\frac{x^2\cos \left (\frac{1}{x}\right )}{\sin x}}$.
I have done the following:
It holds that $\lim_{x\rightarrow 0}\frac{x^2\cos \left (\frac{1}{x}\right )}{\sin x}=\frac{0}{0}$.
So, we can use L'Hopital's rule:
\begin{align*}\lim_{x\rightarrow 0}\frac{x^2\cos \left (\frac{1}{x}\right )}{\sin x}&=\lim_{x\rightarrow 0}\frac{x^2\cos \left (\frac{1}{x}\right )}{\sin x} \\ &=\lim_{x\rightarrow 0}\frac{\left (x^2\cos \left (\frac{1}{x}\right )\right )'}{\left (\sin x\right )'} =\lim_{x\rightarrow 0}\frac{2x\cdot \cos \left (\frac{1}{x}\right )+x^2\cdot \left (-\sin \left (\frac{1}{x}\right )\right )\cdot \left (\frac{1}{x}\right )'}{\cos x} \\ &=\lim_{x\rightarrow 0}\frac{2x\cdot \cos \left (\frac{1}{x}\right )-x^2\cdot \sin \left (\frac{1}{x}\right )\cdot \left (-\frac{1}{x^2}\right )}{\cos x} \\ & =\lim_{x\rightarrow 0}\frac{2x\cdot \cos \left (\frac{1}{x}\right )+\sin \left (\frac{1}{x}\right )}{\cos x}=\lim_{x\rightarrow 0}\left (2x\cdot \cos \left (\frac{1}{x}\right )+\sin \left (\frac{1}{x}\right )\right ) \\ & =\lim_{x\rightarrow 0}\left (2x\cdot \cos \left (\frac{1}{x}\right )\right )+\lim_{x\rightarrow 0}\left (\sin \left (\frac{1}{x}\right )\right )\end{align*}
We calculate the two limits separately

*

*$\lim_{x\rightarrow 0}\left (2x\cdot \cos \left (\frac{1}{x}\right )\right )$ :

\begin{equation*}\left |\cos \left (\frac{1}{x}\right )\right |\leq 1 \Rightarrow -1\leq \cos \left (\frac{1}{x}\right )\leq 1  \Rightarrow -2x\leq 2x\cdot \cos \left (\frac{1}{x}\right )\leq  2x\end{equation*} we consider the limit $x\rightarrow 0$ and we get \begin{equation*}\lim_{x\rightarrow 0} \left (2x\cdot \cos \left (\frac{1}{x}\right ) \right )=0\end{equation*}

*

*How can we calculate the limit $\lim_{x\rightarrow 0}\left (\sin \left (\frac{1}{x}\right )\right )$ ?

 [/INST] The limit $$\lim_{x\rightarrow 0}\left (\sin \left (\frac{1}{x}\right )\right )$$
does not exist.
Notice that as $x\to 0^+$, $1/x\to \infty$ .
Therefore sin(1/x) jumps up and down between $-1$ and $1$ infinitely many times. 
Thus the limit   $$\lim_{x\rightarrow 0}\left (\sin \left (\frac{1}{x}\right )\right )$$ does not exist. 
You need to try a different approach to avoid this limit. 
</s>