The Lagrange Error Bound
A Taylor polynomial is an approximation. The Lagrange error bound puts a guaranteed ceiling on how far off it can be. This guide shows how to choose M, how to use the bound, and how to pick the degree you need.
If \(P_n\) is the degree-\(n\) Taylor polynomial of \(f\) about \(a\), then \(|f(x) - P_n(x)| \le \dfrac{M\,|x - a|^{n+1}}{(n + 1)!}\), where \(M\) is at least as large as \(|f^{(n+1)}|\) everywhere between \(a\) and \(x\). Everything in the bound uses \(n + 1\): the next derivative, the next power, the next factorial. Any \(M\) that is big enough works; a smaller one makes the bound tighter.
1The bound
Bound the error of \(\sin 0.3 \approx 0.3 - \frac{0.3^3}{6}\)
- 1This is \(P_3\) for \(\sin x\) about 0. The bound uses the next derivative, \(f^{(4)}(x) = \sin x\).
- 2\(|\sin x| \le 1\) everywhere, so take \(M = 1\).
- 3\(|R_3(0.3)| \le \dfrac{1 \cdot 0.3^4}{4!} = \dfrac{0.0081}{24} = 0.0003375\).
“\(|f^{(4)}(x)| = |\sin x| \le 1\), so by the Lagrange error bound \(|R_3(0.3)| \le \frac{0.3^4}{4!} = 0.0003375\).”
For \(P_3\), the bound uses the 4th derivative, \(|x - a|^4\) and \(4!\). Using 3 in any of those places gives a wrong bound.
2Choosing M
Bound the error of \(e^{0.5} \approx P_3(0.5) = 1.6458\)
- 1\(f^{(4)}(x) = e^x\). On \([0, 0.5]\) it is largest at \(x = 0.5\): \(e^{0.5} \lt 2\). Take \(M = 2\).
- 2\(|R_3(0.5)| \le \dfrac{2 \cdot 0.5^4}{24} \approx 0.0052\).
Same problem, wrong M
- 1Using \(M = e^0 = 1\), the value at the center, gives \(\frac{0.5^4}{24} \approx 0.0026\).
- 2But the actual error is about 0.0029, bigger than that “bound”.
\(M\) must bound \(|f^{(n+1)}|\) on the whole interval from \(a\) to \(x\). For increasing derivatives like \(e^x\), that is at the far end.
Any upper bound works: \(M = 2\) instead of \(e^{0.5} \approx 1.65\) is fine and easier. A larger \(M\) only makes the bound less tight.
3How many terms?
Approximate \(e\) to within 0.001 with a Maclaurin polynomial
- 1At \(x = 1\): \(|R_n(1)| \le \dfrac{M}{(n + 1)!}\), with \(M = 3\) (since \(e^x \le e \lt 3\) on \([0, 1]\)).
- 2Need \(\dfrac{3}{(n + 1)!} \lt 0.001\), so \((n + 1)! \gt 3000\). \(6! = 720\), \(7! = 5040\).
4Other centers
Bound the error of \(\ln 1.2 \approx P_3(1.2)\) about \(x = 1\)
- 1\(f^{(4)}(x) = -\dfrac{6}{x^4}\). On \([1, 1.2]\), \(|f^{(4)}|\) is largest at \(x = 1\): \(M = 6\).
- 2Distance from the center: \(1.2 - 1 = 0.2\). \(|R_3| \le \dfrac{6 \cdot 0.2^4}{24} = 0.0004\).
The power in the bound is of \(|x - a|\), the distance from the center. About \(a = 1\) at \(x = 1.2\), that distance is 0.2, not 1.2.
Quick reference
| Piece | For Pₙ |
|---|---|
| Derivative | \(f^{(n+1)}\) |
| M | Largest |f⁽ⁿ⁺¹⁾| between a and x (or anything bigger) |
| Power | \(|x - a|^{n+1}\) |
| Factorial | \((n + 1)!\) |