Lagrange Error Bound Calculator

Enter the derivative bound M, the Taylor polynomial degree n, the center a, and the evaluation point x to compute the guaranteed maximum error |R_n(x)| ≤ M/(n+1)! × |x−a|^(n+1).

Quick Facts

Lagrange error bound
|R_n(x)| ≤ M/(n+1)! × |x−a|ⁿ⁺¹
Guaranteed worst-case error of a degree-n Taylor polynomial.
What M is
max |f⁽ⁿ⁺¹⁾(c)| for c between a and x
An upper bound on the (n+1)-th derivative over the interval.
Why it shrinks
(n+1)! grows faster than |x−a|ⁿ⁺¹
More terms usually mean a tighter guaranteed bound.

Your Results

Calculated
Lagrange Error Bound
-
|R_n(x)| ≤ M/(n+1)! × |x−a|ⁿ⁺¹
(n+1)!
-
Factorial in the denominator
|x − a|ⁿ⁺¹
-
Distance from center, raised to n+1
Guaranteed Decimal Places
-
⌊−log₁₀(bound)⌋ accurate digits

Ready

Enter M, n, a, and x, then press Calculate.

How the Lagrange Error Bound Works

When you approximate a function f(x) with its degree-n Taylor polynomial P_n(x) centered at x = a, the gap between the true value and the approximation is the remainder R_n(x) = f(x) − P_n(x). Taylor's theorem with the Lagrange form of the remainder says R_n(x) = f⁽ⁿ⁺¹⁾(c)/(n+1)! × (x−a)ⁿ⁺¹ for some (usually unknown) value c between a and x. Since c is rarely known exactly, you instead find M — an upper bound for |f⁽ⁿ⁺¹⁾(c)| on the interval between a and x — and use it to bound the worst-case error: |R_n(x)| ≤ M/(n+1)! × |x−a|ⁿ⁺¹. This calculator computes that bound directly from M, n, a, and x.

How the calculation works

Enter M (the largest value |f⁽ⁿ⁺¹⁾| can take between a and x), the degree n of the Taylor polynomial, the center a, and the evaluation point x. The calculator finds |x − a|, raises it to the power n+1, computes (n+1)!, and multiplies M × |x−a|ⁿ⁺¹ / (n+1)! to give the guaranteed maximum error of the degree-n approximation. It also reports roughly how many decimal digits of accuracy that bound guarantees, using ⌊−log₁₀(bound)⌋.

Common mistakes

  • Using the wrong derivative order: the bound uses the (n+1)-th derivative, not the n-th — for a degree-4 polynomial (n = 4), you need a bound on the 5th derivative.
  • Treating the bound as the exact error: the Lagrange error bound is a worst-case ceiling, not the actual remainder — the true error is usually smaller.
  • Using an M that is too small: M must hold for every c between a and x, not just at x itself — use the maximum of |f⁽ⁿ⁺¹⁾| over the entire interval, not a single point estimate.

Real-world applications

  • AP Calculus BC and college calculus courses use the Lagrange error bound to determine how many Taylor series terms are needed to hit a target accuracy.
  • Numerical methods and scientific computing use it to certify that a polynomial or series approximation of a function (like sin x, eˣ, or ln x) meets an error tolerance before it ships in software.
  • Engineers use truncation-error bounds like this one to justify that a simplified linear or quadratic model of a nonlinear function stays accurate enough over its working range.

Frequently Asked Questions

What is the Lagrange error bound formula?
The Lagrange error bound states |R_n(x)| ≤ M/(n+1)! × |x − a|ⁿ⁺¹, where R_n(x) is the remainder after a degree-n Taylor polynomial centered at a, M is an upper bound on |f⁽ⁿ⁺¹⁾(c)| for c between a and x, and (n+1)! is the factorial of n+1.
How do I find M, the bound on the derivative?
Take the (n+1)-th derivative of f(x), then find the largest value of its absolute value on the closed interval between a and x. If the exact maximum is hard to pin down, any valid upper bound works — the resulting error bound will just be slightly less tight.
Is the Lagrange error bound the exact error?
No. It is a guaranteed worst-case upper bound on |f(x) − P_n(x)|, not the exact error. The actual error is often much smaller, but it is never larger than the computed bound as long as M is a valid bound on the (n+1)-th derivative.
Why does the error bound usually shrink as n increases?
For a fixed x and a, the factor |x−a|ⁿ⁺¹/(n+1)! shrinks toward 0 as n grows, because factorial growth eventually outpaces any fixed power. As long as M does not grow without bound as n increases, adding more Taylor polynomial terms typically tightens the guaranteed error.