OK tsal15 just a minute

Differentiate $\displaystyle \frac{xcosx-sinx}{x^2}$ is $\displaystyle \frac{-x^2sinx-2xcosx+2sinx}{x^3}$ (sign mistake I think)

Anyway it does not matter because this is not what L'Hopital's rule says

It says

$\displaystyle \lim_{x\rightarrow 0}\frac{f(x)}{g(x)}\:=\:\lim_{x\rightarrow 0}\frac{f'(x)}{g'(x)}$

You do not need to differentiate $\displaystyle \frac{f(x)}{g(x)}$

Therefore

$\displaystyle \lim_{x\rightarrow 0}\frac{xcosx-sinx}{x^2}$ is $\displaystyle \lim_{x\rightarrow 0}\frac{-xsinx}{2x}$