Calcist

Style

Buttons

Spacing

How much to show

Decimal places

Text size

Mean value theorem calculator

Enter f(x) and an interval [a, b]. You get the secant slope, every value of c where the tangent is parallel to it, whether the theorem's conditions hold, and a graph.

Use x, numbers, + − * / ^ and brackets, with sin, cos, tan, sec, csc, cot, arcsin, arccos, arctan, e^x, ln, log (base 10), log_2(x), sqrt and abs. You can write 2x, sin x and pi.

Private: calculated on your device. Nothing you type is sent anywhere.

Next: Want the tangent line itself? Use the linear approximation calculator. For the slopes, see the derivative calculator.

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.

f′(c) = (f(b) − f(a)) / (b − a), for at least one c in (a, b)

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

  1. Compute the secant slope m = (f(b) − f(a))/(b − a).
  2. Differentiate f symbolically, using the same engine as the derivative calculator.
  3. 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.
  4. 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].

  1. f(0) = 0 and f(2) = 6, so the secant slope is (6 − 0)/(2 − 0) = 3.
  2. f′(x) = 3x² − 1. Set 3c² − 1 = 3, so c² = 4/3.
  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.

Sources

How we checked this

Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:

  • x³ − x on [0, 2]: c = 2/√3 ≈ 1.1547005 ✓
  • x² on [1, 3]: c = 2 ✓
  • Linear f: every c works ✓
  • |x| on [−1, 1]: not differentiable at 0, theorem doesn't apply ✓

Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.

Add this calculator to your website (free)

Paste this code into any web page. The calculator works on your page, resizes itself, has no ads and no tracking, and nothing your visitors type is sent anywhere. More about embedding.

Questions people ask

What is the mean value theorem in simple terms?

On a smooth stretch of a curve, there's a point where the slope of the curve equals the average slope between the endpoints. If you drove 120 miles in 2 hours, at some moment you were going exactly 60 mph.

What is the MVT formula?

f′(c) = (f(b) − f(a))/(b − a) for some c strictly between a and b, provided f is continuous on [a, b] and differentiable on (a, b).

How do I find c in the mean value theorem?

Work out the secant slope, differentiate f, set f′(c) equal to the slope and solve for c. Keep only the solutions strictly between a and b.

What's the difference between Rolle's theorem and the mean value theorem?

Rolle's theorem is the case f(a) = f(b). The secant slope is then 0, so there's a point where f′(c) = 0, a flat tangent.

Related calculators