# Conditions for l'Hôpital's rule

According to l'Hôpital's rule, given functions $f,g$ which are differentiable around $a\in \mathbb R$, such that --

1. $\lim_{x\to a} f(x)=\lim_{x\to a}g(x)=0$
2. $g'(x)\neq 0$ on some deleted neighborhood of $a$.
3. $\lim_{x\to a} {\frac {f'(x)}{g'(x)} }$ exists (widely).

Then $\ \ \lim_{x\to a} {\frac {f(x)}{g(x)} } = \lim_{x\to a} {\frac {f'(x)}{g'(x)} }$.

Condition 2 is necessary for the proof, but I can't find a counterexample for the theorem without it. Could you give an example of differentiable functions $f,g$ aroud $a$, such that conditions 1,3 hold, but

$\ \ \lim_{x\to a} {\frac {f(x)}{g(x)} } \neq \lim_{x\to a} {\frac {f'(x)}{g'(x)} }$?

• Without 2, how would you make sense of 3? – Jack Jan 11 '17 at 22:25
• Sorry, my mistake! – user333618 Jan 11 '17 at 22:33
• There is a bit more to the purpose of (2) than that. – RRL Jan 11 '17 at 23:27
• From some book I see the second condition as $g(x)\neq 0$ from a deleted neighborhood of $a$ but then you need the condition (3). – Masacroso Jan 12 '17 at 1:32
• @Masacroso: 3 also ensures that $g(x) \neq 0$ as $x\to a$ so even that is redundant. – Paramanand Singh Jan 13 '17 at 9:06

Condition (2) is present not simply to ensure existence of $\lim f'(x)/g'(x).$
One can construct counterexamples where condition (2) is violated but $f'(x)$ and $g'(x)$ share a common factor -- such that $\lim f'(x)/g'(x)$ exists but $\lim f(x)/g(x)$ fails to exist.
Stolz produced such a counterexample for the case where $f(x), g(x) \to \infty$ as $x \to a = \infty$. Specifically,
$$f(x) = \int_0^x \cos^2(t) \, dt \\ g(x) = f(x)\exp ( \sin x).$$
If condition 2 wasn't satisfied, then $\lim_{x\to a}\frac {f'(x)}{g'(x)}$ couldn't be well-defined in an interval $(a-\epsilon, a+\epsilon)$ for $\epsilon \in \mathbb R$ such that $\exists y \in (a-\epsilon, a+\epsilon)$ : $g'(y)=0$.