# Simple "real world" l'Hôpital's rule problem?

I am on a team which is writing a set of lecture notes for differential calculus.

I am using a format of "Break ground" which poses a problem, "Dig in" which develops the tools to solve the problem, and "Reinforce" which practices using the tools we just developed.

While using an abstract mathematical problem for the "Break ground" section is fine, some people on my team would rather that this problem be a "real application" whenever possible.

We have been trying to find such an example for l'Hôpital's rule for a while, but we have run into the following roadblocks:

1. Simple l'Hôpital's rule problems (which require only one differentiation) can seemingly all be solved by appealing to the definition of the derivative. So it is only when we apply l'Hôpital's rule twice that the method seems "necessary". However, such a problem seems too complicated for a "first brush" with l'Hôpital.

2. We have two "real world" examples of l'Hopital in action.

a. One in deriving continuous interest as a limit of discretely compounded interest. This is, perhaps, better done using the definition of the exponential function.

b. The other involves taking the limit of the velocity function of a falling object with air resistance, as air resistance goes to $0$. This is a great example, but there are at least two essential variables (time after the fall $t$, and the coefficient of air resistance $k$). The presence of more than one variable could be confusing (especially when you are thinking of velocity as a function of time, but then taking the limit with respect to $k$).

Does anyone have an example of l'Hopital's rule for which it is both necessary (or at least convenient), relatively straight forward , and is a "real world application"?

If no one can come up with something meeting all 3 requirements, I will probably settle for using the "abstract" problem

$$\lim_{x \to 1} \frac{x^4-2x+1}{4x^4-15x+11}$$

and then motivate the idea of the rule by "zooming in" on the point $(1,0)$ (play with this graph), and welcoming the students to try to approximate the limit by the ratio of the tangent line approximations at $x=1$.

• One possibility would be to teach Taylor series first, and l'Hospital after that. Once they understand Taylor series, then I think it's easy to make up a well-motivated, practical, and extremely transparent example involving second derivatives.
– user507
Jan 23, 2015 at 18:36
• The denominator should be 4x^4 - 15x + 11, not x^4 - 15x + 11. Jan 25, 2015 at 15:25
• @gnasher729 Thanks, I was copying over from the link, and must have missed that. Jan 25, 2015 at 15:50
• i sure would like to know the need for l'hospitals rule. i would hate to see a student trying l'hospitals on $\lim_{x \to 0}\frac{\tan(x^2)}{\tan x \sin x}$ examples of misuse abound.
– abel
Jan 25, 2015 at 23:54
• To find this limit without LHR, rewrite the function as $\cos(x) \cdot x \cdot \frac{sin(x^2)}{x^2} \cdot \frac{x}{\sin(x)}$ Jun 14, 2017 at 18:35

Here's a possible problem: The Rayleigh–Jeans Law for black body radiation at a wavelength $\lambda$ was given by $$B_{RJ}(\lambda) = \frac{K}{\lambda^4}$$ where $K$ is a constant (depending on temperature, speed of light, Boltzmann's constant, but that's not important). The problem is this clearly gives divergent energy output as wavelength approaches zero.

Plank's Law (in light of quantum mechanics) instead gives $$B_P(\lambda) = \frac{k_1}{\lambda^5}\frac{1}{e^{k_2/\lambda}-1}$$

for constants $k_1$, $k_2$. What happens to Plank's Law as wavelength approaches $0$?

Note: This is also one of those great problems you can come back to with Taylor Series and show that for large $\lambda$ (and more details about the constants above) the two agree to a first-order approximation.

• Thank you. This is a very nice example. It is superior to my velocity example since I am actually taking a limit of the argument, rather than a "parameter". Also, I think I give particular constants $K$, $k_1$ and $k_2$ to remove the distraction of many variables. This is really great! Jan 23, 2015 at 22:11
• I guess this example can be written in a form where it can be done by applying the definition of the derivative: numerator=$k_1\lambda^{-4}(e^{k_2/\lambda}-1)^{-1}$, denominator=$\lambda$. But that's a little unnatural/tricky.
– user507
Jan 24, 2015 at 0:15
• Actually, I think that @BenCrowell's approach is the right one. I have yet to see an application where l'Hospital is really the most illuminating way.
– Dirk
Feb 4, 2015 at 20:13

In thermodynamics and information theory the function $-x\log x$ for $0 \le x \le 1$ occurs in the definition of entropy. Just Google "entropy" and see. But that formula is not really defined at $x = 0$. It is natural to declare its value at $x=0$ to be $\lim_{x\rightarrow 0^+} -x\log x$. A graph makes it very plausible that the limit is $0$. This can be justified with L'Hospital's rule once, and that one use of the rule does not look like the definition of the derivative.

If you let $y=1/x$ then that limit is the same as $\lim_{y\rightarrow \infty} \log(y)/y$, which is obviously $0$ without using L'Hospital's rule if you understand how slowly logarithms grow, although such understanding is normally gained by L'Hospital's rule in the first place, e.g., to show $\lim_{y\rightarrow \infty} \log(y)/y^c = 0$ (or equivalently, $\lim_{x \rightarrow 0^+} x^c\log x = 0$) for any $c>0$ by L'Hospital.

As a different application, it's important that exponential functions (with base greater than 1) ultimately always grow faster than power functions. That is, if $a > 1$ and $n$ is a positive integer then $\lim_{x \rightarrow \infty} a^x/x^n = \infty$ or equivalently $\lim_{x \rightarrow \infty} x^n/a^x = 0$. This can be shown by L'Hospital's rule $n$ times (or just one time with induction). The special case $a = e$ is probably safer to focus on than the general case, and shows up in Euler's beautiful integral formula $n! = \int_0^\infty x^ne^{-x}\,dx$; it's good to know that the integrand decays to $0$ for large $x$.

• Thanks! This is another really perfect example. Jan 24, 2015 at 14:07
• But like the Planck's Law example, this can also be made into a derivative, of $-x^2\log x$.
– user507
Jan 24, 2015 at 19:33
• @BenCrowell: I disagree that this can be made into a derivative the way you suggest. I think your idea is to write $-x\log x = f(x)/x$ where $f(x) = -x^2\log x$, but you can't make this a derivative at $0$ before you settle the problem that $f(x)$ is not initially even defined at $0$. You're thinking $f(0) = 0$, but the original formula for $f(x)$ makes no sense there. You need to figure out $\lim_{x \rightarrow 0^+} f(x)$, which is the same kind of problem as the one I posted. Of course you could compute the limit by L'Hospital's rule, but that would defeat the point of your remark.
– KCd
Jan 24, 2015 at 21:53

I personally don't see any reason to teach L'Hopital's rule at all until after understanding how to manipulate asymptotic expansions. Even Taylor series should come after asymptotic series as a special nice case. The reason is that asymptotic expansions can do everything that L'Hopital can do and more, including handling non-differentiable functions, and is more intuitive. $$\def\lfrac#1#2{{\large\frac{#1}{#2}}} \def\wi{\subseteq}$$

For example, $$\lim_{ d \to 0 } \lfrac{f(x+d)-2f(x)+f(x-d)}{d^2} = f''(x)$$ for any function $$f$$ and $$x \in \operatorname{Dom}(f)$$ such that $$f$$ is twice-differentiable at $$x$$. This (and its higher order generalizations) can be used to numerically estimate the derivatives of a function given its values. It may seem that this is perfect to illustrate the power of L'Hopital's rule, but in fact it illustrates how asymptotic expansions actually give more information.

First, let's see how L'Hopital's rule can be used:

$$\lim_{ d \to 0 } \lfrac{f(x+d)-2f(x)+f(x-d)}{d^2}$$

$$= \lim_{ d \to 0 } \lfrac{f'(x+d)-f'(x-d)}{2d}$$ [by L'Hopital because $$f$$ is differentiable in a neighbourhood of $$x$$]

$$= \frac{1}{2} \lim_{ d \to 0 } \lfrac{f'(x+d)-f'(x)}{d} + \frac{1}{2} \lim_{ d \to 0 } \lfrac{f'(x-d)-f'(x)}{-d}$$ [because these two limits exist]

$$= \frac{1}{2} \lim_{ d \to 0 } \lfrac{f'(x+d)-f'(x)}{d} + \frac{1}{2} \lim_{ d \to 0 } \lfrac{f'(x+d)-f'(x)}{d}$$

$$= f''(x)$$ [by definition of derivative of $$f'$$ at $$x$$]

So we get the result, but actually much more can be said about the result if we look at the asymptotic expansion of $$f$$ at the given $$x$$ as follows:

If $$f(x+d) \in f(x) + a d + b \frac{d^2}{2} + o(d^2)$$ as $$d \to 0$$ for some constants $$a,b$$:

$$\lfrac{f(x+d)-2f(x)+f(x-d)}{d^2} \in b + o(1)$$ as $$d \to 0$$.

This is strictly stronger than the earlier result, because some $$f$$ are not even once differentiable in any neighbourhood around $$x$$ but still satisfy the asymptotic condition. For example if $$f(t) = t+\lfrac{1}{\lfloor \frac1{t^2} \rfloor}$$ for any real $$t \ne 0$$, and $$f(0) = 0$$, then as $$t \to 0$$ we can easily obtain $$f(t) \in t+\lfrac{1}{\frac1{t^2}+O(1)}$$ $$\wi t+\lfrac{t^2}{1+O(t^2)}$$ $$\wi t+t^2(1+O(t^2))$$ $$\wi t+t^2+o(t^2)$$ and so $$\lfrac{f(t)+f(-t)}{t^2} \in 1+o(1)$$.

Now even if we are not interested in "not nice" functions, we still can say even more than L'Hopital's rule, specifically for "even nicer" thrice differentiable functions. It can be proven (one form of Taylor's theorem) that:

For any function $$f$$ and $$x \in \operatorname{Dom}(f)$$ such that $$f$$ is $$n$$ times differentiable at $$x$$:

$$f(x+d) \in \sum_{k=0}^n f^{(k)}(x) \frac{d^k}{k!} + o(d^n)$$ as $$d \to 0$$.

So we immediately get:

For any function $$f$$ and $$x \in \operatorname{Dom}(f)$$ such that $$f$$ is thrice differentiable at $$x$$:

$$\lfrac{f(x+d)-2f(x)+f(x-d)}{d^2} \in f''(x) + o(d)$$ as $$d \to 0$$.

As well as:

For any function $$f$$ and $$x \in \operatorname{Dom}(f)$$ such that $$f$$ is $$4$$ times differentiable at $$x$$:

$$\lfrac{f(x+d)-2f(x)+f(x-d)}{d^2} \in f''(x) + f^{(4)}(x) \frac{d^2}{12} + o(d^3)$$ as $$d \to 0$$.

Notice further that the approximation is exact if $$f$$ is a cubic polynomial. All these precise results cannot be obtained by L'Hopital. Also don't forget that a direct use of L'Hopital will fail to simplify all but the simplest limits, and so typically some clever manipulation is necessary. The problem is how to derive those manipulations! One way is, unsurprisingly, by analyzing the asymptotic expansions...

• While I agree with you completely, I am mostly bound by the order of topics given by my (huge) universities coordinated classes. I can effectively shift things around inside one semester, but it would be difficult to shift things over semester barriers, which is the case with the Taylor's series $\to$ l'Hopital suggestion. Jan 24, 2015 at 14:24
• @StevenGubkin: Ah I perfectly understand. I still think it is better to teach limits by following the intuition all the way into asymptotic expansions before introducing L'Hopital's rule, so that it will be clearly understood as just a trick in a toolbox just like rationalizing, rather than the 'most powerful hammer' to hit at every limit possible, as that encourages blind (and often incorrect) attempts rather than insightful understanding of the limit. Even the $ε-δ$ definition should be used when appropriate and not in general, otherwise the reasoning can be both cumbersome and backward. Jan 24, 2015 at 15:06
• @StevenGubkin: It is also not necessary to use full-blown asymptotic notation in the first introductory course to calculus, partly because it is not so easy to make precise and partly because we can convert most of it into direct applications of the squeeze theorem. Basically we find hard bounds and propagate them through until the end and then use the squeeze theorem. Jan 24, 2015 at 15:10
• For two examples, see math.stackexchange.com/q/705417 and math.stackexchange.com/q/857072. For some further discussion, see meta.math.stackexchange.com/q/13008, esp. the comments thread.
– Did
Sep 11, 2015 at 13:37
• @Did: Yes thanks for the explicit examples. =) Sep 12, 2015 at 7:57

This is a nice question, and I look forward to seeing people's answers. You suggest that if we want examples that can't be done by the definition of the derivative, we can use ones that require second derivatives. An additional possibility is a limit at infinity, although that might or might not work for your order of topics. Here's a simple real-world example.

You have some money, and two choices of what to invest it in. A share in Acme, Inc., costs \$7, and returns a dividend of \$1 per year. A share of Glutco costs \$30 and gives a dividend of \$2 per year. If we want to compare the long-term value of the two investments, a natural way to do it is with the limit

$$\lim_{t\rightarrow\infty}\frac{-7+t}{-30+2t} \quad .$$

The top represents the net return on Acme, the bottom Glutco. If this limit is greater than 1, then Acme is the better long-term investment. The constant terms are irrelevant, and the competition between the top and bottom is determined by which one grows faster.

• But you could draw the same conclusion using elementary algebra or just "common sense". Jan 23, 2015 at 22:01
• Thanks, but I agree with 200_success that while, in some sense, this is the essence of l'Hopitals rule in the case $t \to \infty$. it does not pass the test of requiring (or being more convenient to do with) l'Hopital's rule. Jan 23, 2015 at 22:06
• I would hesitate to use this example in any case, because it does not discount future values, (and people seem to have an intuitive agreement that dividends now worth more than dividends in the future, so one may face such a question from a student). But the inclusion of a usual discount factor for dividends makes both the numerator and the denominator bounded as $t \to \infty$. Nov 27, 2016 at 17:11

This suggestion uses integrals and the fundamental theorem of calculus. If that is not yet known to the students, my example will not fit so well.

Background: The story says that Dirichlet (in a note written on a paper) around 1838 suggested to Gauss that the number of primes less than or equal to $x$, usually denoted $\pi(x)$, is for large $x$ approximately given by the integral $$\int_2^x\frac{1}{\ln t}\,dt.$$ On the other hand, the prime number theorem states that $$\lim_{x\to+\infty}\frac{\pi(x)}{x/\ln x}=1.$$

Exercise: Show that the integral suggested by Dirichlet is indeed a good approximation, in the sense that $$\lim_{x\to+\infty}\frac{\ln x}{x}\int_2^x\frac{1}{\ln t}\,dt=1.$$

Comment: This limit appeared on math.SE, and it is indeed also solved easily using integration by parts. Nevertheless, I think it is a nice application of the l'Hospital rule.

• Thanks, this is very nice. I actually introduced this integral in the Fundamental Theorem of Calculus section to convey the idea of an area valued function. So this would fit in nicely there. Dec 16, 2015 at 14:21

I have a colleague whose hobby is to always figure out how to a evaluate any given limit without L'Hospital's rule. Every week in the lunch room, there is yet another example.

I think a very good application of the rule is to $\lim_{x\to 0}\frac{\sin(x)}{x}$.

I frequently teach the calculus sequence at the university level. And I am fortunate to have a daughter in high school who took AP Calculus AB as a junior and is now taking BC as a senior. On occasion I have mentioned L'Hospital to her. It has been interesting to gauge her reaction to the rule over time. For awhile a fake quotient rule took hold: $$\left(\frac{f(x)}{g(x)}\right)'=\frac{f'(x)}{g'(x)}.$$ And she would resist paying attention to the conceptual derivation that involves linearization of the numerator and denominator. But as she becomes more comfortable with all the concepts, she appreciates this viewpoint and is even becoming a clone of my senior colleague. She often has the patience to understand how to evaluate limits without the rule, but at the same time feels confident using it when appropriate. And now she even appreciates the Taylor polynomial perspective.

What I think I have learned by observation is that the L'Hospital rule should be viewed as a "developmental" concept that threads through Calculus I and II, and the instructor (or parent!) needs to be patient.

• A big problem with $\frac{\sin(x)}{x}$ is that this limit must be computed in some way (usually squeeze theorem) in order to derive that the derivative of $\sin$ is $\cos$. Jan 23, 2015 at 22:08
• Steve's point is important. Using L'Hospital's rule on this limit is circular reasoning since the limit is needed to figure out $\sin'(x)$.
– KCd
Jan 24, 2015 at 3:24
• But you would typically not use the squeeze theorem to approach $\frac{\sin(cx)}{x}$. I think many people would instead use L'Hospital. Jan 25, 2015 at 17:37
• By rewriting $\sin(cx)/x$ as $c\sin(cx)/(cx)$, we see that figuring out how this behaves as $x\rightarrow 0$ is the same as figuring out the value of $\lim_{t\rightarrow 0} c\sin(t)/t$, which brings us back to the original limit you wrote about in the answer. What "many people" would do is not directly important, since many people would handle $\lim_{x\rightarrow 0} \sin(x)/x$ by L'Hospital's rule after they learn about that even though it is a circular argument.
– KCd
Dec 16, 2015 at 5:59

In statistics we use the Box-Cox transform $$y^{(\lambda)} = \begin{cases} \frac{y^\lambda -1}{\lambda}, & \text{if \lambda \not= 0} \\ \ln y, & \text{if \lambda=0} \end{cases}$$ as a continuous extension of the power transforms that include the natural logarithms as a limiting case when $\lambda=0$. To show the limit when $\lambda \rightarrow 0$ use L'hopitals rule.

Another example from statistics is the following. The $\alpha$-divergence between two probability densities defined on the same space is $$d_\alpha (f || g) = \frac1{\alpha-1} \ln \int f(x)^\alpha g(x)^{1-\alpha}\; dx$$ The limit when $\alpha \rightarrow 1$ is the Kullback-Leibler divergence: $$D_{KL}(f || g) = \int f(x) \ln\frac{f(x)}{g(x)} \; dx$$ which can be calculated by L'hopital.

• Thanks, this is interesting. It appears that your $y^{(\lambda)}$ is equal to $\int_1^y t^{\lambda-1} dt$. So this is also pretty cool, that the limit of these antiderivatives of $t^{\lambda-1}$ is an antiderivative of $t^{-1}$. Jun 10, 2017 at 21:21

This one is somewhat "real-world" in that it involves a question that can be posed without knowing anything about L'Hopital's rule. But I must warn you that it takes three iterations.

From the point $(\cos\theta,\sin\theta)$ on the unit circle, drop a perpendicular to the $x$-axis, and consider the region bounded by that perpendicular, the $x$-axis, and the arc from $(1,0)$ back to $(\cos\theta,\sin\theta)$. Ask what fraction of the area of that region is between the chord from $(1,0)$ to $(\cos\theta,\sin\theta)$ and the arc from $(1,0)$ to $(\cos\theta,\sin\theta)$, and then take the limit of that fraction as $\theta\downarrow0.$

• May I ask what is the real-world significance of this limit? Nov 27, 2016 at 9:52
• @user21820 : It answers a question of geometry that can be posed without knowing anything about L'Hopital's rule. Nov 27, 2016 at 18:10
• I get that, but I couldn't think of a practical reason anyone would want the limit of that ratio, so I'd be interested to know if there is. Nov 28, 2016 at 2:45
• @user21820 : I agree that that would potentially be of great interest, but I don't know such an application. Jun 10, 2017 at 17:52
• @user21820 : I have posted the following question about this: math.stackexchange.com/questions/2317572/… Jun 10, 2017 at 18:06

Suppose a company has two new types of sweet to test out. The company gets two jars of the sweets and a lot of children. They allow the children to eat the sweets and frequently weigh the jars to see which sweet is most popular. The company will sell packets of sweets according to the ratio the children eat the sweets in. As time goes on the ratio of the weights will go towards $\frac{0}{0}$ and can not be computed. A solution is to compare the rate of change of each weight between measurements.

• The change in weight between measurements is even smaller than the weights and therefore using them will be even worse as they will go to zero even faster. Furthermore, it is not continuous and hence there isn't even a rate of change to begin with. Jan 24, 2015 at 5:56
• @user21820 let there be infinitely many children and sweets have infinitely small weight... :) Jan 24, 2015 at 10:18

At the beginning of a race, the race cars have zero position and velocity, but they will have some non-zero derivative. So have a red car with greater acceleration and lower top speed, and a blue car with lower acceleration and greater top speed, and graph the ratio of distance travelled as a function of time. See if the ratio at early times depends on top speed or what. The position vs time functions can be chosen for convenience (your polynomials are probably good enough if you make a few simple modifications to give zero initial speed and velocity and nonzero acceleration.)

I think the benefit of this is that they are working with concepts they are familiar with (beginning a race instead of $x=0$, starting at the beginning from rest instead of $f(0)=0,\ f'(0)=0$, acceleration instead of $f''(x)$, etc).