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


To use L'Hospital rule, one needs to check if $\lim_{x\rightarrow 0}\dfrac{f'(x)}{g'(x)}$ exists. So in this case the topologist's sine curve $\sin(1/x)$ does not have limit whenever $x\rightarrow 0$, so L'Hospital rule fails to apply.
Now use the trick like 
\begin{align*}
\lim_{x\rightarrow 0}\dfrac{x}{\sin x}=1
\end{align*}
and that 
\begin{align*}
\lim_{x\rightarrow 0}x\cos(1/x)=0
\end{align*}
to conclude that the limit value is zero.
For the proof of $x\cos(1/x)\rightarrow 0$ whenever $x\rightarrow 0$:
\begin{align*}
|x\cos(1/x)|\leq|x|,
\end{align*}
and now use Squeeze Theorem to conclude that $\lim_{x\rightarrow 0}x\cos(1/x)=0$ because of that $\lim_{x\rightarrow 0}|x|=0$.
To claim that the topologist's sine curve does not have limit as $x\rightarrow 0$, simply let $a_{n}=\dfrac{1}{2n\pi}$ and $b_{n}=\dfrac{1}{2n\pi+\pi/2}$, so $a_{n},b_{n}\rightarrow 0$ but $\sin(1/a_{n})=0\rightarrow 0$ and $\sin(1/b_{n})=1\rightarrow 1$, the function has two distinct limit points whenever $x\rightarrow 0$, so the limit does not exist. 
