The Mean Value Theorem
The Mean Value Theorem says that somewhere between two points, a smooth function's instantaneous rate of change equals its average rate of change. It looks modest, yet almost every "the derivative tells us about the function" result rests on it: a zero derivative means a constant function, a positive derivative means increasing, and derivative bounds turn into error bounds. Here we prove it from Rolle's theorem and put it to work.
Rolle's theorem
Rolle's Theorem. Let be continuous on , differentiable on , with . Then there is a number in with .
Proof. If is constant on , then for every in . Otherwise takes some value different from , say larger (the smaller case is symmetric). By the Extreme Value Theorem, attains an absolute maximum on at some . Since , is not an endpoint, so is in , has a local maximum there and exists. By Fermat's theorem . ∎
All three hypotheses are needed: on (not differentiable at 0) has no horizontal tangent, and neither has a function with a jump.
The Mean Value Theorem
Mean Value Theorem (MVT). Let be continuous on and differentiable on . Then there is a in with
, equivalently .
Proof. Subtract the secant line from . The secant through and is with . Let .
Geometrically: there is a tangent line parallel to the secant. Physically: if you drive 150 km in 2 hours, at some instant your speedometer read exactly 75 km/h.
import sympy as sp
x = sp.symbols('x', real=True)
f = x**3 - 3*x + 1
a, b = 0, 3
m = (f.subs(x, b) - f.subs(x, a)) / (b - a)
print("secant slope m =", m)
cs = [c for c in sp.solve(sp.Eq(sp.diff(f, x), m), x) if a < c < b]
print("c with f'(c) = m:", cs, "≈", [round(float(c), 4) for c in cs])secant slope m = 6
c with f'(c) = m: [sqrt(3)] ≈ [1.7321]
The theorem promises at least one ; it does not say how to find it, and there may be several. Its power lies in using without knowing it.
Consequences
1. Zero derivative means constant. If for all in an interval , then is constant on . Take any in ; the MVT gives .
2. Equal derivatives differ by a constant. If on , apply consequence 1 to : . This is why every antiderivative carries a (Antiderivatives).
3. Sign of gives monotonicity. If on , then for , . This is the Increasing/Decreasing Test of the next lesson.
4. Derivative bounds become Lipschitz bounds. If on , then . For sine, gives for all real :
import numpy as np
rng = np.random.default_rng(7)
x = rng.uniform(-10, 10, 100_000)
y = rng.uniform(-10, 10, 100_000)
ratio = np.abs(np.sin(x) - np.sin(y)) / np.abs(x - y)
print("largest |sin x - sin y| / |x - y| seen:", round(float(ratio.max()), 6))
print("bound from MVT with |cos| <= 1: 1")
# A sharper use: e^x on [0, 0.1] has f' = e^x <= e^0.1
M = np.exp(0.1)
print("|e^0.1 - e^0| =", round(float(np.exp(0.1) - 1), 6), "<= M*0.1 =", round(float(M * 0.1), 6))largest |sin x - sin y| / |x - y| seen: 0.999992
bound from MVT with |cos| <= 1: 1
|e^0.1 - e^0| = 0.105171 <= M*0.1 = 0.110517
A picture
import numpy as np
import matplotlib.pyplot as plt
f = lambda x: x**3 - 3*x + 1
a, b = 0.0, 3.0
m = (f(b) - f(a)) / (b - a)
c = np.sqrt((m + 3) / 3) # solves 3c² − 3 = m
xs = np.linspace(-0.3, 3.2, 300)
plt.figure(figsize=(6, 4))
plt.plot(xs, f(xs), label="f(x) = x³ − 3x + 1")
plt.plot(xs, f(a) + m * (xs - a), "--", label=f"secant, slope {m:g}")
plt.plot(xs, f(c) + m * (xs - c), ":", label=f"tangent at c ≈ {c:.3f}")
plt.scatter([a, b, c], [f(a), f(b), f(c)], zorder=3)
plt.ylim(-3, 20); plt.legend(); plt.grid(alpha=0.3)
print(f"tangent at c = {c:.4f} is parallel to the secant (slope {m:g})")tangent at c = 1.7321 is parallel to the secant (slope 6)
In software
- Lipschitz constants in ML. A network layer with bounded derivative (weights with bounded spectral norm) changes its output by at most for an input change . Spectral normalisation in GANs, robustness certificates against adversarial examples and gradient clipping all lean on this MVT inequality.
- Error analysis. "Rounding the input by changes the output by at most " is the MVT. It is how numerical libraries reason about condition numbers.
- Convergence proofs. Fixed-point iterations converge when near the fixed point, since shrinks distances: the core of the proof that Newton's method converges.
Exercises
Exercise 1: Check the hypotheses
Does Rolle's theorem apply to on ? Is there a with ?
Answer
No: is not differentiable at 0. And there is no such .
Solution
and is continuous, but is undefined at and never zero. The theorem's conclusion fails because a hypothesis fails.
Exercise 2: Find the MVT point
Find every promised by the MVT for on .
Answer
.
Solution
Exercise 3: Exactly one root
Show that has exactly one real root.
Answer
There is a root in and there cannot be two.
Solution
Existence: , , so the Intermediate Value Theorem gives a root in . Uniqueness: if with , Rolle gives with ; but . Contradiction.
import numpy as np
roots = np.roots([1, 0, 0, 0, 4, -3])
print([round(float(r.real), 6) for r in roots if abs(r.imag) < 1e-9])[0.706115]
Exercise 4: An inequality from the MVT
Use the MVT to prove for .
Answer
for some in .
Solution
Apply the MVT to on : with . Since , .
Test yourself
In the proof of the MVT, which function does Rolle's theorem get applied to?
- itself
- the tangent line at
- minus the secant line through and
If on and , what is the largest possible value of ?
- 8
- 12
- 17
- 35
for every in an interval. What follows?
- is constant on the interval
- and are both constant
- Nothing in general