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.