Why doesn't L'Hôpital's rule work in this case?

I have a very simple question. Suppose I want to evaluate this limit:

$$\lim_{x\to \infty} \frac{x}{x-\sin x}$$

It is easy to evaluate this limit using the Squeeze theorem (the answer is $1$). But here both the numerator and the denominator are going to infinity as $x\to \infty$ so I tried using L'Hospital's rule: $$\lim_{x\to \infty} \frac{x}{x-\sin x}=\lim_{x\to \infty} \frac{1}{1-\cos x}$$

However there's no finite $L$ such that $$\lim_{x\to \infty} \frac{1}{1-\cos x}=L$$ which is a contradiction. I don't understand why in this case L'Hopital's rule doesn't work. Both the numerator and the denominator are differentiable everywhere and both are tending to infinity - which is all we need to use this rule.


A precondition in l'Hospital's Rule is that in order for it to apply, the limit $$ \lim_{x\to\infty}\frac{f'(x)}{g'(x)} $$ must exist (but is allowed to be $\pm \infty$). In this case, the limit does not exist, so it does not apply.


Another condition, very often forgotten, is that in some neighbourhood of $a$ (here $a=+\infty$), except perhaps at $a$, $g'(x)\neq 0$. This is not the case here: $1-\cos x$ is $0$ infinitely many times.

This is a good illustration why L'Hospital's rule is dangerous. One of the first things I learnt when I was a student is: ‘Avoid it. When it works, Taylor's polynomial at order 1 works as well.’

Here, the simplest way is via equivalents: $\,x-\sin x\sim_\infty x$ since $\sin x$ is bounded, hence $$\frac x{x-\sin x}\sim_\infty \frac x{x}=1.$$


There is no contradiction; Hopital says that if $$\lim \frac {f'(x)}{g'(x)}$$ exists, then it is equal to $\lim \frac{f(x)}{g(x)}$.

In this case the limit does not exist, so nothing can be inferred.

Of course it also means that Hopital is useless in this case, but hopital is hardly the most important tool to solve limits anyway, and there are many other instances where it is useless :)