Taylor's Theorem and the Lagrange Error Bound

Taylor's theorem writes \(f(x) = T_n(x) + R_n(x)\): the Taylor polynomial you've been building from derivatives, plus an exact leftover \(R_n\). The Lagrange form turns that leftover into a concrete number you can bound — a guarantee on how wrong the approximation can possibly be.

By the end you'll be able to estimate a function value with a Taylor polynomial AND attach a guaranteed error bar to it via \(|R_n(x)| \le \dfrac{M}{(n+1)!}|x-a|^{n+1}\) — plus use \(R_n \to 0\) to justify that a Taylor series really equals its function.

Predict: move x farther from the center — does the error grow faster than linearly? Slide x to check, then raise n and watch the error collapse.

Blue is \(f(x) = \sin x\); dashed green is its Taylor polynomial \(T_n\) about \(a = 0\). The pink region is the actual error \(|f - T_n|\), and the dashed orange envelope is \(T_n \pm \frac{|x|^{n+1}}{(n+1)!}\) — the Lagrange bound with \(M = 1\). The true curve can never escape the envelope. Hover the chart or focus a dot for exact values.

T₃(0.40) = 0.38933 · sin(0.40) = 0.38942 · actual error = 0.00009 ≤ bound 0.00107

sin x vs. Tn(x) — actual error (pink) inside the Lagrange envelope (orange)
f(x) = sin x Tₙ(x) Lagrange envelope actual error

Taylor's theorem splits \(f\) into a degree-\(n\) polynomial plus a remainder; the Lagrange form bounds that remainder by \(\frac{M}{(n+1)!}|x-a|^{n+1}\), quantifying exactly how accurate the polynomial is.

Visual

Look back at the pink region in the demo: near the center it's invisibly thin, then it fans out — and not at a steady rate. That's the \(|x-a|^{n+1}\) in the bound at work: doubling your distance from the center multiplies the worst-case error by \(2^{n+1}\), so accuracy is superb close to \(a\) and decays fast far away. The other lever is \(n\): each extra degree divides the bound by another factor of \((n+1)\) via the factorial, which eventually crushes any power of \(|x-a|\) — slide \(n\) up and watch the orange envelope clamp down onto the blue curve everywhere.

Formal

If \(f\) has \(n+1\) continuous derivatives near \(a\), then \(f(x) = T_n(x) + R_n(x)\), and the Lagrange form of the remainder says there exists some \(c\) strictly between \(a\) and \(x\) with \(R_n(x) = \dfrac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}\). Note the derivative order: cutting off after degree \(n\) leaves an error governed by the \((n+1)\)-th derivative, not the \(n\)-th. Since \(c\) is unknown, you trade the equality for an inequality: if \(|f^{(n+1)}(t)| \le M\) for every \(t\) between \(a\) and \(x\), then $$|R_n(x)| \le \frac{M}{(n+1)!}|x-a|^{n+1}.$$ This also settles convergence: the Taylor series equals \(f(x)\) exactly when \(R_n(x) \to 0\) as \(n \to \infty\). For \(\sin x\) and \(\cos x\) every derivative is bounded by \(M = 1\), and for \(e^x\) by \(e^{|x|}\), so the bound \(\frac{M}{(n+1)!}|x|^{n+1} \to 0\) for every real \(x\) — their Maclaurin series really are the functions.

Worked example

Estimate \(\sin(0.4)\) with \(T_3\) and bound the error. The degree-3 Maclaurin polynomial is \(T_3(x) = x - \frac{x^3}{3!}\), so \(T_3(0.4) = 0.4 - \frac{0.064}{6} \approx 0.38933\). For the error, \(n = 3\) means the remainder involves \(f^{(4)}(c) = \sin c\), and \(|\sin c| \le 1\), so take \(M = 1\): \(|R_3(0.4)| \le \frac{1}{4!}(0.4)^4 = \frac{0.0256}{24} \approx 0.00107\). So \(\sin(0.4) = 0.38933 \pm 0.00107\) — and indeed the true value \(\sin(0.4) \approx 0.38942\) sits inside that window, just \(0.00009\) away. The bound is a worst-case guarantee; the actual error is usually smaller.

Your turn

Estimate \(\cos(0.5)\) with \(T_2(x) = 1 - \frac{x^2}{2}\) and bound the error. First, \(T_2(0.5) = 1 - \frac{0.25}{2} = 0.875\). Now the bound: with \(n = 2\), the remainder involves the \(3\)rd derivative of cosine, which is bounded by \(M = 1\), so \(|R_2(0.5)| \le \dfrac{1}{3!}(0.5)^{\,?} = \) ____

Reveal the answer

The exponent matches the factorial's order: \(|R_2(0.5)| \le \frac{(0.5)^3}{3!} = \frac{0.125}{6} \approx \) 0.02083. So \(\cos(0.5) = 0.875 \pm 0.021\) — consistent with the true value \(\cos(0.5) \approx 0.87758\), which is only \(0.0026\) off. (Sharper trick: since the \(x^3\) coefficient of cosine's series is zero, \(T_2 = T_3\), so you may bound with \(R_3\) instead: \((0.5)^4/4! \approx 0.0026\) — much tighter.)

More info — the remainder is what makes "the series equals the function" honest

Back in the Taylor & Maclaurin series lesson, you built Taylor series by matching derivatives at the center — but matching derivatives at one point doesn't by itself promise anything about values far away. The remainder closes that gap: \(f(x) - T_n(x) = R_n(x)\) exactly, so asking "does the series converge to \(f\)?" is precisely asking "does \(R_n(x) \to 0\)?" For sine, the demo above shows it happening: fix any \(x\), even \(x = 4\), and step \(n\) upward — the envelope width \(\frac{|x|^{n+1}}{(n+1)!}\) shrinks to nothing because the factorial in the denominator outruns the power in the numerator. The OpenStax section in Dive deeper runs this argument in full for \(\sin x\), \(\cos x\), and \(e^x\).

Check your understanding

Question 1 of 4

You approximate \(\sin x\) at \(x = 1\) with the degree-5 Maclaurin polynomial \(T_5\). Taking \(M = 1\) (every derivative of sine is bounded by 1), what is the Lagrange bound on \(|R_5(1)|\)?

Question 2 of 4

The Taylor series of \(f\) about \(a\) converges at some \(x\). Does its sum necessarily equal \(f(x)\)?

Question 3 of 4

To use the Lagrange error bound \(|R_n(x)| \le \dfrac{M}{(n+1)!}|x-a|^{n+1}\), the constant \(M\) must satisfy which condition?

Question 4 of 4

From your standard-series toolkit you recall \(\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots\) and truncate it to \(T_2(x) = 1 - x^2/2\). With \(M = 1\), which expression is the Lagrange bound on the error \(|\cos(0.6) - T_2(0.6)|\)?

Recap

  • Taylor's theorem: \(f(x) = T_n(x) + R_n(x)\) — the polynomial plus an exact remainder.
  • Lagrange form: \(R_n(x) = \dfrac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}\) for some \(c\) between \(a\) and \(x\) — note the \((n+1)\)-th derivative, not the \(n\)-th.
  • Practical bound: if \(|f^{(n+1)}(t)| \le M\) on the whole interval between \(a\) and \(x\), then \(|R_n(x)| \le \dfrac{M}{(n+1)!}|x-a|^{n+1}\). It's an upper bound — the actual error is usually smaller.
  • Error grows like \(|x-a|^{n+1}\) as you leave the center and shrinks factorially as \(n\) rises.
  • The Taylor series converges to \(f(x)\) exactly when \(R_n(x) \to 0\) — this is how you justify \(\sin x\), \(\cos x\), and \(e^x\) equaling their Maclaurin series for all real \(x\).

Dive deeper

Sources

  • Taylor's Theorem and the Lagrange Error Bound