3.7 3.7 L'Hopital's Rule Contemporary Calculus 1 ^ PITAL'S RULE L'HO When we began taking limits of slopes of secant lines, msec = f(x+h) – f(x) h as h " 0 , we frequently encountered one difficulty: both the numerator and the denominator approached 0. And since the denominator approached 0, we could not apply the Main Limit Theorem. In each case, however, we ! managed to get past this "0/0" difficulty by using algebra or geometry or trigonometry, but there was no common approach or pattern. The algebraic steps we used to evaluate lim h "0 sin(2 + h) # sin(2) (2 + h) 2 # 4 seem quite different from the trigonometric steps needed for lim . h "0 h h ^ pital's Rule (pronounced Low–Pee–Tall), which In this section we consider a single technique, called l'Ho ! enables us to quickly and easily evaluate limits of the form "0/0" as well ! as several other difficult forms. A Linear Example Two linear functions are given in Fig. 1, and we need to find lim x "5 f (x) . Unfortunately, lim f(x) = 0 and lim g(x) = 0 so x "5 x "5 g(x) we cannot apply the Main Limit Theorem. However, we know f ! ! can calculate their ! slopes from Fig. 1, and we and g are linear, we know that they both go through the point (5,0) so we can find their equations: f(x) = –2(x – 5) and g(x) = 3(x – 5). Now the limit is easier: lim x "5 f (x) #2(x # 5) –2 = lim = 3 x "5 g(x) 3(x # 5) slope of f = slope of g . In fact, this pattern works for any two linear functions: ! g are linear! If f and functions with slopes m and n ≠ 0 and a common root at x = a, ( f(x) – f(a) = m(x – a) and g(x) – g(a) = n(x – a) so f(x) = m(x – a) and g(x) = n(x – a) ) then lim x "a f (x) m(x # a) m slope of f = lim = n = slope of g . x "a g(x) n(x # a) ^ pital who The really powerful result, discovered by John Bernoulli and named for the Marquis de l'Ho published book, is that the same pattern is true for differentiable functions even if they are ! it in his calculus ! not linear. 3.7 L'Hopital's Rule Contemporary Calculus 2 L'H^ o pital's Rule ( "0/0" form ) If f and g are differentiable at x = a , and f(a) = 0, g(a) = 0, and g '(a) ≠ 0 , then lim x "a f (x) f '(a) slope of f at a = g '(a) = slope of g at a . g(x) Idea for a proof: Even though f and g may not be linear functions, they are differentiable so at the point ! are "almost linear" in the sense that they are well approximated by their tangent lines at x = a they that point (Fig. 2): since f(a) = g(a) = 0 f(x) ≈ f(a) + f '(a)(x–a) = f '(a)(x–a) and g(x) ≈ g(a) + g '(a)(x–a) = g '(a)(x–a). Then lim x "a f (x) f '(a)(x # a) f '(a) ≈ lim = g '(a) . x "a g'(a)(x # a) g(x) (Unfortunately, we have ignored a couple subtle difficulties such as g(x) or ! g '(x) possibly ! being 0 when x is close to a. A proof of l'Ho^ pital's Rule is difficult and is not included.) Example 1: ^ pital's Rule to determine Use l'Ho lim x "0 ln(x) x 2 + sin(5x) and lim x x "1 e # e 3x ^ pital's Rule but let's use it. We can match the Solution: (a) We could evaluate this limit without l'Ho ^ pital's Rule by letting a = 0, f(x) = x2 + sin( 5x ) and g(x) = 3x. Then f(0) = 0, g(0) pattern of l'Ho ! ! = 0, and f and g are differentiable with f '(x) = 2x + 5cos( 5x ) and g '(x) = 3 so lim x "0 x 2 + sin(5x) f '(0) 2.0 + 5cos( 5.0 ) 5 = g '(0) = = 3 . 3 3x x (b) Let a = 1, f(x) = ln(x) and g(x) = e – e. Then f(1) = 0, g(1) = 0, f and g are differentiable for x x near 1 (x ≠ 0), and f '(x) = 1/x and g '(x) = e . Then ! ln(x) f '(1) 1/1 1 = g '(1) = 1 = e . x "1 e x # e e 1# cos(5x) ^ pital's Rule to find lim Practice 1: Use l'Ho and x "0 3x lim lim x "2 x2 + x # 6 . x 2 + 2x # 8 ! Strong Version of L'H^ o pital's Rule ! ! ^ pital's Rule can be strengthened to include the case when g '(a) = 0 and the indeterminate form "∞/∞", L'Ho the case when both f and g increase without any bound. 3.7 L'Hopital's Rule Contemporary Calculus 3 L'H^ o pital's Rule (Strong " 0/0 " and " ∞/∞ " forms) If f and g are differentiable on an open interval I which contains the point a, g '(x) ≠ 0 on I except possibly at a, and lim f (x) " 0 " "∞ " = 0 or ∞ g(x) lim f (x) f '(x) = lim provided the limit on the right exists. x "a g'(x) g(x) x "a then x "a ! ( "a" can represent a finite number or "∞." ) ! ! Example 2: lim Evaluate x "# e 7x . 5x 7x " ∞", both f(x) = e and g(x) = 5x increase without bound so we have an "∞/∞" ^ pital's Rule: indeterminate form and can use the Strong Version l'Ho ! Solution: As "x ! lim x "# e 7x 7e 7x = lim =∞. x "# 5x 5 ^ pital's Rule to the ratio The limit of f '/g ' may also be an indeterminate form, and then we can apply l'Ho !f '/g '. We can ! continue using l'Ho^ pital's Rule at each stage as long as we have an indeterminate quotient. Example 3: Solution: As x lim x "0 x3 x # sin(x) 3 " 0, f(x) = x " 0 and g(x) = x – sin(x) " 0 so ! x3 lim x"0 x # sin(x) ! ! ! lim = 6x "0 " lim ! " 0 x "0 sin(x) = 6 6 lim! = 1 = 6. x "0 cos(x) ! ! Practice 2: 3x 2 "0 " " 0 1# cos(x) ! = x "0 ^ pital's Rule to find Use l'Ho ! ! lim x "# ^ pital's Rule again so we can use l'Ho and again x 2 + ex . x 3 + 8x 3.7 L'Hopital's Rule Contemporary Calculus 4 Which Function Grows Faster? Sometimes we want to compare the asymptotic behavior of two systems or functions for large values of x, ^ pital's Rule can be a useful tool. For example, if we have two different algorithms for sorting and l'Ho names, and each algorithm takes longer and longer to sort larger collections of names, we may want to know which algorithm will accomplish the task more efficiently for really large collections of names. Example 4: 1.5 Algorithm A requires n.ln(n) steps to sort n names and algorithm B requires n steps . Which algorithm will be better for sorting very large collections of names? Solution: We can compare the ratio of the number of steps each algorithm requires, take the limit of this ratio as n grows arbitrarily large: say that n.ln(n) "grows faster" than n n.ln(n). Since n.ln(n) and n 1.5 1.5 lim n "# n.ln(n) 1.5 , and then n n $ ln(n) . If this limit is infinite, we n1.5 1.5 . If the limit is 0, we say that n grows faster than both grow arbitrarily large when n is large, we can algebraically ! simplify the ratio to ln(n) 0.5 n and then use L'Hopital's Rule: lim n "# n 1.5 2 ln(n) 1/n = lim = lim =0. 0.5 $0.5 n "# n "# 0.5n n n grows faster than n .ln(n) so algorithm A requires fewer steps for really large sorts. Practice 3: ! !n ! Algorithm A requires e operations to find the shortest path connecting n towns, algorithm 5 B requires 100.ln(n) operations for the same task, and algorithm C requires n operations. Which algorithm is best for finding the shortest path connecting a very large number of towns? Worst? Other "Indeterminate Forms" "0/0" is called an indeterminate form because knowing that f approaches 0 and g approaches 0 is not enough to determine the limit of f/g, even if it has a limit. The ratio of a "small" number divided by a "small" number can be almost anything as the three simple "0/0" examples show: lim 3x/x = 3 , x "0 lim x2/x = 0 , and lim 5x/x3 = ∞ . x "0 x "0 Similarly, "∞/∞" is an indeterminate form because knowing that f and g both grow arbitrarily large is ! not enough to determine ! the value limit of f/g or if the ! limit exists: lim 3x/x = 3 , x "# ! ! lim x2/x = ∞ , and x "# ! lim 5x/x3 = 0 . x "# 3.7 L'Hopital's Rule Contemporary Calculus 5 Besides the indeterminate quotient forms "0/0" and "∞/∞" there are several other "indeterminate forms." In each case, the resulting limit depends not only on each function's limit but also on how quickly each function approaches its limit. If f approaches 0, and g grows arbitrarily large, the product f . g has the indeterminant form "0 . ∞." g 0 Exponent: If f and g both approach 0, the function f has the indeterminant form "0 ." g ∞ If f approaches 1, and g grows arbitrarily large, the function f has the indeterminant form "1 . " g 0 If f grows arbitrarily large, and g approaches 0, the function f has the indeterminant form "∞ . " Product: Difference: If f and g both grow arbitrarily large, the function f – g has the indeterminant form "∞ – ∞." ^ pital's Rule can only be used directly with an indeterminate quotient ("0/0" or "∞/∞'), Unfortunately, l'Ho ^ pital's Rule can be but these other forms can be algebraically manipulated into quotients, and then l'Ho applied to the resulting quotient. Example 5: Evaluate lim x.ln(x) x "0 + ( " 0.(–∞) " form ) ^ pital's Solution: This limit involves an indeterminate product, and we need a quotient in order to apply l'Ho ln(x) . Rule. We can ! rewrite the product x ln(x) as the quotient 1/x , and then lim+ x ln(x) = x "0 x "0 = ! lim+ ! ∞ ln(x) " ∞ 1/ x ^ pital's Rule so apply l'Ho 1/ x = lim+ –x = 0 . lim+ 2 ! x "0 #1/ x x "0 f g A product f.g with the indeterminant form "0.∞" can be rewritten as a quotient, 1/g or 1/f , ! can be used. ! l'Ho^ pital's Rule and then Example 6: Evaluate lim xx 0 ( " 0 " form) x "0 + Solution: An indeterminate exponent can be converted to a product by recalling a property of exponential and ln( a ) g ln( f g ) g ln( f ) ! logarithm functions: for any positive number a, a = e so f = e = e . x . lim+ xx = lim+ eln( x ) = lim+ ex ln( x ) and this last limit involves an indeterminate x "0 x "0 product x.ln(x) ! x "0 " 0.(–∞) which we converted to a quotient and evaluated to be 0 in Example 5. 0 Our final answer is then e = 1 : ! ! ! x . lim+ xx = lim+ eln( x ) = lim+ ex ln( x ) = x "0 ! ! x "0 x "0 ! 0 e =1. 3.7 L'Hopital's Rule Contemporary Calculus 6 0 ∞ 0 with the form "0 ," "1 ," or "∞ , " can be g g.ln(f) converted to an indeterminate product by recognizing that f = e and then determining . (limit of g ln(f) ) the limit of g.ln(f). The final result is e . An indeterminate form involving exponents, f $ a 'x Evaluate lim &1+ ) x "# % x( Example 7: ("1 g ∞ " form) $ a 'x a x.ln( 1 + a/x ) Solution: lim &1+ ) = lim e so we need lim x.ln( 1 + x ) . x "# x "# x "# % x( ! a lim x.ln( 1 + x ) " "∞.0" an indeterminate product so rewrite it as a quotient x "# ! $ a' ln&1+ ) % x( = lim ! x "# 1/ x ! ! ! ! 0 " "0 " % ( ' $a / x 2 * '! a * ' 1+ * & x ) = lim a = lim a x "# % 1 ( x "# 1+ '$ 2 * x & x ) $ Finally, lim &1+ ! x "# % PROBLEMS a' ) x( x =! lim e x "# ^ pital's Rule an indeterminate quotient so use l'Ho a " 1 =a. x!.ln( 1 + a/x ) a = e . ! ! Determine the limits in problems 1 – 15. 1. 4. ! 7. x 3 #1 x "1 x 2 #1 ex lim 3 x "# x lim lim x "# ! ! 13. ! ! lim x "0 lim x "a 5. ! ln(x) x 3x 10. 2. e #e 4x 8. ! 2x x m # am x n # an ! ! ln(1+ 3x) 5x cos(a + x) # cos(a) 6. lim x "0 x lim x "# ln(x) x lim x "0 2 x #1 x 3. lim 9. lim ln(x) xp 12. lim 1# cos(2x) x 15. lim 1# cos(x) x $ cos(x) ! ! 1# cos(3x) 11. lim x "0 x2 ! 14. ! x 4 #16 x "2 x 5 # 32 x # ex lim x "0 1$ e x lim ! ! x "0 x "# x "0 x "0 (p is any positive number) 3.7 L'Hopital's Rule Contemporary Calculus 16. Find a value for p so lim 3x = 2. px + 7 17. Find a value for p so lim e px #1 = 5. 3x ! 18. x "# x "0 7 3x + 5 ^ pital's Rule work with this has the indeterminate form "∞/∞" . Why doesn't l'Ho 2x $1 ! ^ pital's Rule twice and see what happens.) Evaluate the limit without using limit? (Hint: Apply l'Ho ^ pital's Rule. l'Ho lim x "# ! lim 19. (a) Evaluate x "# ex ex ex , lim 2 , lim 5 . x x "# x x "# x bn (b) An algorithm is "exponential" if it requires a.e steps (a and b are positive constants). An d algorithm is "polynomial" if it requires c.n steps (c and d are positive constants). Show that ! polynomial!algorithms!require fewer steps than exponential algorithms for large problems. x2 20. The problem lim appeared on a test. x "0 3x 2 + x ^ pital's Rule to get: One student determined the limit was an indeterminate "0/0" form, and applied l'Ho ! " lim x "0 2x 2 x2 1 = lim = lim = 3 ." 2 x "0 6x + 1 x "0 6 3x + x Another student also determined the limit was an indeterminate "0/0" form and wrote, 2 0 ! x ! 2x = lim = 0 + 1 = 0 ." 2 x "0 6x + 1 x "0 3x + x ! " lim Which student is correct? Why? ! the limits in! Determine problems 21 – 29. 21. lim+ sin(x).ln(x) 22. lim x3.e–x 23. lim xsin(x) 25. lim (1$ 3/ x 2 ) x 26. lim (1$ cos(3x)) x 29. $ x + 5 '1/ x lim & ) x "# % x ( x "0 24. x "0 + x "# ! ! ! x "# $1 1 ' 27. lim & # ) x "0 % x sin(x) ( ! 28. ! lim (x $ ln(x)) x "# ! 30. lim (1 + 3 / x) 2 / x x "# ! ! ! ! lim x "0 + x # ln(x) x "# 3.7 L'Hopital's Rule Contemporary Calculus Section 3.7 8 PRACTICE Answers Practice 1: lim (a) x "0 1# cos(5x) . The numerator and denominator are both differentiable and both 3x ^ pital's Rule: equal 0 when x = 0, so we can apply l'Ho lim ! x "0 1# cos(5x) 5 # sin(5x) 0 = lim " 3 =0. x "0 3x 3 2 lim (b) x "2 x + x #6 . x 2 + 2x # 8 The numerator and denominator are both differentiable functions ! and they both equal ! 0 when x = 0, so!we can apply l'Ho^ pital's Rule: ! lim x "2 2x + 1 5 x2 + x # 6 = lim = 6 . 2 x "2 2x + 2 x + 2x # 8 x 2 + ex . The numerator and denominator are both differentiable x "# x 3 + 8x ! ! ^ pital's Rule: and both become arbitrarily large as x becomes large, so we can apply l'Ho lim Practice 2: 2 x x " ! lim x3 + e = lim 2x 2+ e " " ∞ ^ pital's Rule again: ∞ . Using l'Ho x "# x + 8x x "# 3x + 8 2x + e x 2 + ex ∞ = lim lim " " ∞ " and again: x "# 3x 2 + 8 ! x "# 6x ! ! lim ! Practice 3: ! x "# 2 + ex ex = lim " ∞ . 6x ! x "# 6 n Comparing A with e operations to B with 100.ln(n) operations. ! en ∞ lim ! ! " ∞ " so use L'Hopital's Rule: " n "# 100 $ ln(n) en en n $ en lim = lim = lim = ∞ so B requires fewer operations than A. n "# 100 $ ln(n) n "# 100 /n n "# 100 ! ! 5 Comparing B with 100.ln(n) operations to C with n operations. 100 $ ln(n) ! lim 100 $ ln(n) ! ∞ . lim ! = lim " ∞ 5 5 n n "# n "# n n "# 100 /n 100 = lim =0 4 n "# 5n 5 5n so B requires fewer operations than C. B requires the fewest operations of the three algorithms. ! ! n 5 Comparing A with e ! operations to C with n! operations. Using ! l'Ho^ pital's Rule several times: n lim n "# n n e e e en en en = = = = = = ∞ lim lim lim lim lim n "# 5n 4 n "# 20n 3 n "# 60n 2 n "# 120n n "# 120 n5 so A requires more operations than C. A requires the most operations of the three algorithms. ! ! ! ! ! !