TITLE: Understanding the counterexamples to L'Hopital's Rule
QUESTION [5 upvotes]: Wiki provides a counterexample limit that fails with L'Hopital's Rule, because it doesn't satisfy the $g'(x) \ne 0$ rule they provide earlier.

Let $f(x)=x+\sin x \cos x$ and $g(x)=f(x)e^{\sin x}.$ Then there is no limit for $f(x)/g(x)$ as $x\to\infty$ However,

$$
\begin{align}
   \frac{f'(x)}{g'(x)} &= \frac{2\cos^2 x}{(2 \cos^2 x) e^{\sin x} + (x+\sin x \cos x) e^{\sin x} \cos x} \\[4pt]
   &= \frac{2\cos x}{2 \cos x +x+\sin x \cos x} e^{-\sin x},
 \end{align}
$$
which tends to 0 as $x\to\infty$.
My question: is it possible to construct a counterexample where $x$ goes to a real number, rather than infinity? Or does approaching a real number protect you from failing in the $g'(x) = 0$ case.

REPLY [5 votes]: Consider $$f_1(x)\equiv f\circ h(x)\\ g_1(x)\equiv g\circ h(x)\\ h(x)\equiv (x-a)^{-2},a\in\mathbb R,$$ where $f$ and $g$ are defined as in your counterexample. Then there is no limit for $f_1(x)/g_1(x)$ as $x\rightarrow a$ but L'Hopital's rule imputes a limit of zero.