Foundations to Frontier
Tests
A. Mathematical Foundations › A3 Calculus and Analysis › Single-variable calculus

Mean Value Theorem and L'Hôpital's Rule

Somewhere, the instantaneous rate equals the average rate. This innocent-looking theorem turns derivative bounds into guarantees, from speed cameras and Lipschitz bounds to step sizes for gradient descent and the convergence of iterative solvers. L'Hôpital's rule settles 0/0 limits.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

The speed-camera theorem

Some motorways have section cameras that photograph your car at two points 10 km apart. If you took 5 minutes, your average speed was 120 km/h. The police then know your speedometer showed exactly 120 km/h at some moment, even though no camera saw it. You can’t average 120 without passing through 120 at some instant.

That is the mean value theorem.

Mean value theorem: the tangent that matches the average
average slope (f(b) − f(a))/(b − a) = -0.2100 · points with f′(c) equal to it: -0.9644, 0.9644
Orange = secant from a to b; dashed green = tangents parallel to it. The theorem guarantees at least one such c for any a < b; there may be several. "Road trip": the secant slope is the average speed, and some moment's speedometer reading matches it.
Why engineers care

If you know a robot arm can never move faster than 2 rad/s, the mean value theorem guarantees that in 0.1 s it moves at most 0.2 rad. Speed limits become position guarantees, which is exactly what safety certification needs.

📝 Quick check (Level 0)
0/3 answered
  1. 1. You drive 180 km in 3 hours. At some moment your speedometer must have shown…
  2. 2. Cameras 10 km apart, 5 minutes between photos. Average speed?
  3. 3. A robot joint's speed is at most 2 rad/s. The most it can turn in 0.5 s?

Level 1: Beginner

★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.

The theorem

If ff is continuous on [a,b][a,b] and differentiable on (a,b)(a,b), then for some c∈(a,b)c\in(a,b):

f′(c)=f(b)−f(a)b−af'(c) = \frac{f(b) - f(a)}{b - a}

Example. f(x)=x2f(x) = x^2 on [0,4][0,4]: the average slope is 16/4=416/4 = 4, and f′(c)=2c=4f'(c) = 2c = 4 gives c=2c = 2.

Rolle’s theorem is the special case f(a)=f(b)f(a) = f(b). Somewhere in between, the tangent is horizontal.

L’Hôpital’s rule

For a “0/0” limit, compare the rates instead of the values:

lim⁡x→af(x)g(x)=lim⁡x→af′(x)g′(x)(if f(a)=g(a)=0 and the right side exists)\lim_{x\to a}\frac{f(x)}{g(x)} = \lim_{x\to a}\frac{f'(x)}{g'(x)} \quad (\text{if } f(a) = g(a) = 0 \text{ and the right side exists})

Example. lim⁡x→0ex−1x=lim⁡ex1=1\lim_{x\to0}\frac{e^x - 1}x = \lim\frac{e^x}1 = 1. Similarly, lim⁡x→0sin⁡2xx=lim⁡2cos⁡2x1=2\lim_{x\to0}\frac{\sin2x}x = \lim\frac{2\cos2x}1 = 2.

📝 Quick check (Level 1)
0/3 answered
  1. 1. MVT point c for x² on [0, 4]?
  2. 2. Average slope of x³ on [0, 2]?
  3. 3. lim_{x→0} (eˣ − 1)/x = ?

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

What the MVT buys you

Consequence Statement Used for
zero derivative f′=0f' = 0 on an interval ⇒ ff constant uniqueness of antiderivatives (A3.1-6)
monotonicity f′>0f'>0 ⇒ strictly increasing proving inequalities, invertibility
Lipschitz bound ∣f′∣≤L\lvert f'\rvert\le L ⇒ ∣f(x)−f(y)∣≤L∣x−y∣\lvert f(x) - f(y)\rvert\le L\lvert x - y\rvert error propagation, robustness (A2.3-8)
contraction ∣g′∣≤q<1\lvert g'\rvert\le q<1 ⇒ xk+1=g(xk)x_{k+1} = g(x_k) converges fixed-point solvers, value iteration
🐍 Exercise 1: find the mean-value point
Bisect on f′(c) − slope to find c for x², x³ and sin. Then check that a smooth section-camera trip averaging 120 km/h really hits 120 km/h.

L’Hôpital in practice

  • 0·∞: xln⁡x=ln⁡x1/xx\ln x = \frac{\ln x}{1/x}, so the limit is lim⁡1/x−1/x2=lim⁡(−x)=0\lim\frac{1/x}{-1/x^2} = \lim(-x) = 0 as x→0+x\to0^+.
  • 1^∞: take logs. ln⁡(1+a/x)x=xln⁡(1+a/x)→a\ln(1 + a/x)^x = x\ln(1 + a/x)\to a, so (1+a/x)x→ea(1 + a/x)^x\to e^a.
  • Growth rates: applying the rule nn times gives xn/ex→0x^n/e^x\to0 and ln⁡x/xp→0\ln x/x^p\to0 (p>0p>0). So exponentials beat powers, and powers beat logarithms, which is the basis of algorithm complexity classes.
  • Repeated use: 1−cos⁡xx2→sin⁡x2x→cos⁡x2→12\frac{1 - \cos x}{x^2}\to\frac{\sin x}{2x}\to\frac{\cos x}2\to\frac12.
📝 Quick check (Level 2)
0/3 answered
  1. 1. lim_{x→0⁺} x ln x = ?
  2. 2. lim_{x→∞} (1 + 2/x)ˣ = ?
  3. 3. |f′| ≤ 3 on [0, 5]. Max |f(5) − f(0)|?

Level 3: Advanced

★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.

The chain of proofs

Fermat. If ff has a local max at an interior point cc where ff is differentiable, then f′(c)=0f'(c) = 0. The difference quotients are ≤0\le0 from the right and ≥0\ge0 from the left.

Rolle. If f(a)=f(b)f(a) = f(b), the extreme value theorem (A3.1-1) gives a max and a min on [a,b][a,b]. If both are at the endpoints, ff is constant. Otherwise one is interior, and Fermat gives f′(c)=0f'(c) = 0. ∎

MVT. Tilt the function. Let h(x)=f(x)−f(b)−f(a)b−a(x−a)h(x) = f(x) - \frac{f(b) - f(a)}{b - a}(x - a). Then h(a)=h(b)=f(a)h(a) = h(b) = f(a), so Rolle gives h′(c)=0h'(c) = 0, which is the MVT. ∎

Cauchy’s MVT. (f(b)−f(a))g′(c)=(g(b)−g(a))f′(c)(f(b) - f(a))g'(c) = (g(b) - g(a))f'(c). Apply Rolle to h=(f(b)−f(a))g−(g(b)−g(a))fh = (f(b) - f(a))g - (g(b) - g(a))f.

L’Hôpital (0/0). If f(a)=g(a)=0f(a) = g(a) = 0, Cauchy’s MVT on [a,x][a,x] gives f(x)g(x)=f′(cx)g′(cx)\frac{f(x)}{g(x)} = \frac{f'(c_x)}{g'(c_x)} with cxc_x between aa and xx. As x→ax\to a, cx→ac_x\to a. ∎

A pitfall

lim⁡x→∞x+sin⁡xx=1\lim_{x\to\infty}\frac{x + \sin x}{x} = 1, yet the derivative ratio 1+cos⁡x1\frac{1 + \cos x}1 oscillates and has no limit. L’Hôpital only says: if the derivative ratio has a limit, the original ratio has the same one. Here it tells you nothing.

Exercise 3.1: Prove that |sin a − sin b| ≤ |a − b|

By the MVT, sin⁡a−sin⁡b=cos⁡(c)(a−b)\sin a - \sin b = \cos(c)(a - b) for some cc, and ∣cos⁡c∣≤1\lvert\cos c\rvert\le1.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Rolle for x² − 4x on [0, 4] gives c = ?
  2. 2. lim_{x→0} (x − sin x)/x³ = ?
  3. 3. The MVT is proved by applying Rolle to…

Level 4: Expert

★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.

Why iterative solvers converge

For x=g(x)x = g(x), the MVT gives xk+1−x∗=g(xk)−g(x∗)=g′(ck)(xk−x∗)x_{k+1} - x^* = g(x_k) - g(x^*) = g'(c_k)(x_k - x^*). If ∣g′∣≤q<1\lvert g'\rvert\le q<1, the error shrinks by at least qq each step, and asymptotically by ∣g′(x∗)∣\lvert g'(x^*)\rvert. This is the Banach fixed-point theorem in one dimension. It underlies value iteration in reinforcement learning (where the Bellman operator is a γ\gamma-contraction), Picard iteration for ODEs, and many robotics solvers. Newton’s method makes g′(x∗)=0g'(x^*) = 0, which upgrades convergence to quadratic.

🐍 Exercise 2 (research): contraction rate vs Newton
Solve x = cos x by fixed-point iteration and by Newton. Check that the fixed-point error ratio equals the MVT prediction |g′(x*)| = sin x* ≈ 0.6736, and that Newton reaches machine precision in 4 steps.

Step sizes for gradient descent

If ∣f′′∣≤L\lvert f''\rvert\le L (the function is L-smooth), the MVT/Taylor argument gives the descent lemma:

f(y)≤f(x)+f′(x)(y−x)+L2(y−x)2f(y)\le f(x) + f'(x)(y - x) + \frac L2(y - x)^2

With y=x−ηf′(x)y = x - \eta f'(x) and η=1/L\eta = 1/L, every step decreases ff by at least f′(x)2/(2L)f'(x)^2/(2L). This is the foundation of every convergence proof for gradient descent (Nesterov, 2004; Bottou, Curtis and Nocedal, 2018). It’s also why step sizes above 2/L2/L can make training diverge (Practice Code 5), and why learning-rate warm-up and gradient clipping exist.

More applications

  • Certified safety for robots. Bounds on joint velocity give bounds on the swept volume between collision checks, so a discrete-time check certifies the continuous motion.
  • Numerical analysis. Every error formula for finite differences, quadrature and interpolation contains an f(k)(ξ)f^{(k)}(\xi) for “some ξ\xi”, which is a generalized MVT (A3.1-10).

References

  1. M. Rolle (1691). Démonstration d’une méthode pour résoudre les égalitez de tous les degrez.
  2. G. de l’Hôpital (1696). Analyse des infiniment petits. (Content due to Johann Bernoulli.)
  3. A.-L. Cauchy (1823). Résumé des leçons sur le calcul infinitésimal. (The modern mean value theorem.)
  4. S. Banach (1922). “Sur les opérations dans les ensembles abstraits et leur application aux équations intégrales.” Fundamenta Mathematicae, 3.
  5. Y. Nesterov (2004). Introductory Lectures on Convex Optimization. Springer. Section 1.2.
  6. L. Bottou, F. Curtis, J. Nocedal (2018). “Optimization methods for large-scale machine learning.” SIAM Review, 60(2).
  7. R. Bellman (1957). Dynamic Programming. Princeton University Press.