Educerie

Educerie · AP · Calculus AB and BC

Unit 10 Infinite Sequences and Series · 10.12 Lagrange Error Bound

BC only. This topic is on the AP Calculus BC exam and not on AB.

Big ideas: LIM (Limits). A Taylor polynomial is only an approximation. The Lagrange error bound puts a number on how far off it can be, using a bound on the next derivative.

The question this unit answers: When does an endless sum settle on a number, and how do we tell, and how do we use it to approximate?

Where it is examined: Section I multiple choice: the Lagrange bound for a given polynomial and point, or the degree needed for a given accuracy. Section II free response (series question 6, and question 5 in some years): "use the Lagrange error bound to show that the approximation is within 0.01 of the actual value", with a justification of the bound used for the next derivative.


AP Calculus AB and BC 10.12

Lagrange Error Bound

When does an endless sum settle on a number, and how do we tell, and how do we use it to approximate?

What you will learn

  • Understand the Lagrange bound as the next Taylor term with the derivative replaced by its worst case.
  • Know that M bounds |f^(n+1)| on the whole interval.
  • Understand when the alternating series bound is allowed.

You must be able to

  1. Find M with a reason.
  2. Compute the bound with matching n + 1 powers and factorial.
  3. Find the least degree for a tolerance.
  4. Turn the bound into an interval for the function value.
  5. Explain why using the value at one end is wrong.

1The bound

Lagrange error bound. Let PnP_n be the Taylor polynomial of degree nn for ff about x=ax = a. If ∣f(n+1)(z)∣≤M\lvert f^{(n+1)}(z)\rvert \le M for all zz between aa and xx, then

∣f(x)−Pn(x)∣≤M(n+1)! ∣x−a∣ n+1. \lvert f(x) - P_n(x)\rvert \le \frac{M}{(n+1)!}\,\lvert x-a\rvert^{\,n+1}.

The bound has the shape of the next Taylor term, f(n+1)(n+1)!(x−a)n+1\dfrac{f^{(n+1)}}{(n+1)!}(x-a)^{n+1}, with the derivative replaced by its worst case MM on the interval.

Three parts need care.

  • The derivative is f(n+1)f^{(n+1)}, one order higher than the polynomial's degree.
  • MM is a bound on its size (absolute value) over the interval between aa and xx. Any valid upper bound works. A smaller MM gives a sharper bound, but a larger one is still correct.
  • The factor is ∣x−a∣n+1\lvert x-a\rvert^{n+1}, with the same exponent n+1n+1.

The bound says "at most". It is a ceiling, as in 10.10.

2Finding MM

MM comes from the (n+1)(n+1)th derivative on the interval from aa to xx. Ways to find it:

  • A known bound. ∣sin⁡z∣≤1\lvert\sin z\rvert \le 1 and ∣cos⁡z∣≤1\lvert\cos z\rvert \le 1 for all zz.
  • An increasing derivative. If f(n+1)f^{(n+1)} is increasing, its maximum is at the right end. For eze^z on [0,0.5][0, 0.5], ez≤e0.5≈1.65<2e^z \le e^{0.5} \approx 1.65 < 2, so M=2M = 2 is valid.
  • A decreasing derivative. If ∣f(n+1)∣\lvert f^{(n+1)}\rvert decreases, its maximum is at the left end. For ∣f(4)∣=6z4\lvert f^{(4)}\rvert = \dfrac{6}{z^4} on [1,1.2][1, 1.2], the maximum is at z=1z = 1, giving M=6M = 6.
  • Given in the question. Many questions say "∣f(4)(x)∣≤12\lvert f^{(4)}(x)\rvert \le 12 for all xx in the interval". Use it.

When a question asks you to justify MM, say why: "f(4)f^{(4)} is increasing on this interval, so its maximum is at z=0.5z = 0.5", or "∣cos⁡z∣≤1\lvert\cos z\rvert \le 1".

3Worked example: exe^x

Approximate e0.5e^{0.5} with P3(x)=1+x+x22+x36P_3(x) = 1 + x + \tfrac{x^2}{2} + \tfrac{x^3}{6} about a=0a = 0, so n=3n = 3.

The next derivative is f(4)(z)=ezf^{(4)}(z) = e^z. On [0,0.5][0, 0.5], ez≤e0.5<2e^z \le e^{0.5} < 2, so M=2M = 2. Then

∣e0.5−P3(0.5)∣≤24!(0.5)4=224⋅116=1192≈0.0052. \lvert e^{0.5} - P_3(0.5)\rvert \le \frac{2}{4!}(0.5)^4 = \frac{2}{24}\cdot\frac{1}{16} = \frac{1}{192} \approx 0.0052.

The actual error is 1.6487−1.6458≈0.00291.6487 - 1.6458 \approx 0.0029, within the bound.

Figure 1 shows the idea for another function: the error for a Maclaurin polynomial, and the bound that sits above it.

Graph for x from 0 to 2 of the error of the degree 2 Taylor polynomial of cosine, which is cosine of x minus 1 plus x squared over 2, and above it the curve x cubed over 6, the Lagrange error bound 0.5 1 1.5 2 0.5 1 0 size of the error x bound x³/6 actual error
Figure 1 · The error of the degree-2 Taylor polynomial of cosine, and the Lagrange bound x cubed over 6, for x from 0 to 2

For cos⁡x\cos x with P2(x)=1−x22P_2(x) = 1 - \tfrac{x^2}{2}, the next derivative is f′′′(z)=sin⁡zf'''(z) = \sin z, so M=1M = 1 and the bound is x36\tfrac{x^3}{6}. The true error cos⁡x−P2(x)\cos x - P_2(x) is always under the bound curve: it is 0.0026 at x=0.5x = 0.5 against a bound of 0.021, and 0.584 at x=2x = 2 against a bound of 1.333. The bound is safe, but not tight.

4Worked example: ln⁡x\ln x

Approximate ln⁡1.2\ln 1.2 with P3(x)=(x−1)−(x−1)22+(x−1)33P_3(x) = (x-1) - \tfrac{(x-1)^2}{2} + \tfrac{(x-1)^3}{3} about a=1a = 1 (from 10.11), so n=3n = 3.

The next derivative is f(4)(z)=−6z4f^{(4)}(z) = -\dfrac{6}{z^4}, so ∣f(4)(z)∣=6z4\lvert f^{(4)}(z)\rvert = \dfrac{6}{z^4}. On [1,1.2][1, 1.2] this is largest at z=1z = 1, where it equals 6. So M=6M = 6 and

∣ln⁡1.2−P3(1.2)∣≤64!(0.2)4=14(0.0016)=0.0004. \lvert \ln 1.2 - P_3(1.2)\rvert \le \frac{6}{4!}(0.2)^4 = \frac14(0.0016) = 0.0004.

Since P3(1.2)≈0.18267P_3(1.2) \approx 0.18267, the true value lies between 0.182270.18227 and 0.183070.18307. The actual error is about 0.00035.

5Worked example: how many terms?

How large must nn be so that Pn(0.5)P_n(0.5) approximates e0.5e^{0.5} with an error less than 0.0001? Use M=2M = 2, as before.

The bound is 2(n+1)!(0.5)n+1\dfrac{2}{(n+1)!}(0.5)^{n+1}. Try values.

nnBound 2(n+1)!(0.5)n+1\dfrac{2}{(n+1)!}(0.5)^{n+1}
30.00521
40.000521
50.0000434

At n=5n = 5 the bound is below 0.0001, and at n=4n = 4 it is not. So n=5n = 5 is the smallest degree that is guaranteed to work.

6When the alternating series bound is easier

For some Taylor series the terms alternate and decrease at the point of interest. Then the alternating series error bound (10.10) says the error is at most the first omitted term, and no derivative bound is needed. The CED lists this as an allowed method for Taylor approximations in some situations.

Example: sin⁡(0.5)\sin(0.5) with the Maclaurin polynomial x−x36x - \dfrac{x^3}{6}, which is both degree 3 and degree 4 (the x4x^4 term is 0).

sin⁡(0.5)≈0.5−0.1256≈0.47917. \sin(0.5) \approx 0.5 - \frac{0.125}{6} \approx 0.47917.

The series for sin⁡0.5\sin 0.5 is alternating with decreasing terms, and the first omitted term is 0.555!=0.03125120≈0.00026\dfrac{0.5^5}{5!} = \dfrac{0.03125}{120} \approx 0.00026. So the error is at most 0.00026. The Lagrange bound with n=4n = 4, M=1M = 1, gives the same number: 15!(0.5)5≈0.00026\dfrac{1}{5!}(0.5)^5 \approx 0.00026. The actual error is about 0.000259.

Use the alternating bound only when you can show the series alternates, the terms decrease and the series is the right Taylor series at that xx. When in doubt, use the Lagrange bound; it always applies.

7Using a given bound

Example (invented): ff has Taylor polynomial P3P_3 about x=1x = 1, and ∣f(4)(x)∣≤12\lvert f^{(4)}(x)\rvert \le 12 for all xx in [1,1.5][1, 1.5]. The error in using P3(1.5)P_3(1.5) is at most

124!(0.5)4=1224⋅116=132=0.03125. \frac{12}{4!}(0.5)^4 = \frac{12}{24}\cdot\frac{1}{16} = \frac{1}{32} = 0.03125.

So f(1.5)f(1.5) lies within 0.03125 of P3(1.5)P_3(1.5).

Practice questions

30 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.