Mean Value Theorem Calculator

Type a function of x (like x^2 or sin(x)) and an interval a to b — plain numbers or pi, 2pi, pi/2, e. You get the average rate of change and every c in (a, b) where the tangent slope f'(c) matches it.

Put this calculator on your website — free

Copy one snippet and give your visitors a working Mean Value Theorem Calculator.

How the Mean Value Theorem calculator works

Here’s the theorem in traffic-court terms: if you cover 60 miles in exactly one hour, your average speed was 60 mph — and at some instant during that hour, your speedometer read exactly 60. Not roughly, not on average: exactly. You can’t get from an average of 60 without passing through 60, because speed changes continuously. Some toll systems issue tickets on precisely this logic, timestamping you at two toll plazas and computing the average. The Mean Value Theorem is that idea made rigorous: for a function f that is continuous on [a, b] and differentiable on (a, b), there is at least one point c strictly between a and b where the instantaneous rate of change f′(c) equals the average rate of change over the whole interval.

This calculator computes the average rate (f(b) − f(a))⁄(b − a), then hunts for every c where f′(c) matches it: it estimates the derivative with a symmetric difference quotient (h = 10−5), scans 2,000 subintervals for places where f′(x) − average changes sign, and sharpens each crossing with 40 rounds of bisection — pinning c down to more digits than we display. Supported syntax: numbers, x, the operators + - * / ^, parentheses, the functions sin cos tan asin acos atan sqrt abs ln log exp (log is base 10, ln is natural), and the constants pi and e. Multiplication must be explicit — 2*x, not 2x.

The formula

f′(c) = (f(b) − f(a)) ⁄ (b − a)   for some c in (a, b)

Here a and b are the interval endpoints, f(a) and f(b) are the function values there, the right-hand side is the slope of the secant line joining (a, f(a)) to (b, f(b)), and c is a point where the tangent line has that exact slope — geometrically, a spot where the tangent runs parallel to the secant. The fine print does real work: f must be continuous on the closed interval [a, b] and differentiable on the open interval (a, b). Both are needed, and the theorem guarantees at least one c — there can be several, and this calculator lists them all.

Worked example

f(x) = x^2 on [1, 4]. The average rate of change is (f(4) − f(1))⁄(4 − 1) = (16 − 1)⁄3 = 5. The derivative is f′(x) = 2x, so we need 2c = 5, giving c = 2.5. Check: 2.5 sits strictly inside (1, 4), and f′(2.5) = 5 — the tangent at x = 2.5 is exactly parallel to the secant through (1, 1) and (4, 16). Enter x^2 with endpoints 1 and 4 and the calculator returns c ≈ 2.5.

Why the hypotheses matter

Drop either condition and the guarantee evaporates. Take f(x) = abs(x) on [−1, 1]: it’s continuous, and the average rate is (1 − 1)⁄2 = 0 — but f′(x) is −1 to the left of zero and +1 to the right, never 0. The theorem isn’t violated; it just never applied, because the corner at x = 0 kills differentiability at one single point, and one point is all it takes. Or take f(x) = 1/x on [−1, 1]: the average rate works out to 1, yet f′(x) = −1/x² is negative everywhere — the discontinuity at x = 0 voids the warranty. When this calculator shows a “hypotheses not met” warning instead of an answer, that’s what it detected: a place inside your interval where f or its derivative stops being a finite number. It’s not being difficult — it’s telling you the theorem has nothing to promise there.

Frequently asked questions

What does the Mean Value Theorem actually say?

If f is continuous on [a, b] and differentiable on (a, b), there is at least one point c strictly between a and b where f'(c) equals the average rate of change (f(b) − f(a))/(b − a). The everyday version: average 60 mph over an hour and at some instant you were doing exactly 60. Geometrically, somewhere the tangent line runs parallel to the secant line through the endpoints.

What conditions does the Mean Value Theorem require?

Two: f must be continuous on the closed interval [a, b], and differentiable on the open interval (a, b). Both matter. f(x) = abs(x) on [−1, 1] has average rate 0, but its derivative is never 0 — the single corner at x = 0 breaks differentiability, and the guarantee vanishes. Jumps and vertical asymptotes inside the interval break continuity the same way.

Can there be more than one value of c?

Yes — the theorem guarantees at least one c, not exactly one. Any function whose derivative wanders back and forth across the average rate crosses it multiple times: sin(x) over a few full periods produces a whole list of valid c values. This calculator scans the entire interval and reports every crossing it finds, not just the first.

How does this calculator find c?

Numerically. It estimates f'(x) with a symmetric difference quotient using h = 0.00001, scans 2,000 subintervals of (a, b) for sign changes of f'(x) minus the average rate, then refines each crossing with 40 iterations of bisection and removes duplicates. That pins each c down well past the four decimals displayed, and the results table shows f'(c) at every c so you can verify the match yourself.

What functions and syntax can I type in?

Numbers, the variable x, the operators + − * / ^ (with parentheses), the functions sin, cos, tan, asin, acos, atan, sqrt, abs, ln, log (base 10), and exp, plus the constants pi and e. Write multiplication explicitly — 2*x, not 2x — and give every function parentheses: sin(x), not sin x. The endpoints a and b also accept pi and e shorthand like pi/2 or 2pi.

Related calculators