<s>[INST] Using L'hopital's rule to prove differentiability 
Question: Define
  $$
f(x) = \left\{\begin{aligned}
& \frac{2x\cos(x)}{x+\sin(x)}  &&: x \ne 0 \\
&1 &&: x = 0
\end{aligned}
\right.$$
Show $f'(0)$ exist and find the value of it.

My Attempt:
After applying L'Hôpital's rule once I get $$\lim \limits_{h \to 0} \frac{2\cos(x)-2x\sin(x)}{2x+\sin(x)+x\cos(x)}$$
I cannot continue with L'hopital's rule as it is no longer in the $\frac{0}{0}$ form.
Where am I going wrong? Thank you.
 [/INST] You can simply do it as follows
\begin{align}
f'(0) &= \lim_{x \to 0}\frac{f(x) - f(0)}{x}\notag\\
&= \lim_{x \to 0}\frac{2x\cos x - x - \sin x}{x^{2} + x\sin x}\notag\\
&= \lim_{x \to 0}\dfrac{2x\cos x - x - \sin x}{x^{2}\left(1 + \dfrac{\sin x}{x}\right)}\notag\\
&= \frac{1}{2}\lim_{x \to 0}\dfrac{2x\cos x - 2x + x - \sin x}{x^{2}}\notag\\
&= \frac{1}{2}\lim_{x \to 0}\frac{x - \sin x}{x^{2}} - 2x\cdot\frac{1 - \cos x}{x^{2}}\notag\\
&= \frac{1}{2}\left(0 - 2\cdot 0\cdot\frac{1}{2}\right)\notag\\
&= 0\notag
\end{align}
The limit $$\lim_{x \to 0}\frac{x - \sin x}{x^{2}} = 0$$ can be evaluated easily by Taylor series, L'Hospital, or squeeze theorem.
</s>