What the mean value theorem says
If f is continuous on the closed interval [a, b] and differentiable on the open interval (a, b), then at some point c between a and b, the instantaneous rate of change equals the average rate of change. Picture it: somewhere, the tangent line is parallel to the secant line joining the two ends.
Rolle's theorem is the special case f(a) = f(b): then the secant is flat and some c has f′(c) = 0.
How it's calculated
- Compute the secant slope m = (f(b) − f(a))/(b − a).
- Differentiate f symbolically, using the same engine as the derivative calculator.
- Solve f′(c) = m on (a, b) numerically: scan 2,000 subintervals for sign changes of f′(x) − m, refine each by bisection, and catch double roots where the curve only touches. When a root is a simple fraction or square root, the calculator confirms it exactly.
- Check the conditions by scanning f and f′ at 2,001 points for gaps, jumps and points where f′ is undefined.
Worked example
Take f(x) = x³ − x on [0, 2].
- f(0) = 0 and f(2) = 6, so the secant slope is (6 − 0)/(2 − 0) = 3.
- f′(x) = 3x² − 1. Set 3c² − 1 = 3, so c² = 4/3.
- Only the positive root is in (0, 2): c = 2/√3 ≈ 1.154701.
At that point the tangent line has slope 3, exactly parallel to the line through (0, 0) and (2, 6).
When the theorem doesn't apply
- A corner: f(x) = |x| on [−1, 1] is continuous but has no derivative at 0. The secant slope is 0, yet f′ is only ever −1 or 1, so no c works.
- A gap: f(x) = 1/x on [−1, 1] isn't continuous at 0, so the theorem promises nothing.
- A straight line: if f is linear, every c in (a, b) works.
Limitations
- The continuity and differentiability checks are numerical scans. They catch the usual problems (division by zero, square roots of negatives, corners from |x|) but can't prove continuity the way a written argument does.
- The search lists up to six values of c. A function that wiggles very fast may have more.