# A proviso in l'Hospital's rule

L'Hospital's Rule states that $$\lim_{x\to a}\frac{f(x)}{g(x)} = \lim_{x\to a}\frac{f'(x)}{g'(x)}$$

can be applied when:

(1) $f$, $g$ are differentiable;

(2) $g'(x) \neq 0$ for $x$ near $a$ (except possibly at $a$);

(3) $\displaystyle\lim_{x\to a}f(x) = 0 = \displaystyle\lim_{x\to a}g(x)$, or $\displaystyle\lim_{x\to a}f(x) = \pm\infty = \displaystyle\lim_{x\to a}g(x)$; and

(4) the limit on the RHS exists or it equals $\pm\infty$.

$\$

Why is proviso (2) necessary?

Edit: This question was asked in the context of a first undergraduate calculus course. Thus, the domains of $f$ and $g$ can be assumed to include a subset of $\mathbb R$ for which $a$ is an accumulation point, that has at most two connected components. I apologise to Paramanand if this changes the question - I intended to communicate this by tagging the question calculus. I think that this setup means that the quotient $f'/g'$ will be defined on an interval near $a$ when the criteria (1)-(4) hold.

• For the case $x \to \infty$ see this paper by Boas: maa.org/programs/faculty-and-departments/… – Hans Lundmark Oct 20 '14 at 17:49
• @HansLundmark, the case discussed is for $x \to \infty$ for simplicity only, a similar (but messier) proof apllies to a finite $x$. – vonbrand Jul 27 '15 at 23:55
• @vonbrand: Yes, I know. – Hans Lundmark Jul 28 '15 at 7:25
• Funnily, there is one more hypothesis that must be added, very similar to the one that you are talking about: (2') $g(x) \ne 0$ for $x$ near $a$ (except possibly at $a$) - for exactly the same reason for which hypothesis (2) is needed. – Alex M. May 24 '16 at 16:43
• @AlexM.: Neither $(2)$ nor $(2')$ i.e. $g(x) \neq 0$ is required. See my answer. – Paramanand Singh May 25 '16 at 3:28

Remember that in order to be able to speak about the limit of some function $h : D \to \Bbb R$ at a point $a$ (with $D$ an open subset), you need $a$ to be an accumulation point for $D$ (a limit point of $D$, as it is also called) - in particular, this means that $h$ must be defined in some neighbourhood $a$ (save for, possibly, in $a$ itself).

Using the above and letting $h = \frac {f'} {g'}$, you want $h$ to be defined on some neighbourhood of $a$, and this amounts to $h$ having a non-zero denominator in some neighbourhood of $a$, i.e. $g'(x) \ne 0$ for $x$ in a neighbourhood of $a$ (possibly with $a$ omitted - this one being often the case, in practice).

To conclude, the condition on the denominator has to do only with having the fraction well-defined (i.e. mathematically meaningful).

• IIRC, you need an open interval around $a$ to have $g'$ nonzero because you need to apply the MVT or generalized MVT and need $f/g$ or $f'/g'$ or something like it well defined on an interval. This is impossible with a function involving $\sin(1/x)$ and in fact, I believe you can come up with an appropriate function where lhospitals rule fails. – abnry May 25 '16 at 1:08
• I remember discovering in my analysis book that this precise condition was misstated (Abbott's understanding analysis). I may be able to dig up my notes. – abnry May 25 '16 at 1:11
• @MathematicsStudent1122: The definition of a limit as $x \to a$ where we only assume that $a$ is an accumulation point of domain of the function is fine. But it does not help when we are dealing with L'Hospital rule. The proof of LH rule critically requires the use of mean value theorems which hold on intervals and then it appears reasonable to use the simpler definition of limit (which is taught well before a student hears about accumulation point). – Paramanand Singh May 25 '16 at 3:21
• @ahorn: Isolated points are not accumulation points. This is why I find Paramanand Singh's answer not satisfactory. – Alex M. May 27 '16 at 11:26
• @AlexM. You're right. I got the definition of an accumulation point wrong. My metric spaces textbook says that it must be zero distance from the rest of the set. – ahorn May 28 '16 at 9:02

I assume that we are using the following definition of limit:

Let $f$ be defined in a certain neighborhood of $a$ and not necessarily at $a$. A number $L$ is said to be the limit of $f$ as $x \to a$ (written as $\lim\limits_{x \to a}f(x) = L$) if for every $\epsilon > 0$ it is possible to choose a $\delta > 0$ such that $|f(x) - L| < \epsilon$ whenever $0 < |x - a| < \delta$.

Note that this definition presupposes that $f$ must be defined in a deleted neighborhood of $a$ before we can talk of $\lim_{x \to a}f(x)$. Many textbook authors relax this condition and only need that $a$ should be an accumulation point of the domain of $f$. Note that this relaxed condition does not help us in case of L'Hospital's Rule because the proof of this rule is based on the use of mean value theorem which requires that we are dealing with intervals (for which $a$ is an end-point) rather than dealing with arbitrary domains (which have $a$ as an accumulation point).

Once we have taken the definition of limit mentioned above it is obvious that condition $(4)$ of L'Hospital's Rule in question automatically implies condition $(2)$. The existence of $\lim_{x \to a}f'(x)/g'(x)$ presupposes that the expression $f'(x)/g'(x)$ is defined in a certain deleted neighborhood of $a$. And this means that $g'(x) \neq 0$ in that deleted neighborhood. So the second condition is redundant.

However it is a good idea to mention this condition because it is easy to check this instead of checking $(4)$. And if this fails we are guaranteed that LHospital won't work and we don't need to check the condition that $f'(x)/g'(x)$ tends to a limit.

Further note that if we are given that $\lim_{x \to a}g(x) = 0$ and the fact that $g'(x) \neq 0$ as $x \to a$ then it follows via mean value theorem that $g(x) \neq 0$ as $x \to a$ and hence it is possible to talk about limit of $f(x)/g(x)$. The proof for L'Hospital is now easily completed via Cauchy's Mean Value Theorem.

Update: OP wants to know (via comment to this answer) about the difference between two definitions of limit $\lim_{x \to a}f(x)$ which I have mentioned in my answer. In one definition we require $f$ to be defined in a deleted neighborhood of $a$ and in another definition we require $a$ to be an accumulation point of the domain of $f$. The difference is best explained via an example where these two definitions lead to two different conclusions.

Let $$f(x) = \frac{\sin(1/x)}{\sin(1/x)}$$ then it is clear that $f$ is defined for all values of $x$ except $x = 0$ or $x = 1/n\pi$ where $n$ is a non-zero integer. Moreover $f(x) = 1$ at points where $f$ is defined. Thus the domain of $f$ is $$A = \mathbb{R} - B$$ where $$B = \{0\}\cup\{1/n\pi\mid n\text{ is a non-zero integer}\}$$ and $f(x) = 1$ for all $x \in A$.

It can be easily seen that $0$ is an accumulation point of $A$ (this statement means that every deleted neighborhood of $0$ contains a member of $A$). Also observe that $0$ is an accumulation point of $B$.

At the same time we can see that the function $f$ is not defined in a deleted neighborhood of $0$ (because every such neighborhood contains points of $B$ also).

Thus according to my definition of limit it is not possible to even talk about $\lim_{x \to 0}f(x)$ whereas according to the relaxed definition we can talk about $\lim_{x \to 0}f(x)$ because $0$ is an accumulation point of domain $A$ of $f$. Moreover according to this definition we have $\lim_{x \to 0}f(x) = 1$.

For a beginner who is studying calculus for the first time (meaning age 15-16 years) it is best to avoid terms like accumulation point, Bolzano-Weierstrass Theorem, open set, closed set etc (which are part of a course in real-analysis or point set theory/topology) and instead rely on simple definition of limit where the functions involved are defined on certain intervals except for some exceptional points of the interval where the function is not defined. The power of concept of limit is due to the fact that it can describe the behavior of a function near those exceptional points where the function is not even defined.

In fact this is ingrained in the definition of limit that limit of a function at a point $a$ has nothing to do with its value at point $a$ and has everything to do with its values near point $a$. Therefore it is a pre-requisite that the function must be defined in some neighborhood of $a$ except possibly at $a$ (and we say this compactly that $f$ must be defined in a deleted neighborhood of $a$) before we can even even talk about the limit of $f$ as $x \to a$ (or to use a different phrase, limit of $f$ at point $a$).

Just to clarify we are talking about functions defined on subsets of $\mathbb{R}$ and hence there is no need to think of complex domains.

• Why the downvote?? – Paramanand Singh May 25 '16 at 13:29
• What is a 'deleted neighbourhood' as opposed to just a 'neighbourhood'? – ahorn May 27 '16 at 10:39
• @ahorn: A neighborhood of a point $c$ is any open interval which contains $c$. If $I$ is a neighborhood of $c$ then the set $I_{d} = I - \{c\}$ consisting of all points of $I$ except $c$ is called a "deleted neighborhood of $c$". Thus if we delete/remove $c$ from a neighborhood of $c$ then we get a deleted neighborhood of $c$. – Paramanand Singh May 27 '16 at 10:42
• What is the difference between '$a$ has a deleted neighbourhood in the domain' and '$a$ is an accumulation point of the domain', in this context? I assume we consider the domain to be real because I don't know how else a derivative could be defined (complex perhaps). – ahorn May 28 '16 at 19:27
• @ahorn: I will provide a reply to your comment in an update to my answer as it is too long to fit in a comment. – Paramanand Singh May 29 '16 at 8:02