L' Hôpital's Rule and A Generalized Version

by Ng Tze Beng

L' Hôpital's Rule was actually discovered by John Bernoulli. The rule with its various versions is widely used. As with the use of the Mean Value Theorem, a weaker version of the Cauchy Mean Value Theorem suffices for the proof of L' Hôpital's Rule. In this note I shall present a generalized version of the L' Hôpital's Rule (Theorem 11 and Theorem 12). The converse of the rule is not true. Some of the common misuse of the Rule arise from using the converse, particularly so with the derivative. First let us recall Theorem 1 from Darboux Fundamental Theorem of Calculus.

Theorem 1. If f :[a, b] ® R is differentiable on [a, b], then for any u, v in [a, b] with u < v, there exists a point x and a point y in [u, v] such that

or equivalently, .

The proof can be found in Do we need Mean Value Theorem to prove f '(x) = 0 on (a, b) implies that f = constant on (a, b)?

L' Hôpital's Rule concerns the limit of a quotient of two functions that can be expressed in terms of the limit of the quotient of their respective derivatives or derived functions. Important to this is that the derived function of the denominator function should not have infinite number of change of sign near the point where the limit is to be taken. Due to the Intermediate Value Theorem for Derivatives, we can express this requirement simply by stating that the derivative is non-zero around the point of limit. We state this as a convenient reference as Theorem 2.

Theorem 2. Suppose f is differentiable on an interval I (not necessarily bounded). If the derived function f ' is non-zero on I, then f ' is of constant sign, i.e., for all x in I, f '(x) > 0 or for all x in I, f '(x) < 0.

Proof. Suppose f ' is not of constant sign. Then there exist x and y in I such that f '(x) > 0 and f '(y) < 0. Thus 0 is an intermediate value between f '(x) and f '(y). Therefore, by Darboux's Theorem (see Intermediate Value Theorem for the Derived Functions) there exists a point c between x and y such that f '(x) = 0. This contradicts that f ' is non-zero on I and so f ' must be of constant sign.

Our next theorem follows from Theorem 1 above.

Theorem 3. Suppose f and g are two differentiable functions defined on the closed and bounded interval [a, b]. Suppose that g'(x) ¹ 0 for all x in [a, b]. Then there exist points p, q in [a, b] such that

.

Proof. Define the function h :[a, b]® R by h(x) = f (x)(g(b)-g(a)) - g(x)( f (b)- f (a)) for x in the interval [a, b]. Since f and g are differentiable on [a, b], h is also differentiable on [a, b]. Thus by Theorem 1, we can find points p and q in [a, b] such that

. --------------------- (1)

f '( p)(g(b)-g(a)) ³ g'(p)( f (b)- f (a)) -------------- (2)

f '( q)(g(b)-g(a)) £ g'(q)( f (b)- f (a)) --------------- (3).

Now since g' (x) ¹ 0 for all x in [a, b], by Theorem 2 either g' (x) > 0 for all x in [a, b] or g' (x) < 0 for all x in [a, b] . That means g is strictly increasing on [a, b] or g is strictly decreasing on [a, b]. Hence we conclude that if g'(p) > 0, then g is strictly increasing and so g(b)-g(a) > 0 and if g'(p) < 0, then g is strictly decreasing and so g(b)-g(a) < 0 and so from (2) we get

.

If g'( p) > 0, then g'(q) > 0 since g' is of constant sign and so g(b)-g(a) > 0 and if g'( p) < 0, then g'(q) < 0 for the same reason as before and so g(b)-g(a) < 0. We obtain similarly from (3)

.

The next theorem is the usual form of L' Hôpital's Rule.

Theorem 4 L' Hôpital's Rule. Suppose f and g are two functions that are continuous on [a, b] and differentiable on (a, b). Suppose f (a) = g(a) = 0. Suppose that g' (x) ¹ 0 for all x in the open interval (a, b). If exists and is equal to L, then exists and is also equal to L, i.e. if the limit on the right hand side exists.

Proof. Since , given e > 0, there exists d > 0 such that

a < x < a + d ̃ -------- (4)

We may assume that a + d £ b. (If this is not the case, then we can obviously choose a smaller d > 0 such that d £ b - a.) For any fixed x in the interval (a, a + d), let y be any point such that a < y < x. For example, we can let y = a + 1/n where n is any integer > N and N is some integer such that 1/N < x-a (N exists by the archimedean property of the real number system). Then by Theorem 3, since g'(x) ¹ 0 on [y, x], for some point c in [ y, x], we have

.

Now since a < c < x < a + d , by (4), . Thus we have, for any y such that a < y < x, . Therefore, since f (a) = g(a) = 0, by the continuity of f and g at a, . That means for all x such that a < c < x < a + d, . Also by Theorem 3, there exists a point d in [ y, x], such that . Then using (4) we have . Again using the continuity of f and g at a and the above inequality,

.

We now state the corresponding rule for the left limit.

Theorem 5 L' Hôpital's Rule. Suppose f and g are two functions that are continuous on [a, b] and differentiable on (a, b). Suppose f (b) = g(b) = 0. Suppose that g' (x) ¹ 0 for all x in the open interval (a, b). If exists and is equal to L, then exists and is also equal to L, i.e. if the limit on the right hand side exists.

Remark.

  1. Combining Theorem 4 and Theorem 5 gives the limit version of the L' Hôpital's Rule.
  2. If the derivative of the denominator function, g'(x) changes sign infinitely often near a, then g'(x) would take on the value zero infinitely often and the quotient f '(x) /g'(x) would not be defined in any small interval containing a and we would not be able to talk about the limit of f '(x) /g'(x) at x = a.

Theorem 6. Suppose f and g are functions differentiable at x for all x > K for some positive constant K and that g'(x) ¹ 0 for all x > K. Suppose . If exists and is equal to L, then exists and is also equal to L.

We shall give a direct proof without using the usual conversion that and applying Theorem 4.

Proof of Theorem 6. Since , given e > 0, there exists a positive number N > 0 such that

------------------ (5)

We may assume that N > K. If need be, we can always pick an N that is bigger than K. Since g'(x) ¹ 0 for all x > K, by Theorem 2 g'(x) is of constant sign for all x > K and so we may assume that g(x) ¹ 0 for all x > K . For a given fixed x > N, by Theorem 3, for any y > x, there exists c in [x, y], and by (5)

. Thus for any x > N, . Hence

.

Similarly, by Theorem 3 and (5), there exists d in [x, y], such that . Therefore, . Thus we have shown that for all x > N, . Hence .

As we can see the proofs for Theorem 4 and 6 are similar. The next version will deal with limit at - infinity. The proof is exactly similar to that for Theorem 6 with appropriate interpretation for the corresponding limit.

Theorem 7. Suppose f and g are functions differentiable at x for all x < K for some negative constant K and that g'(x) ¹ 0 for all x < K. Suppose . If exists and is equal to L, then exists and is also equal to L.

The next version is the so called infinity/infinity version of L' Hôpital's rule.

Theorem 8. Suppose f and g are two functions that are differentiable on (a, b) and that g' (x) ¹ 0 for all x in the open interval (a, b). Suppose and . If exists and is equal to L, then exists and is also equal to L.

Proof. The proof requires a careful handling of the limit.

Since , given e > 0, there exists d > 0 with d < b -a such that

-------- (6)

Fixed a point y in (a, a + d). Then by Theorem 3 and (6), for any x such that

a < x < y, there exists points c and d in [x, y] such that

.

Hence for any x such that a < x < y

. -------------- (7)

Note that since g'(x) ¹ 0 for all x in (a, b) by Theorem 2, g is strictly monotonic on (a, b) , i.e., g is either strictly increasing or strictly decreasing on (a, b). Since , we may assume that g(x) ¹ 0 for any x in (a, a + d). Now since , there exists a d1 > 0 such that for all x in (a, a + d1), | f (x)| > | f (y)|. Thus let h = min(d, d1). We may write for any x in (a, a + h),

------------------ (8)

Now for x in (a, a + h), define . Since and , we have that . Hence . Therefore, there exists h1 > 0 such that

a < x < a + h1 ̃ |G(x) - 1| < min(1/2, e/(2(1+|L|)). Hence letting e1 = min(1/2, e/(2(1+|L|)), we have that

a < x < a + h1 ̃ 1- e1 <G(x) < 1+ e1 ---------------- (9).

Note that e1 £ 1/2 so that for x such that a < x < a + h1, G(x) > 0. Thus from (7) we get for x such that a < x < a + min(h, h1)

. -------------- (10)

But now since G(x) < 2. Also from (9) we have if L ³ 0, then

L - e/2 < L - |L| e1 £ L - L e1 £ L .G(x) £ L + L e1 £ L + |L|e1 < L + e/2.

If L £ 0, then again from (9) we have,

L + e/2 > L + |L| e1 ³ L - L e1 ³ L .G(x) ³ L + L e1 ³ L - |L|e1 > L - e/2.

Consequently, it follows that for x such that a < x < a + min(h, h1),

L - e/2 < L .G(x) < L + e/2.

Thus it follows from (8) and (10) and the above inequality that for x such that a < x < a + min(h, h1),

.

and .

Let now d' = min(h, h1). We have thus shown that for all x such that a < x < a + d' ,

.

This means .

The next theorem is the infinity version of L' Hôpital's Rule.

Theorem 9. Suppose f and g are two functions that are continuous on [a, b] and differentiable on (a, b). Suppose f (a) = g(a) = 0. Suppose that g' (x) ¹ 0 for all x in the open interval (a, b). If , then .

Proof. Since , given any K > 0, there exists d > 0 such that

-------------- (11)

For a fixed x in the interval (a, a + d). Then for any y such that a < y < x, by Theorem 3 there exists a point c in (y, x) such that . But by (11)

and so . Hence

. This is true for any x in (a, a + d). Therefore, .

Remark. The corresponding results or conclusions for the left limit and limit hold as well as for the case when the limit is - ¥.

There is a more complicated version of L' Hôpital's rule. This deals with the version where f ' (x)/g'(x) is not defined around the point x = a, nevertheless after appropriate "cancellation" f '(x)/g'(x) does have limit at the point a. Our previous theorem cannot handle this case simply because f ' (x) / g'(x) is not defined in any neighbourhood of the point a. First we need a refined version of Theorem 3.

Theorem 10. Suppose f and g are two differentiable functions defined on the closed and bounded interval [a, b].   Furthermore, suppose that the derivatives of f and g satisfy f '(x) = k(x) j(x) and g'(x) = k(x) y(x) for all x in [a, b]. Suppose y(x) and k(x) satisfy anyone of the following conditions.

1. y(x) > 0 for all x in [a, b] and that k(x) > 0 except possibly for a set N of zero measure in [a, b] and k(x) = 0 for x in N.

2. y(x) < 0 for all x in [a, b] and that k(x) < 0 except possibly for a set N of zero measure in [a, b] and k(x) = 0 for x in N.

3. y(x) > 0 for all x in [a, b] and that k(x) < 0 except possibly for a set N of zero measure in [a, b] and k(x) = 0 for x in N.

4. y(x) < 0 for all x in [a, b] and that k(x) > 0 except possibly for a set N of zero measure in [a, b] and k(x) = 0 for x in N.

Then there exist points p, q in [a, b] such that

Proof. We shall prove only the case where condition 1 is satisfied. The other three cases are proved similarly. Define the function h :[a, b]® R by h(x) = f (x)(g(b)-g(a)) - g(x)( f (b) - f (a)) for x in the interval [a, b]. Since f and g are differentiable on [a, b], h is also differentiable on [a, b]. Thus as before by Theorem 1, there exist p and q in [a, b] such that

.

Therefore, since h'(x) = f '(x)(g(b)-g(a)) - g'(x)( f (b)- f (a)), we get

k( p)[j(p)(g(b)-g(a)) -y(p)( f (b)- f (a))] ³ 0 --------------- (12)

and

                                           k( q)[j(q)(g(b)-g(a)) -y(q)( f (b)- f (a))] £ 0 ---------------- (13)

If k(p) > 0, then since y(p) > 0 and g(b)-g(a) > 0 (because g is strictly increasing as we shall show later), from (12) we obtain

. If h'(p) = 0 and k(p) > 0, then we obtain . We need not use Theorem 1 here as the following claim will show. We claim that there exists p in [a, b] such that h'(p) ³ 0 and k(p) > 0

Note that the condition that y(x) > 0 for all x in [a, b] and that k(x) > 0 except possibly for a a set N of zero measure in [a, b] and k(x) = 0 for x in N

implies that g'(x) = k(x) y(x) > 0 except perhaps possibly for x in N a set of zero measure and g'(x) = 0 for x in N. Hence g'(x) ³ 0 for all x in [a, b]. Then g is non decreasing in [a, b]. This is because if there exist x < y in [a, b] such that g(x) > g(y), then by Theorem 1 there exists a point z in [x, y] such that contradicting g'(z) ³ 0. Next we claim that g is strictly increasing. Suppose there exist x < y in [a, b] such that g(x) = g(y). Then for all z in [x, y], g(z) = g(x). This is because if there exists z in [x, y] such that g(z) ¹ g(x), then since g is non decreasing g(z) > g(x), and so g(z) > g(y) = g(x), contradicting g(z) £ g(y). Therefore, g is constant on [x, y] and so g'(x) = 0 on [x, y] implying that [x, y] Í N and so since the measure of [x, y] is y - x > 0 , the measure of N is non-zero contradicting the assumption that the measure of N is zero. The crucial property we use here is that N does not contain any non trivial open interval. This shows that g is strictly increasing. Suppose on the contrary that for all x in [a, b] either h'(x) < 0 or k(x) = 0. This means h'(x) < 0 except for points in the set N of measure zero where h'(x) = 0 there. Therefore, using a similar argument in showing that g is strictly increasing, h is strictly decreasing and so h(b) < h(a) contradicting h(a) = h(b). This proves the claim. Hence there exists p in [a, b] such that .

Similarly, if k(q) > 0, then since y(q) > 0 and g(b)-g(a) > 0, from (13) we obtain

. We need not use Theorem 1 here but all the same it is good to see that it can give us some partial answer. We now claim that there exists q in [a, b] such that h'(q)£ 0 and k(p) > 0. Note that when k(p) = 0 then h'(q) = 0. Suppose on the contrary such a q does not exist, then for all x in [a, b] either h'(x)> 0 or k(x) = 0. Since k(x) = 0 only for x in N a set of measure zero in [a, b] and since k(x) = 0 implies h'(x) = 0, h'(x)> 0 except possibly for a set N of zero measure and h'(x) = 0 there. Just like the case for g, we deduce that h is strictly increasing. Therefore, h(b) > h(a) contradicting h(a) = h(b). This proves the claim. It then follows from the claim that there exists q in [a, b] such that j(q)(g(b)-g(a)) -y(q)( f (b)- f (a)) £ 0. This means .

This proves Theorem 10.

Theorem 11 Generalized L' Hôpital's Rule. Suppose f and g are two functions that are continuous on [a, b] and differentiable on (a, b). Suppose f (a) = g(a) = 0. Furthermore, suppose that the derivatives of f and g satisfy f '(x) = k(x) j(x) and g'(x) = k(x) y(x) for all x in (a, b). Suppose y(x) and k(x) satisfy anyone of the following conditions.

1. y(x) > 0 for all x in (a, b) and that k(x) > 0 except possibly for a set N of zero measure in (a, b) and k(x) = 0 for x in N.

2. y(x) < 0 for all x in (a, b) and that k(x) < 0 except possibly for a set N of zero measure in (a, b) and k(x) = 0 for x in N.

3. y(x) > 0 for all x in (a, b) and that k(x) < 0 except possibly for a set N of zero measure in (a, b) and k(x) = 0 for x in N.

4. y(x) < 0 for all x in (a, b) and that k(x) > 0 except possibly for a set N of zero measure in (a, b) and k(x) = 0 for x in N.

If exists and is equal to L, then exists and is also equal to L, i.e. if the limit on the right hand side exists.

Proof. The proof is similar to the proof of Theorem 4. This time round we use Theorem 10. Since , given e > 0, there exists d > 0 such that

-------- (14)

We may assume that a + d £ b. For any fixed x in the interval (a, a + d), let y be any point such that a < y < x. Then by Theorem 10 applied to the interval [ y, x], for some point c in [ y, x], we have

.

Note that the conditions for Theorem 10 are met because [ y, x] Í (a, b) and by assumption the conditions are satisfied in (a, b).

Now since a < c < x < a + d , by (14), . Thus we have, for any y such that a < y < x, . Therefore, since f (a) = g(a) = 0, by the continuity of f and g at a, . That means for all x such that a < x < a + d, . Also by Theorem 10, there exists a point d in [ y, x], such that . Then using (14) we have . Again using the continuity of f and g at a and the above inequality,

.

We have thus proved that for any x with a < x < a + d , . Hence,

.

Remark.

  1. Taking k(x) to be the non zero constant function gives Theorem 4.
  2. We can replace N by a set that is at most countably infinite, which is more acceptable for reader uncomfortable or not familiar with measure theory.
  3. We can replace N by a set which is no where dense (i.e., it does not contain any non trivial open interval) so that N would include sets like Cantor sets of positive measure as well as any set of zero measure.
  4. Theorem 11 also holds if we replace the limit by the left limit at the point b. The proof is exactly the same.

Example.

  1. Take for example the function and . Then both l(x) and g(x) are continuous functions defined on R. Define and for each x in R. This is well defined since both l(x) and g(x) are Riemann integrable over any bounded closed interval. Since by the Fundamental Theorem of Calculus f '(x) = l(x) and g'(x) = g(x) and since for only countably infinite number of x in any neighbourhood of 0, by Theorem 11, Note that we cannot apply Theorem 4 the usual version of L' Hôpital's Rule directly.
  2. Take for example the function and

. Then both f (x) and g(x) are continuous functions defined on R. Define for each x in R. This is well defined since both l(x) and g(x) are Riemann integrable over any bounded closed interval. By the Fundamental Theorem of Calculus g'(x) = g(x) = for x > 0. Now . because and by the Squeeze Theorem. Thus by Theorem 11,

Next we state the corresponding infinity version of Theorem 11.

Theorem 12. Suppose f and g are two functions that are differentiable on (a, b) and that g' (x) ¹ 0 for all x in the open interval (a, b). Suppose and . Furthermore, suppose that the derivatives of f and g satisfy f '(x) = k(x) j(x) and g'(x) = k(x) y(x) for all x in (a, b). Suppose y(x) and k(x) satisfy anyone of the following conditions.

1. y(x) > 0 for all x in (a, b) and that k(x) > 0 except possibly for a set N of zero measure in (a, b) and k(x) = 0 for x in N.

2. y(x) < 0 for all x in (a, b) and that k(x) < 0 except possibly for a set N of zero measure in (a, b) and k(x) = 0 for x in N.

3. y(x) > 0 for all x in (a, b) and that k(x) < 0 except possibly for a set N of zero measure in (a, b) and k(x) = 0 for x in N.

4. y(x) < 0 for all x in (a, b) and that k(x) > 0 except possibly for a set N of zero measure in (a, b) and k(x) = 0 for x in N.

If exists and is equal to L, then exists and is also equal to L, i.e. if the limit on the right hand side exists.

The proof of Theorem 12 is the same as that for Theorem 8. We use here Theorem 10 instead of Theorem 3. We also have the corresponding Theorem for the left limit at x = b.

Remark.

  1. Note that the requirement that k(x) does not change sign infinitely often is necessary. Consider the following functions.
for x > 0 and . Then obviously . Then for all x > 0 and so does not exist simply because does not exist. Now and and so if we were to take and after "canceling" k(x) from both f '(x) and g'(x) we would obtain the quotient of f '(x) by g'(x) as . Then . But we certainly cannot conclude that .
  1. The corresponding results for Theorem 11 and 12 for limit at ¥ or - ¥ hold.

Some Misuse of L' Hôpital's Rule.

We must remember that L' Hôpital's Rule is a theorem. Most theorems have a set of condition and a set of implication. Some theorems give implication in both direction. L' Hôpital's Rule give an implication in one direction. Only when the limit exists, then we can make deduction about the limit provided the initial condition is fulfilled. On the other hand, when exists, it is not necessarily that should exist. Put it another way, if does not exist, it is not necessarily that does not exist.

Example 1. , g(x) = sin(x). Then . But g'(x) = cos(x) and . . Therefore, for x ¹ 0 and -p/2 < x < p/2. Thus does not exist simply because does not exist and .

Example 2. , g(x) = sin(x). Then does not exist because and does not exist. Note that and g'(x) = cos(x) and so . Therefore, does not exist simply because is bounded say for all x ¹ 0 in a small neighbourhood of 0 and is unbounded for all x ¹ 0 in any small neighbourhood of 0. Logically, if the conditions, that and that g'(x) ¹ 0 for x in a small open interval containing a except possibly at a, are satisfied, then does not exist implies that does not exist. This is just the contrapositive equivalent statement for L' Hôpital's Rule. The above example is just an illustration of this fact.

Example 3. It is very tempting to use L' Hôpital's Rule for differentiation. By definition of the derivative of a function f at x = a,

if and only if the limit exists. That means that only if the limit exists, then we can say that the derivative f '(a) exists. Suppose we apply L' Hôpital's Rule to the limit . Then we can only say that if the limit exists at a then f is differentiable at x = a. But we cannot say in general that if does not exist at x = a , then f is not differentiable at x = a. This is because that a function f can be differentiable at x = a but its derived function need not be continuous at x = a. Take. Then . Indeed f is differentiable at x = 0, because by the Squeeze Theorem and so f ' (0) = 0. But does not exist.

Ng Tze Beng email: matngtb@nus.edu.sg

Mathematics Department

National University of Singapore

2 Science Drive 2

Singapore 117543

ă Ng Tze Beng 2002