L'Hopital's Rule

Site: Saylor Academy
Course: MA005: Calculus I
Book: L'Hopital's Rule
Printed by: Guest user
Date: Saturday, 26 April 2025, 5:06 PM

Description

Read this section to learn how to use and apply L'Hopital's Rule. Work through practice problems 1-3.

Introduction

When we began taking limits of slopes of secant lines, \mathrm{m}_{\mathrm{sec}}=\frac{\mathrm{f}(\mathrm{x}+\mathrm{h})-\mathrm{f}(\mathrm{x})}{\mathrm{h}} as \mathrm{h} \rightarrow 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 \limits_{h \rightarrow 0} \frac{(2+h)^{2}-4}{h} seem quite different from the trigonometric steps needed for \lim \limits_{h \rightarrow 0} \frac{\sin (2+h)-\sin (2)}{h}.

In this section we consider a single technique, called l'Hô pital's Rule (pronounced Low-Pee-Tall), which enables us to quickly and easily evaluate limits of the form " 0/0 " as well as several other difficult forms.


Source: Dale Hoffman, https://s3.amazonaws.com/saylordotorg-resources/wwwresources/site/wp-content/uploads/2011/11/4-7LHopitalsRule.pdf
Creative Commons License This work is licensed under a Creative Commons Attribution 3.0 License.

A Linear Example

Two linear functions are given in Fig. 1 , and we need to find \lim \limits_{x \rightarrow 5} \frac{f(x)}{g(x)}. Unfortunately, \lim \limits_{x \rightarrow 5} f(x)=0 and \lim \limits_{x \rightarrow 5} g(x)=0 so we cannot apply the Main Limit Theorem. However, we know \mathrm{f} and \mathrm{g} are linear, we can calculate their slopes from Fig. 1 , and 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).

Fig. 1

Now the limit is easier: \lim _{x \rightarrow 5} \frac{f(x)}{g(x)}=\lim _{x \rightarrow 5} \frac{-2(x-5)}{3(x-5)}=\frac{-2}{3}=\frac{\text { slope of } \mathrm{f}}{\text { slope of } \mathrm{g}}.

In fact, this pattern works for any two linear functions:

If \mathrm{f} and \mathrm{g} are linear functions with slopes \mathrm{m} and \mathbf{n} \neq 0 and a common root at \mathrm{x}=\mathrm{a}, (\mathrm{f}(\mathrm{x})-\mathrm{f}(\mathrm{a})=\mathrm{m}(\mathrm{x}-\mathrm{a}) and \mathrm{g}(\mathrm{x})-\mathrm{g}(\mathrm{a})=\mathrm{n}(\mathrm{x}-\mathrm{a}) so \mathrm{f}(\mathrm{x})=\mathrm{m}(\mathrm{x}-\mathrm{a}) and \mathrm{g}(\mathrm{x})=\mathbf{n}(\mathrm{x}-\mathrm{a})) then \lim \limits_{x \rightarrow a} \frac{f(x)}{g(x)}=\lim \limits_{x \rightarrow a} \frac{m(x-a)}{n(x-a)}=\frac{\mathbf{m}}{\mathbf{n}}=\frac{\text { slope of } f}{\text { slope of } g}

The really powerful result, discovered by John Bernoulli and named for the Marquis de 1'Hô pital who published it in his calculus book, is that the same pattern is true for differentiable functions even if they are not linear.

L'Hô pital's Rule ( "0/0" form )

If \mathrm{f} and \mathrm{g} are differentiable at \mathrm{x}=\mathrm{a}, and f(a)=0, g(a)=0, and g^{\prime}(a) \neq 0,

then \lim \limits_{x \rightarrow a} \frac{f(x)}{g(x)}=\frac{\mathrm{f}^{\prime}(\mathrm{a})}{\mathrm{g}^{\prime}(\mathrm{a})}=\frac{\text { slope of } \mathrm{f} \text { at a }}{\text { slope of } \mathrm{g} \text { at } \mathrm{a}}.

Idea for a proof: Even though \mathrm{f} and \mathrm{g} may not be linear functions, they are differentiable so at the point \mathrm{x}=\mathrm{a} they are "almost linear" in the sense that they are well approximated by their tangent lines at that point (Fig. 2):

since f(a)=g(a)=0 f(x) \approx f(a)+f^{\prime}(a)(x-a)=f^{\prime}(a)(x-a) and g(x) \approx g(a)+g^{\prime}(a)(x-a)=g^{\prime}(a)(x-a)

Fig. 2

(Unfortunately, we have ignored a couple subtle difficulties such as \mathrm{g}(\mathrm{x}) or \mathrm{g}^{\prime}(\mathrm{x}) possibly being 0 when \mathrm{x} is close to a. A proof of 1^{\prime} Hô pital's Rule is difficult and is not included.)

Example 1: Use 1'Hô pital's Rule to determine \lim \limits_{x \rightarrow 0} \frac{x^{2}+\sin (5 x)}{3 x} and \lim \limits_{x \rightarrow 1} \frac{\ln (x)}{e^{x}-e}.

Solution: (a) We could evaluate this limit without 1'Hô pital's Rule but let's use it. We can match the pattern of 1 'Hô pital's Rule by letting a=0, f(x)=x^{2}+\sin (5 x) and g(x)=3 x. Then f(0)=0, g(0) = 0, and \mathrm{f} and \mathrm{g} are differentiable with \mathrm{f}^{\prime}(\mathrm{x})=2 \mathrm{x}+5 \cos (5 \mathrm{x}) and \mathrm{g}^{\prime}(\mathrm{x})=3 so

\lim _{x \rightarrow 0} \frac{x^{2}+\sin (5 x)}{3 x}=\frac{\mathrm{f}^{\prime}(0)}{\mathrm{g}^{\prime}(0)}=\frac{2 \cdot 0+5 \cos (5 \cdot \mathbf{0})}{3}=\frac{5}{3}

(b) Let a=1, f(x)=\ln (x) and g(x)=e^{x}- e. Then f(1)=0, g(1)=0, f and g are differentiable for x near 1(x \neq 0), and f^{\prime}(x)=1 / x and g^{\prime}(x)=e^{x}. Then

\lim _{x \rightarrow 1} \frac{\ln (x)}{e^{x}-e}=\frac{\mathrm{f}^{\prime}(\mathbf{1})}{\mathrm{g}^{\prime}(\mathbf{1})}=\frac{1 / \mathbf{1}}{\mathrm{e}^{\mathbf{1}}}=\frac{1}{\mathrm{e}}

Practice 1: Use 1'Hô pital's Rule to find \lim \limits_{x \rightarrow 0} \frac{1-\cos (5 x)}{3 x} and \lim \limits_{x \rightarrow 2} \frac{x^{2}+x-6}{x^{2}+2 x-8}.

Strong Version of L'Hôpital's Rule

L'Hô pital's Rule can be strengthened to include the case when g^{\prime}(a)=0 and the indeterminate form " \infty/\infty ", the case when both \mathrm{f} and \mathrm{g} increase without any bound.

L'Hô pital's Rule (Strong " 0 / 0 " and " \infty / \infty " forms)

If \mathrm{f} and \mathrm{g} are differentiable on an open interval I which contains the point a, \mathrm{g}^{\prime}(\mathrm{x}) \neq 0 on I except possibly at \mathrm{a}, and

\lim \limits_{x \rightarrow a} \frac{f(x)}{g(x)} = " \frac{0}{0} " or " \frac{\infty}{\infty} "

then \lim \limits_{x \rightarrow a} \frac{f(x)}{g(x)}=\lim \limits_{x \rightarrow a} \frac{f^{\prime}(x)}{g^{\prime}(x)} provided the limit on the right exists.
( " a " can represent a finite number or " \infty ". )

Example 2: Evaluate \lim \limits_{x \rightarrow \infty} \frac{e^{7 x}}{5 x}.

Solution: As " x \rightarrow \infty ", both f(x)=e^{7 x} and g(x)=5 x increase without bound so we have an " \infty / \infty " indeterminate form and can use the Strong Version l'Hô pital's Rule:

\lim \limits_{x \rightarrow \infty} \frac{e^{7 x}}{5 x}=\lim \limits_{x \rightarrow \infty} \frac{7 e^{7 x}}{5}=\infty

The limit of f '/g ' may also be an indeterminate form, and then we can apply l'Hô pital's Rule to the ratio f ' / \mathrm{g} '. We can continue using l'Hô pital's Rule at each stage as long as we have an indeterminate quotient.

Example 3: \lim \limits_{x \rightarrow 0} \frac{x^{3}}{x-\sin (x)}

Solution: As x \rightarrow 0, f(x)=x^{3} \rightarrow 0 and g(x)=x-\sin (x) \rightarrow 0 so

\lim \limits_{x \rightarrow 0} \frac{x^{3}}{x-\sin (x)}=\lim \limits_{x \rightarrow 0} \frac{3 x^{2}}{1-\cos (x)} \rightarrow " \frac{0}{0} " so we can use l'Hô pital's Rule again

=\lim \limits_{x \rightarrow 0} \frac{6 x}{\sin (x)} \rightarrow " \frac{0}{0} " and again

=\lim \limits_{x \rightarrow 0} \frac{6}{\cos (x)}=\frac{6}{1}=6.

Practice 2: Use l'Hô pital's Rule to find \lim \limits_{x \rightarrow \infty} \frac{x^{2}+e^{x}}{x^{3}+8 x}.

Which Function Grows Faster

Sometimes we want to compare the asymptotic behavior of two systems or functions for large values of \mathrm{x}, and l'Hô pital's Rule can be a useful tool. For example, if we have two different algorithms for sorting 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: Algorithm A requires \mathrm{n} \cdot \ln (\mathrm{n}) steps to sort n names and algorithm B requires \mathrm{n}^{1.5} 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, \frac{\mathrm{n} \cdot \ln (\mathrm{n})}{\mathrm{n}^{1.5}}, and then take the limit of this ratio as n grows arbitrarily large: \lim \limits_{n \rightarrow \infty} \frac{n \cdot \ln (n)}{n^{1.5}}. If this limit is infinite, we say that \mathrm{n} \cdot \ln (\mathrm{n}) "grows faster" than \mathrm{n}^{1.5}. If the limit is 0 , we say that \mathrm{n}^{1.5} grows faster than \mathrm{n} \cdot \ln (\mathrm{n}). Since \mathrm{n} \cdot \ln (\mathrm{n}) and \mathrm{n}^{1.5} both grow arbitrarily large when \mathrm{n} is large, we can algebraically simplify the ratio to \frac{\ln (\mathrm{n})}{\mathrm{n}^{0.5}} and then use L'Hopital's Rule:

\lim \limits_{n \rightarrow \infty} \frac{\ln (n)}{n^{0.5}}=\lim \limits_{n \rightarrow \infty} \frac{1 / n}{0.5 n^{-0.5}}=\lim \limits_{n \rightarrow \infty} \frac{2}{\sqrt{n}}=0

\mathrm{n}^{1.5} grows faster than \mathrm{n} \cdot \ln (\mathrm{n}) so algorithm \mathrm{A} requires fewer steps for really large sorts.

Practice 3: Algorithm A requires \mathrm{e}^{\mathrm{n}} operations to find the shortest path connecting \mathrm{n} towns, algorithm B requires 100 \cdot \ln (\mathrm{n}) operations for the same task, and algorithm \mathrm{C} requires \mathrm{n}^{5} 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 \mathrm{f} approaches 0 and \mathrm{g} approaches 0 is not enough to determine the limit of \mathrm{f} / \mathrm{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 \limits_{x \rightarrow 0} 3 x / x=3, \lim \limits_{x \rightarrow 0} x^{2} / x=0, and  \lim \limits_{x \rightarrow 0} 5 x / x^{3}=\infty

Similarly, " \infty/\infty " is an indeterminate form because knowing that \mathrm{f} and \mathrm{g} both grow arbitrarily large is not enough to determine the value limit of \mathrm{f} / \mathrm{g} or if the limit exists:

\lim \limits_{x \rightarrow \infty} 3 x / x=3, \lim \limits_{x \rightarrow \infty} x^{2} / x=\infty, and \lim \limits_{x \rightarrow \infty} 5 x / x^{3}=0

Besides the indeterminate quotient forms " 0/0 " and " \infty/\infty " 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.

Product: If f approaches 0, and g grows arbitrarily large, the product \mathrm{f} \cdot \mathrm{g} has the indeterminant form " 0 \cdot \infty ".

Exponent: If \mathrm{f} and \mathrm{g} both approach 0, the function \mathrm{f}^{\mathrm{g}} has the indeterminant form " 0^{0} ".

If f approaches 1, and g grows arbitrarily large, the function \mathrm{f}^{\mathrm{g}} has the indeterminant form " 1^{\infty} ".

If f grows arbitrarily large, and g approaches 0, the function f^{g} has the indeterminant form " \infty^{0} ".

Difference: If \mathrm{f} and \mathrm{g} both grow arbitrarily large, the function \mathrm{f}-\mathrm{g} has the indeterminant form " \infty - \infty ".

Unfortunately, l'Hô pital's Rule can only be used directly with an indeterminate quotient (" 0/0 " or " \infty/\infty '), but these other forms can be algebraically manipulated into quotients, and then l'Hô pital's Rule can be applied to the resulting quotient.

Example 5: Evaluate \lim \limits_{x \rightarrow 0^{+}} \mathrm{x} \cdot \ln (\mathrm{x}) (" 0 \cdot(-\infty) " form)

Solution: This limit involves an indeterminate product, and we need a quotient in order to apply l'Hô pital's Rule. We can rewrite the product x \cdot \ln (x) as the quotient \frac{\ln (x)}{1 / x}, and then so apply l'Hô pital's Rule

\begin{aligned} \lim \limits_{x \rightarrow 0^{+}} x \ln (x) &=\lim \limits_{x \rightarrow 0^{+}} \frac{\ln (x)}{1 / x} \rightarrow \frac{\infty}{\infty} \\ &=\lim \limits_{x \rightarrow 0^{+}} \frac{1 / x}{-1 / x^{2}}=\lim \limits_{x \rightarrow 0^{+}}-x=0 \end{aligned}

A product f \cdot g with the indeterminant form " 0 \cdot \infty " can be rewritten as a quotient, \frac{f}{1 / g} or \frac{g}{1 / f}, and then l'Hô pital's Rule can be used.

Example 6: Evaluate \lim \limits_{x \rightarrow 0^{+}} \mathrm{x}^{\mathrm{x}} ( 0^{0}  form)

Solution: An indeterminate exponent can be converted to a product by recalling a property of exponential and
logarithm functions: for any positive number a, a=e^{\ln (a)} so f^{g}=e^{\ln (f g)}=e^{g \ln (f)}.
\lim \limits_{x \rightarrow 0^{+}} x^{x}=\lim \limits_{x \rightarrow 0^{+}} e^{\ln \left(x^{x}\right)}=\lim \limits_{x \rightarrow 0^{+}} e^{x \cdot \ln (x)} and this last limit involves an indeterminate product \mathrm{x} \cdot \ln (\mathrm{x}) \rightarrow 0 \cdot(-\infty) which we converted to a quotient and evaluated to be 0 in Example 5.
Our final answer is then \mathrm{e}^{\mathbf{0}}=\mathbf{1}:

\lim \limits_{x \rightarrow 0^{+}} x^{x}=\lim \limits_{x \rightarrow 0^{+}} e^{\ln \left(x^{x}\right)}=\lim \limits_{x \rightarrow 0^{+}} e^{x \cdot \ln (x)}=e^{0}=1

An indeterminate form involving exponents, \mathrm{f}^{\mathrm{g}} with the form " 0^{0}, " " 1^{\infty}, " or " \infty ^{0}, " can be converted to an indeterminate product by recognizing that \mathrm{f}^{\mathrm{g}}=\mathrm{e}^{\mathrm{g} \cdot \ln (\mathrm{f})} and then determining the limit of g \cdot \ln (f). The final result is \mathrm{e}^{(\text {limit of } \mathrm{g} \cdot \ln (\mathrm{f}))}.

Example 7: Evaluate \lim \limits_{x \rightarrow \infty}\left(1+\frac{a}{x}\right)^{x} (" 1^{\infty} " form)

Solution: \lim \limits_{x \rightarrow \infty}\left(1+\frac{a}{x}\right)^{x}=\lim \limits_{x \rightarrow \infty} \mathrm{e}^{\mathrm{x} \cdot \ln (1+\mathrm{a} / \mathrm{x})} so we need \lim \limits_{x \rightarrow \infty} \mathrm{x} \cdot \ln \left(1+\frac{\mathrm{a}}{\mathrm{x}}\right) \lim \limits_{x \rightarrow \infty} x \cdot \ln \left(1+\frac{a}{x}\right) \rightarrow " \infty \cdot 0 "  an indeterminate product so rewrite it as a quotient

=\lim \limits_{x \rightarrow \infty} \frac{\ln \left(1+\frac{a}{x}\right)}{1 / x} \rightarrow  \frac{0}{0} an indeterminate quotient so use l'Hô pital's Rule

=\lim \limits_{x \rightarrow \infty} \frac{\left(\frac{-a / x^{2}}{1+\frac{a}{x}}\right)}{\left(-\frac{1}{x^{2}}\right)}=\lim \limits_{x \rightarrow \infty} \frac{a}{1+\frac{a}{x}} \rightarrow \frac{\mathrm{a}}{1}=\mathbf{a}

Finally, \lim \limits_{x \rightarrow \infty}\left(1+\frac{a}{x}\right)^{x}=\lim \limits_{x \rightarrow \infty} e^{x \cdot \ln (1+a / x)}=\mathrm{e}^{\mathbf{a}}.

Practice Answers

Practice 1:
(a) \lim \limits_{x \rightarrow 0} \frac{1-\cos (5 x)}{3 x}. The numerator and denominator are both differentiable and both equal 0 when x=0, so we can apply l'Hô pital's Rule:

\lim \limits_{x \rightarrow 0} \frac{1-\cos (5 x)}{3 x}=\lim \limits_{x \rightarrow 0} \frac{5 \cdot \sin (5 x)}{3} \rightarrow \frac{0}{3}=0

(b) \lim \limits_{x \rightarrow 2} \frac{x^{2}+x-6}{x^{2}+2 x-8}. The numerator and denominator are both differentiable functions and they both equal 0 when x=0, so we can apply l'Hô pital's Rule:

\lim \limits_{x \rightarrow 2} \frac{x^{2}+x-6}{x^{2}+2 x-8}=\lim \limits_{x \rightarrow 2} \frac{2 x+1}{2 x+2}=\frac{5}{6}


Practice 2: \lim \limits_{x \rightarrow \infty} \frac{x^{2}+e^{x}}{x^{3}+8 x}. The numerator and denominator are both differentiable and both become arbitrarily large as x becomes large, so we can apply l'Hô pital's Rule:

\lim \limits_{x \rightarrow \infty} \frac{x^{2}+e^{x}}{x^{3}+8 x}=\lim \limits_{x \rightarrow \infty} \frac{2 x+e^{x}}{3 x^{2}+8} \rightarrow " \frac{\infty}{\infty} ". Using l'Hô pital's Rule again:

\lim \limits_{x \rightarrow \infty} \frac{2 x+e^{x}}{3 x^{2}+8}=\lim \limits_{x \rightarrow \infty} \frac{2+e^{x}}{6 x} \rightarrow " \frac{\infty}{\infty} " and again:

\lim \limits_{x \rightarrow \infty} \frac{2+e^{x}}{6 x}=\lim \limits_{x \rightarrow \infty} \frac{e^{x}}{6} \rightarrow \infty.


Practice 3: Comparing A with \mathrm{e}^{\mathrm{n}} operations to \mathrm{B} with 100 \cdot \ln (\mathrm{n}) operations. \lim \limits_{n \rightarrow \infty} \frac{e^{n}}{100 \cdot \ln (n)} \rightarrow " \frac{\infty}{\infty} " so use L'Hopital's Rule: \lim \limits_{n \rightarrow \infty} \frac{e^{n}}{100 \cdot \ln (n)}=\lim \limits_{n \rightarrow \infty} \frac{e^{n}}{100 / n}=\lim \limits_{n \rightarrow \infty} \frac{n \cdot e^{n}}{100}=\infty so B requires fewer operations than A.

Comparing B with 100 \cdot \ln (\mathrm{n}) operations to \mathrm{C} with \mathrm{n}^{5} operations.

\lim \limits_{n \rightarrow \infty} \frac{100 \cdot \ln (n)}{n^{5}} \rightarrow \frac{\infty}{\infty} \cdot \lim \limits_{n \rightarrow \infty} \frac{100 \cdot \ln (n)}{n^{5}}=\lim \limits_{n \rightarrow \infty} \frac{100 / n}{5 n^{4}}=\lim \limits_{n \rightarrow \infty} \frac{100}{5 n^{5}}=0

so B requires fewer operations than C. B requires the fewest operations of the three algorithms.

Comparing A with \mathrm{e}^{\mathrm{n}} operations to \mathrm{C} with \mathrm{n}^{5} operations. Using l'Hô pital's Rule several times:

\lim \limits_{n \rightarrow \infty} \frac{e^{n}}{n^{5}}=\lim \limits_{n \rightarrow \infty} \frac{e^{n}}{5 n^{4}}=\lim \limits_{n \rightarrow \infty} \frac{e^{n}}{20 n^{3}}=\lim \limits_{n \rightarrow \infty} \frac{e^{n}}{60 n^{2}}=\lim \limits_{n \rightarrow \infty} \frac{e^{n}}{120 n}=\lim \limits_{n \rightarrow \infty} \frac{e^{n}}{120}=\infty

so A requires more operations than C. A requires the most operations of the three algorithms.