I'm considering this limit: $$\lim\limits_{x \to 0} \frac{x \cos(x) - \sin(x)}{x \sin^2(x)}$$
If I apply de l'Hôpital's rule I get $-\frac{1}{3}$, while if I immediately simplify the $x$ like this:
$$\frac{\cos(x) - \frac{\sin(x)}{x}}{\sin^2(x)}$$
I get $-\frac{1}{2}$ as result, because I write it as (remembering that $\frac{sin(x)}{x} = 1$):
$$\frac{cos(x) - 1}{x^2}$$
which I simplify it with $-\frac{1}{2}$.
What am I getting wrong?