Lagrange Mean Value Theorem Calculator

Enter a function and endpoints to compute c. Choose precision and scan for multiple solutions. Get graphs, tables, and downloads in one clean page.

Interactive graph

Plots f(x) and the secant line on [a,b]. Calculated points c appear as markers.
Function x^2

Secant slope value: 4. Interval: [1, 3].
Use x, pi, e, operators + - * / ^, and functions: sin, cos, tan, exp, ln, log, sqrt, abs.
Any real number. If a > b, endpoints are swapped.
Pick b ≠ a for a valid interval.
Controls rounding in the output table.
Higher values detect more roots but run slower.
Stopping threshold for bisection and zero checks.
More iterations improve accuracy for tough functions.
Used for central-difference derivative.
Typical range: 1e−8 to 1e−5 for smooth functions.
Example input: x^2, a = 1, b = 3 → one solution is c = 2.

Example data table

Function f(x) Interval [a,b] Secant slope Expected c (one valid choice)
x^2 [1, 3] 4 2
sin(x) [0, pi/2] 2/pi ≈ 0.690
exp(x) [0, 1] e − 1 ≈ 0.541
Values are approximate for non-polynomial examples.

Formula used

If f is continuous on [a,b] and differentiable on (a,b), then there exists at least one c ∈ (a,b) such that:

f'(c) = ( f(b) − f(a) ) / ( b − a )

This calculator estimates c numerically by computing the derivative with a central difference and searching for roots of g(x) = f'(x) − slope.

How to use this calculator

  1. Enter f(x) using supported operators and functions.
  2. Set endpoints a and b for your interval.
  3. Adjust scan steps and tolerance if your function is oscillatory.
  4. Click Calculate to display the result above the form.
  5. Use Download CSV or Download PDF after calculation.

Input design and numeric hygiene

The calculator accepts a single-variable function and two endpoints. It validates that a ≠ b and swaps endpoints when a > b to keep the interval consistent. Common scientific functions are supported (trigonometric, exponential, logarithmic, and square root). Display precision is capped at 14 decimals to keep reports readable and reduce misleading digits in exported files.

Derivative approximation controls

The derivative is estimated using a central-difference scheme, which typically provides better symmetry than a one-sided estimate. The default step is set relative to interval length, so a wide interval avoids too-small steps and a narrow interval avoids too-large steps. Manual step control remains available when a function is especially steep or when numerical noise appears in the error column.

Root scanning and bracketing strategy

A scan divides (a,b) into evenly spaced subintervals and evaluates g(x)=f'(x)−slope. With the default scan steps of 200, many classroom examples are detected quickly. Higher scan steps, up to 2000, increase sensitivity for oscillatory inputs such as sin(10x), at the cost of extra evaluations.

Interpreting multiple c values

Multiple solutions can occur when the derivative crosses the secant slope more than once. Each reported c includes f(c), a numeric f'(c), and the residual f'(c)−slope. In practice, residual values near the tolerance threshold indicate a stable match. If you need fewer points, raise tolerance slightly or reduce scan steps.

Graph-driven verification

The interactive plot overlays the function and the secant line on the same interval, making the theorem visually checkable. When results exist, markers show the estimated c locations on the curve. If a function is undefined at an endpoint (for example ln(x) at x≤0), the graph warns and the computation is blocked to prevent exporting meaningless values.

Exportable reporting for audit trails

CSV export stores inputs, f(a), f(b), the secant slope, and all detected solutions with residuals. PDF export provides a compact, single-page record suitable for assignments, lab notebooks, and QA logs. Together, these outputs support reproducibility: the same expression and settings should recreate the same numerical estimates within rounding tolerance.

FAQs

1) Which theorem is implemented here?

It computes points for the Lagrange Mean Value Theorem, finding c in (a,b) where f'(c) equals the secant slope between a and b.

2) Why can the tool return more than one c?

If f'(x) crosses the secant slope multiple times on the interval, the numerical scan detects multiple sign changes and reports each bracketed root as a separate valid estimate.

3) What should I change if no solution is found?

Increase scan steps, loosen tolerance slightly, or try a different derivative step. Also check that f(a) and f(b) are finite and that the function is differentiable on (a,b).

4) Is the derivative exact?

No. The derivative uses a central-difference approximation, so results depend on step size and floating-point behavior. The residual column helps you judge how closely the estimate satisfies the equality.

5) Which functions are supported in expressions?

You can use sin, cos, tan, asin, acos, atan, exp, ln, log, sqrt, abs plus constants pi and e, with operators + - * / ^ and parentheses.

6) What do CSV and PDF exports include?

Exports include your function, interval, endpoint values, secant slope, numeric settings, and all detected c solutions with f(c), f'(c), and residual error for documentation.

Notes

Related Calculators

cyclic group calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.