A very quick exercise in L'Hopital's rule

2022 October 10

When some ratio \frac {f(x)}{g(x)} has a limit in an “indeterminate form”, in that \lim f(x) = 0 = \lim g(x), L’Hopital’s rule (first discovered by Bernoulli) allows for calculating the limit:

\lim_{x \to c} \frac {f(x)}{g(x)} = \lim_{x \to c} \frac {f'(x)}{g'(x)} \qquad \text{ if } \qquad \lim_{x \to c} f(x) = \lim_{x \to c} g(x) = 0

under certain conditions. And if at first you don’t succeed, try, try again: when \frac {f'(x)}{g'(x)} is also in indeterminate form, you can differentiate as many times as needed.

As an aside, if we suppose that f and g can be approximated as Taylor series near c = 0, one can easily find that

\lim_{x \to 0} \frac {a_0 + a_1 x + \cdots}{b_0 + b_1 x + \cdots} = \frac {a_n}{b_n} = \frac {n! a_n}{n! b_n} = \lim_{x \to 0} \frac {D_x^n (a_0 + a_1 x + \cdots)}{D_x^n (b_0 + b_1 x + \cdots)}

when the leading n terms of f(x) = a_0 + a_1 x + \cdots and g(x) = b_0 + b_1 x + \cdots are both zero, representing the case where n differentiations are needed. Here D_x represents the differentiation-with-respect-to-x operator.

While I have occasionally run into cases where multiple applications of L’Hopital’s rule are needed, the other day1by which I mean 7 years ago… I am a bit slow at updating this blog I was struck by a situation which necessitated a recursive application of L’Hopital’s rule. Consider the Lambert W function which is defined implicitly by the equation

W(z) \exp (W(z)) = z,

that is, W(z) is the inverse of the function xe^x. We will only be interested in the principal real branch, which is defined for - \frac 1e \leq z < \infty. Note that W(- 1 / e) = -1. Also, per Wikipedia, we have

D_z W(z) = \frac {W(z)}{z(1 + W(z))}.

Ok, now the calculation I ran into in my research was:

\lim_{z \to 0} D_z[W((z^2 + z - 1) e^{z - 1})]

Let F(z) = (z^2 + z - 1) e^{z - 1} and V(z) = W(F(z)) so our goal is to calculate \lim DV where the limit goes z \to 0.

Note that V(0) = W(F(0)) = W(-e^{-1}) = -1. Starting by applying the chain rule to the derivative of W, we have


\begin{aligned}
    \lim DV = \lim D[W(F(z))]
    &= \lim \frac {W(F(z))}{F(z) (1 + W(F(z)))} D[F(z)] \\
    &= \lim \frac {V}{F(z) (1 + V)} ((2z + 1) e^{z - 1} + (z^2 + z - 1) e^{z - 1}) \\
    &...

From what initially, as I was first calculating it, looked like it would blow up endlessly, instead comes a surprisingly simple and clean result!

Thanks Harry Altman for identifying a mistake in an earlier draft.


  1. by which I mean 7 years ago… I am a bit slow at updating this blog↩︎

Follow RSS/Atom feed or twitter for updates.