Lagrange Error Bound Calculator - Lagrange Remainder Bound

Use this lagrange error bound calculator with polynomial degree, center, evaluation point, and derivative bound M to get the maximum error.

Updated: June 16, 2026 • Free Tool

Lagrange Error Bound Calculator

Degree n of the Taylor polynomial. Use 0 for a constant, 1 for a tangent line, and so on.

Point a where the Taylor polynomial is built. Maclaurin polynomials use a = 0.

Point x at which the polynomial approximation is evaluated.

Positive number M such that |f^(n+1)(z)| is at most M for every z between a and x.

Results

Maximum Absolute Error |R_n(x)|
0
Distance |x - a| 0
Factorial (n + 1)! 0
Inverse Factorial 1 / (n + 1)! 0
x Equals Center 0

What Is Lagrange Error Bound Calculator?

A lagrange error bound calculator estimates the maximum possible error when a Taylor polynomial of degree n is used to approximate a function f(x) at a point x. The bound comes from the Lagrange form of the Taylor remainder, and it answers a specific question: how far can the polynomial value be from the true function value before the (n + 1)th derivative starts to dominate?

  • AP and undergraduate calculus homework: Confirm the textbook bound for Maclaurin approximations of e^x, sin(x), cos(x), and ln(1 + x).
  • Choosing how many terms to keep: Decide the smallest n that brings the Lagrange error below a target tolerance for a fixed x.
  • Bounding numerical error in code: Estimate how much precision a Taylor series implementation will lose for a given x and degree.
  • Comparing polynomial centers: Test how shifting the expansion center a changes the size of the error bound on a fixed interval.

The Lagrange form of the remainder is the most common error bound taught alongside Taylor series because it is a single closed-form inequality that uses only the polynomial degree, the distance |x - a|, the factorial (n + 1)!, and a derivative bound M. It does not need the alternating series test or a geometric series argument.

Use the bound to check a homework answer, decide how many terms to keep in a software implementation, or compare two different expansion centers for the same function. The output is the worst-case absolute error, not the actual signed error of a particular approximation.

Because the bound divides by (n + 1)!, the factorial calculator is the natural companion for checking the factorial in the denominator before you trust a small error estimate.

How Lagrange Error Bound Calculator Works

The calculator applies the Lagrange form of the Taylor remainder, which bounds the error by a derivative bound, the distance from the expansion center, and a factorial term.

|R_n(x)| <= M * |x - a|^(n + 1) / (n + 1)!, where M >= |f^(n + 1)(z)| for every z in the closed interval between a and x
  • Polynomial degree n: Integer n that fixes the degree of the Taylor polynomial used to approximate f(x).
  • Expansion center a: Point a around which the Taylor polynomial is built. Maclaurin polynomials use a = 0.
  • Evaluation point x: Point x at which the polynomial is evaluated and the error is measured.
  • Derivative bound M: Positive number M such that |f^(n + 1)(z)| is at most M for every z between a and x.

When the evaluation point equals the center, every term of the Taylor polynomial that depends on (x - a) vanishes and the bound is zero. This matches Taylor's theorem: the polynomial agrees with the function exactly at the center.

For the factorial, this calculator computes (n + 1)! with a small integer loop instead of using a JavaScript factorial call, which keeps the result exact up to n = 20. Beyond n = 20 the factorial overflows IEEE 754 doubles, so the calculator caps the degree to keep the bound safe and meaningful.

Maclaurin polynomial of sin(x) at x = 0.5

n = 4, a = 0, x = 0.5, M = 1 because |cos(z)| <= 1 on the interval [-0.5, 0.5].

(n + 1)! = 5! = 120. |x - a|^(n + 1) = 0.5^5 = 0.03125. The bound is 1 * 0.03125 / 120 = 0.0002604...

Maximum possible error is roughly 2.6 x 10^-4, so sin(0.5) is approximated to four decimal places by the degree-4 Maclaurin polynomial.

A single bound replaces the alternating series estimate and works for any interval that keeps |cos(z)| <= 1.

According to OpenStax Calculus, the Lagrange form of the Taylor remainder bounds the error of the n-th degree Taylor polynomial by |R_n(x)| <= M * |x - a|^(n+1) / (n + 1)!, where M bounds |f^(n+1)(z)| on the closed interval between a and x.

When you build the Taylor polynomial by hand and want to check the algebra, the polynomial division calculator helps confirm the term-by-term coefficients of the approximation.

Key Concepts Explained

Four ideas keep the Lagrange error bound from being applied incorrectly: the bound on the derivative, the distance from the center, the factorial, and the difference between a bound and a true error.

Derivative bound M

M is a positive number that is at least as large as |f^(n+1)(z)| for every z in the closed interval between a and x. It must hold for the whole interval, not just at one point.

Distance from the center

|x - a| is the gap between the evaluation point and the expansion center. Larger gaps amplify the bound through the (n + 1)th power, especially when |x - a| is greater than 1.

Factorial shrinkage

(n + 1)! grows faster than any polynomial in n. Even modest degrees push the denominator high enough to make the bound very small when |x - a| is below 1.

Bound versus actual error

The Lagrange form gives the maximum possible error, not the actual signed error. The actual error can be much smaller than the bound, especially for alternating series like sin(x) and cos(x).

The bound can also be applied to a Maclaurin series by setting a = 0. Maclaurin polynomials are the most common case in calculus homework, so the defaults in this calculator match a Maclaurin example for sin(x).

If your function oscillates or has bounded derivatives, choose a tight M. A loose M produces a valid but unhelpful bound that hides whether the approximation is actually accurate.

Combining or simplifying several Taylor polynomials is easier with the add and subtract polynomials calculator, which keeps the sign and degree bookkeeping correct.

How to Use This Calculator

The lagrange error bound calculator is built so you can copy values from a textbook problem or a course question and get the bound in one step.

  1. 1 Enter the polynomial degree: Type the integer n that matches the Taylor polynomial you are using. For a constant approximation use 0, for a tangent line use 1, and so on.
  2. 2 Enter the expansion center a: Type the center where the polynomial is built. Maclaurin polynomials use a = 0, but a non-zero center works too.
  3. 3 Enter the evaluation point x: Type the x at which the polynomial will be evaluated. The error bound is computed for this point.
  4. 4 Enter a true derivative bound M: Type a positive number M that is at least as large as |f^(n+1)(z)| on the closed interval between a and x.
  5. 5 Read the maximum error: Use the bound to compare against a target tolerance, decide whether to add another term, or grade a calculus answer.

For an AP Calculus question asking how many terms of the Maclaurin series of sin(x) approximate sin(0.5) to three decimal places, start with n = 4, a = 0, x = 0.5, M = 1, then increase n until the bound drops below 0.0005.

Benefits of Using This Calculator

The lagrange error bound calculator gives a defensible error estimate for Taylor approximations in a few keystrokes, and it scales from textbook checks to engineering accuracy planning.

  • Catches missing terms: If the bound is much larger than the tolerance you need, you know the polynomial degree is too small.
  • Works for non-alternating functions: Unlike the alternating series remainder estimate, the Lagrange form works for any smooth function with a derivative bound.
  • Honors the expansion center: Setting a non-zero center is as easy as a = 0, so you can test different polynomial centers for the same function.
  • Scales up to high degree: The integer factorial loop and a degree cap keep the bound exact and safe up to n = 20.
  • Backs up engineering estimates: Engineers and analysts use the bound to justify dropping higher-order terms in Taylor-based numerical methods.

The output also surfaces the (n + 1)! factorial and its reciprocal, which is helpful when you want to show why the bound shrinks so quickly as the degree grows. A homework explanation or design memo can quote the factorial directly from the calculator.

The calculator returns the worst-case absolute error, so it doubles as a sanity check on alternating series bounds.

After you trust the bound, the polynomial graphing calculator plots the Taylor polynomial next to the true function so the actual error band becomes visible in the picture.

Factors That Affect Your Results

Three factors drive the size of the Lagrange error bound, and a fourth, the choice of M, decides how tight the bound really is.

Polynomial degree n

Higher n divides the bound by a much larger factorial, so the bound falls quickly when |x - a| is small.

Distance |x - a|

Larger distances raise the bound through the (n + 1)th power. Distances above 1 are expensive even for high-degree polynomials.

Derivative bound M

Loose M values inflate the bound, while tight M values such as e^0.3 for the exponential produce sharp, useful limits.

  • The Lagrange form is a worst-case bound. The actual error of a Taylor approximation can be much smaller, especially for alternating series like sin(x) and cos(x).
  • You must supply a true bound M for |f^(n+1)(z)| on the entire interval. A value that is too small invalidates the bound, even if it makes the answer look better.
  • The bound works for real, smooth functions with continuous higher derivatives. It is not a substitute for domain checks, radius-of-convergence analysis, or interval-specific remainder theorems when the function has singularities.

The bound is most useful when you can also state the radius of convergence for the Taylor series. Inside the radius, raising n is enough to drive the Lagrange bound to zero. Outside the radius, the bound is only meaningful for a fixed n and a fixed x in the interval of convergence.

According to Paul's Online Math Notes, the Lagrange error bound for the n-th degree Taylor polynomial of f(x) at x is |R_n(x)| <= M * |x - a|^(n+1) / (n + 1)!, where M is a number such that |f^(n+1)(z)| <= M on the closed interval between a and x.

According to Wolfram MathWorld, the Lagrange remainder for a Taylor polynomial of degree n at x is given by R_n(x) = f^(n+1)(xi) * (x - a)^(n+1) / (n + 1)! for some xi in the open interval between a and x.

When the distance from the center is a fraction such as 0.5 or 0.3, the fractional exponent calculator confirms the exact power raised to (n + 1) in the bound.

lagrange error bound calculator showing polynomial degree, center, evaluation point, derivative bound, and computed Taylor remainder
lagrange error bound calculator showing polynomial degree, center, evaluation point, derivative bound, and computed Taylor remainder

Frequently Asked Questions

Q: What is the Lagrange error bound?

A: The Lagrange error bound is an inequality that gives the maximum possible error of the n-th degree Taylor polynomial of a function at a chosen point. It uses a derivative bound M, the distance from the expansion center, and the factorial of the next index.

Q: What is the formula for the Lagrange error bound?

A: The bound is |R_n(x)| <= M * |x - a|^(n + 1) / (n + 1)!, where M is a number such that |f^(n + 1)(z)| is at most M for every z between a and x, and n is the degree of the Taylor polynomial.

Q: How do I find M for the Lagrange error bound?

A: Choose a positive number M that is at least as large as |f^(n + 1)(z)| for every z in the closed interval between a and x. Common picks are M = 1 for |sin(z)| and |cos(z)| on a small interval, or M = e^x evaluated at the largest endpoint of the interval for the exponential function.

Q: How many terms of a Taylor series do I need for a given accuracy?

A: Pick a target tolerance, plug in M and |x - a|, and increase n until the bound drops below the tolerance. The factorial term in the denominator grows very fast, so only a small number of extra terms is usually needed when |x - a| is below 1.

Q: What is the difference between the Lagrange and the alternating series remainder?

A: The Lagrange form works for any smooth function with a derivative bound, while the alternating series remainder only applies to alternating series whose terms shrink in absolute value. The Lagrange form is the safer general-purpose choice.

Q: When does the Lagrange error bound not work?

A: The bound fails when the function is not smooth on the closed interval, when you cannot place a finite bound M on |f^(n + 1)(z)|, or when the evaluation point lies outside the interval of convergence of the Taylor series.