Report

Help us improve this tool

Lagrange Error Bound Calculator

Calculate the maximum error bound on Taylor polynomial approximations using Taylor's theorem and Lagrange remainder formula.

O M T

What is the Lagrange Error Bound?

The Lagrange Error Bound (derived from Taylor's Theorem with remainder) establishes a rigorous upper bound on the numerical error incurred when approximating a differentiable function $f(x)$ with an $n$-th degree Taylor polynomial (or Maclaurin polynomial when centered at $a = 0$).

Taylor polynomials approximate transcendental and non-polynomial functions around a center point $a$:

$$f(x) = P_n(x) + R_n(x)$$

where $P_n(x) = \sum_{k=0}^n \frac{f^{(k)}(a)}{k!} (x - a)^k$ is the $n$-th degree Taylor polynomial, and $R_n(x)$ is the Taylor remainder (the truncation error).

The Lagrange Remainder Theorem Formula

Taylor's Theorem states that if $f(x)$ has $n+1$ continuous derivatives on an open interval containing $a$ and $x$, there exists some number $c$ strictly between $a$ and $x$ such that:

$$R_n(x) = \frac{f^{(n+1)}(c)}{(n+1)!} (x - a)^{n+1}$$

Because the exact value of $c$ is usually unknown, we find the maximum possible magnitude that $|f^{(n+1)}(t)|$ can achieve on the closed interval between $a$ and $x$. Let this maximum bound be $M$:

$$M = \max_{t \in [a, x]} |f^{(n+1)}(t)|$$

The Lagrange Error Bound is therefore:

$$|R_n(x)| = |f(x) - P_n(x)| \le \frac{M}{(n+1)!} |x - a|^{n+1}$$

Common Function Error Bounds

  • Exponential $f(x) = e^x$: Every derivative is $f^{(n+1)}(t) = e^t$. For interval $[a, x]$, $M = e^{\max(a, x)}$.
  • Trigonometric $f(x) = \sin(x)$ or $\cos(x)$: Since all higher derivatives are $\pm \sin(t)$ or $\pm \cos(t)$, their magnitude never exceeds 1, so we can always choose $M = 1$.
  • Geometric Series $f(x) = \frac{1}{1-x}$: The $(n+1)$-th derivative is $f^{(n+1)}(t) = \frac{(n+1)!}{(1-t)^{n+2}}$, so $M = \frac{(n+1)!}{(1 - \max(a, x))^{n+2}}$ for $x < 1$.
  • Natural Logarithm $f(x) = \ln(1+x)$: The $(n+1)$-th derivative is $f^{(n+1)}(t) = \frac{(-1)^n n!}{(1+t)^{n+1}}$, so $M = \frac{n!}{(1 + \min(a, x))^{n+1}}$ for $x > -1$.

Step-by-Step Example Calculation

Suppose we approximate $f(x) = e^x$ at $x = 0.5$ using a 3rd-degree Maclaurin polynomial ($n = 3, a = 0$):

  1. Identify $n + 1 = 3 + 1 = 4$, and calculate the factorial: $4! = 24$.
  2. Determine $M$: On the interval $[0, 0.5]$, the 4th derivative $e^t$ attains its maximum at $t = 0.5$, so $M = e^{0.5} \approx 1.648721$.
  3. Calculate distance term: $|x - a|^{n+1} = |0.5 - 0|^4 = 0.5^4 = 0.0625$.
  4. Apply the formula: $$|R_3(0.5)| \le \frac{1.648721}{24} \times 0.0625 \approx 0.004294$$

The actual Taylor approximation is $P_3(0.5) = 1 + 0.5 + \frac{0.5^2}{2} + \frac{0.5^3}{6} = 1.645833$, whereas $e^{0.5} \approx 1.648721$. The true error is $|1.648721 - 1.645833| = 0.002888$, which is well within the calculated bound of $0.004294$.

Related Mathematics Calculators

Explore related calculus, polynomial, and series tools:

Frequently Asked Questions

What is the difference between the Taylor remainder and Lagrange error bound?

The Taylor remainder $R_n(x) = f(x) - P_n(x)$ is the exact difference between the actual function value and the polynomial approximation. Because the exact evaluation point $c$ in the remainder is usually unknown, the Lagrange error bound provides a guaranteed upper limit on the maximum magnitude $|R_n(x)|$.

How do I find $M$ in the Lagrange error bound?

$M$ is the maximum value of the absolute $(n+1)$-th derivative $|f^{(n+1)}(t)|$ on the closed interval between the center $a$ and the evaluation point $x$. For monotonically increasing derivatives (like $e^t$), evaluate at the right endpoint; for trigonometric functions ($\sin, \cos$), an upper bound of $1$ can always be used.

What happens to the Lagrange error bound as $n \to \infty$?

For functions whose Taylor series converge everywhere (such as $e^x$, $\sin(x)$, $\cos(x)$), the factorial $(n+1)!$ in the denominator grows faster than the polynomial $(x-a)^{n+1}$, causing the error bound to approach zero as $n \to \infty$.

What is a Maclaurin series error bound?

A Maclaurin series is simply a Taylor series centered at $a = 0$. Its Lagrange error bound simplifies to $|R_n(x)| \le \frac{M}{(n+1)!} |x|^{n+1}$.