Unit 10 Topic 10.12

The Lagrange Error Bound

every AB topic, then series

4 min readfreeNot practiced

A Taylor polynomial PnP_n estimates ff near its center. An estimate is only useful if you know how far off it can be. The Lagrange error bound gives that guarantee as one number, built from the derivative the polynomial does not match.

Where the error comes from

PnP_n copies ff and its first nn derivatives at the center aa. The two can only drift apart through the derivative that does not match, f(n+1)f^{(n+1)}. If that derivative is never larger than some number MM between aa and xx, the drift is limited too. The precise statement:

|f(x)−Pn(x)|≤M(n+1)!|x−a|n+1,where |f(n+1)(z)|≤M for every z between a and x.\left|f(x) - P_n(x)\right| \le \frac{M}{(n+1)!}|x - a|^{n+1}, \qquad \text{where } \left|f^{(n+1)}(z)\right| \le M \text{ for every } z \text{ between } a \text{ and } x.

The bound looks like the next term of the polynomial, with f(n+1)(a)f^{(n+1)}(a) replaced by the worst case MM.

On -1.6 to 1.6, a dashed curve x to the fourth over 24, the Lagrange error bound for cos x and its second-degree Taylor polynomial about 0, with the region under it lightly shaded, and a solid curve, the actual error |cos x minus (1 minus x squared over 2)|, which stays below it. At x = 1 the bound is about 0.0417 and the actual error about 0.0403.
Figure 1. The actual error of P2P_2 for cos⁡x\cos x stays under the bound x424\frac{x^4}{24}. LevlPrep original diagram.

For cos⁡x\cos x and P2(x)=1−x22P_2(x) = 1 - \frac{x^2}{2} about 0, every derivative of cos⁡x\cos x is ±sin⁡x\pm\sin x or ±cos⁡x\pm\cos x, so M=1M = 1 works. Strictly, the bound for P2P_2 uses the third derivative; since the x3x^3 coefficient of cos⁡x\cos x is 0, P2=P3P_2 = P_3, and the bound for P3P_3, 14!|x|4\frac{1}{4!}|x|^4, applies to it as well. The figure shows the actual error staying under that curve.

The four steps

  1. Identify nn (the degree used) and the next derivative, f(n+1)f^{(n+1)}.
  2. Find MM, the largest value of |f(n+1)(z)|\left|f^{(n+1)}(z)\right| for zz between aa and xx, and say why it is the largest.
  3. Compute M(n+1)!|x−a|n+1\frac{M}{(n+1)!}|x - a|^{n+1}.
  4. Write the result as an inequality, and compare it with any number the question gives.

Worked example 1. Estimate e0.3e^{0.3} with the second-degree Maclaurin polynomial for exe^x, and show the error is less than 0.010.01.

Estimate: P2(0.3)P_2(0.3)=1= 1+0.3+ 0.3+(0.3)22+ \frac{(0.3)^2}{2}=1.345= 1.345.

Next derivative: f‴(z)=ezf'''(z) = e^z. It is increasing, so on 0≤z≤0.30 \le z \le 0.3 its largest value is e0.3e^{0.3}, which is less than e1<3e^{1} < 3. Take M=3M = 3 (any M≥e0.3M \ge e^{0.3} works).

Bound: |e0.3−P2(0.3)|≤33!(0.3)3\left|e^{0.3} - P_2(0.3)\right| \le \frac{3}{3!}(0.3)^3=36(0.027)= \frac{3}{6}(0.027)=0.0135= 0.0135.

That is not below 0.010.01. A smaller valid MM helps: e0.3<e1/2<2e^{0.3} < e^{1/2} < 2, so with M=2M = 2 the bound is 26(0.027)\frac{2}{6}(0.027)=0.009<0.01= 0.009 < 0.01.

The example shows why step 2 deserves care: MM must be at least the true maximum, but the closer it is, the more useful the bound.

Finding M from a formula or from given information

Exam questions give the next derivative in one of three ways.

GivenHow to get MM
A bound, "|f(4)(x)|≤10\left|f^{(4)}(x)\right| \le 10 on [0,1][0, 1]"Use it directly: M=10M = 10.
A formula, f(4)(x)f^{(4)}(x)=6(1+x)4= \frac{6}{(1 + x)^4}Decide where it is largest on the interval (here it decreases, so at the left end) and evaluate there.
sin⁡\sin, cos⁡\cos or exe^x|sin⁡z|,|cos⁡z|≤1|\sin z|, |\cos z| \le 1; eze^z is largest at the right end of the interval.

Worked example 2. |f(5)(x)|≤40|f^{(5)}(x)| \le 40 for 2≤x≤2.52 \le x \le 2.5. Bound the error of the fourth-degree Taylor polynomial for ff about x=2x = 2 at x=2.5x = 2.5.

|f(2.5)−P4(2.5)|≤405!(0.5)5\left|f(2.5) - P_4(2.5)\right| \le \frac{40}{5!}(0.5)^5=40120⋅132= \frac{40}{120} \cdot \frac{1}{32}=196= \frac{1}{96}≈0.0104\approx 0.0104.

When the alternating series error bound is easier

Sometimes the terms of the approximation, at the given xx, form an alternating sum whose sizes decrease to 0, as with cos⁡(0.1)\cos(0.1)=1−(0.1)22!= 1 - \frac{(0.1)^2}{2!}+(0.1)44!−⋯+ \frac{(0.1)^4}{4!} - \cdots Then the alternating series error bound applies as well: the error is at most the first term left out. Questions sometimes ask for one bound by name; use the one named, and state its conditions.

Alternating series error boundLagrange error bound
Needsalternating terms whose sizes decrease to 0a bound MM on |f(n+1)|\left|f^{(n+1)}\right| between aa and xx
Boundthe first omitted termM(n+1)!|x−a|n+1\frac{M}{(n+1)!}|x - a|^{n+1}
Saywhy the terms alternate and decrease to 0where the maximum is and why

Either way, the bound is a ceiling. Write "the error is at most 196\frac{1}{96}", or "error ≤196<0.02\le \frac{1}{96} < 0.02", never "the error equals 196\frac{1}{96}".

Spot a mistake on this page?