Skip to content
Family Table Math

Lagrange Error Bound

A Taylor polynomial gives an approximation, but an approximation is only useful if you know how far off it might be. The alternating series error bound handles alternating series. The Lagrange error bound works for any Taylor polynomial, alternating or not, as long as you can put a ceiling on the next derivative. It’s a favourite on the AP BC exam.

The remainder (or error) of the nnth-degree Taylor polynomial is

Rn(x)=f(x)−Pn(x)R_n(x) = f(x) - P_n(x)

It’s what you’d still need to add to the polynomial to get the exact value.

If PnP_n is the nnth-degree Taylor polynomial for ff about x=ax = a, then

∣Rn(x)∣=∣f(x)−Pn(x)∣≤M(n+1)! ∣x−a∣n+1|R_n(x)| = |f(x) - P_n(x)| \le \frac{M}{(n+1)!}\,|x - a|^{n+1}

where MM is any number with ∣f(n+1)(z)∣≤M\left|f^{(n+1)}(z)\right| \le M for every zz between aa and xx.

Notice the pattern: the bound looks just like the next term of the Taylor polynomial, f(n+1)(a)(n+1)!(x−a)n+1\dfrac{f^{(n+1)}(a)}{(n+1)!}(x - a)^{n+1}, except that f(n+1)(a)f^{(n+1)}(a) is replaced by MM, the largest the (n+1)(n+1)th derivative can be on the interval.

MM only has to be an upper bound for ∣f(n+1)∣\left|f^{(n+1)}\right| on the interval from aa to xx; it doesn’t have to be the smallest one. A slightly bigger MM gives a slightly weaker, but still true, bound. Common choices:

SituationGood choice of M
f(n+1)f^{(n+1)} is ±sin⁡\pm\sin or ±cos⁡\pm\cosM=1M = 1
∣f(n+1)∣\lvert f^{(n+1)} \rvert is increasing or decreasing on the intervalits value at the endpoint where it’s largest
f(n+1)(x)=exf^{(n+1)}(x) = e^x on [0,b][0, b]ebe^b, rounded up (e.g. e<3e \lt 3)
The problem gives "∣f(n+1)(x)∣≤K\lvert f^{(n+1)}(x) \rvert \le K"M=KM = K

Never round MM down: a bound that’s too small isn’t a bound.

To guarantee an error less than some tolerance, increase nn until M(n+1)!∣x−a∣n+1\dfrac{M}{(n+1)!}|x - a|^{n+1} drops below it. Because of the factorial, this usually happens quickly.

  • If the series you’re using is alternating, with terms decreasing to 00, the alternating series error bound is usually easier.
  • Otherwise (for example, exe^x at a positive xx, or ln⁡x\ln x for x<1x \lt 1, where all terms have the same sign), use the Lagrange error bound.
  • If a question says “Lagrange error bound,” use it, even if the series happens to alternate.

On the AP exam, show the setup: state MM and why it works, then write the bound with numbers substituted. You don’t need to simplify the final number.

Use P3(x)=x−x36P_3(x) = x - \dfrac{x^3}{6} to approximate sin⁡0.5\sin 0.5 (radians), and use the Lagrange error bound to show the error is less than 0.0030.003.

Solution.

sin⁡0.5≈0.5−0.1256≈0.479167\sin 0.5 \approx 0.5 - \frac{0.125}{6} \approx 0.479167

Here n=3n = 3, so you need the fourth derivative: f(4)(x)=sin⁡xf^{(4)}(x) = \sin x. Since ∣sin⁡z∣≤1|\sin z| \le 1 for every zz, take M=1M = 1.

∣R3(0.5)∣≤14! ∣0.5−0∣4=0.062524≈0.0026<0.003|R_3(0.5)| \le \frac{1}{4!}\,|0.5 - 0|^4 = \frac{0.0625}{24} \approx 0.0026 \lt 0.003

(Check: sin⁡0.5≈0.479426\sin 0.5 \approx 0.479426, so the actual error is about 0.000260.00026, well within the bound. Since the x4x^4 coefficient of sine is 00, this is also P4P_4, and using n=4n = 4 would give the even smaller bound 0.555!≈0.00026\dfrac{0.5^5}{5!} \approx 0.00026.)

Example 2: ln x, choosing M at an endpoint

Section titled “Example 2: ln x, choosing M at an endpoint”

Use the second-degree Taylor polynomial for f(x)=ln⁡xf(x) = \ln x about x=1x = 1 to approximate ln⁡1.2\ln 1.2, and find a Lagrange error bound.

Solution. f(1)=0f(1) = 0, f′(x)=1xf'(x) = \dfrac{1}{x} gives f′(1)=1f'(1) = 1, and f′′(x)=−1x2f''(x) = -\dfrac{1}{x^2} gives f′′(1)=−1f''(1) = -1:

P2(x)=(x−1)−(x−1)22⇒ln⁡1.2≈0.2−0.02=0.18P_2(x) = (x - 1) - \frac{(x - 1)^2}{2} \quad\Rightarrow\quad \ln 1.2 \approx 0.2 - 0.02 = 0.18

The next derivative is f′′′(x)=2x3f'''(x) = \dfrac{2}{x^3}. On 1≤z≤1.21 \le z \le 1.2 it is positive and decreasing, so its largest value is at the left endpoint: M=f′′′(1)=2M = f'''(1) = 2.

∣R2(1.2)∣≤23! (0.2)3=0.0166≈0.00267|R_2(1.2)| \le \frac{2}{3!}\,(0.2)^3 = \frac{0.016}{6} \approx 0.00267

(Check: ln⁡1.2≈0.182322\ln 1.2 \approx 0.182322, so the actual error is about 0.002320.00232.)

A function ff has a third-degree Taylor polynomial about x=1x = 1 called P3P_3. It is known that ∣f(4)(x)∣≤6\left|f^{(4)}(x)\right| \le 6 for 1≤x≤1.51 \le x \le 1.5. Show that P3(1.4)P_3(1.4) approximates f(1.4)f(1.4) with an error less than 0.010.01.

Solution. Take M=6M = 6, n=3n = 3, ∣x−a∣=0.4|x - a| = 0.4:

∣R3(1.4)∣≤64! (0.4)4=6(0.0256)24=0.0064<0.01|R_3(1.4)| \le \frac{6}{4!}\,(0.4)^4 = \frac{6(0.0256)}{24} = 0.0064 \lt 0.01

Using M=3M = 3, find the smallest nn for which the Lagrange error bound guarantees that the Maclaurin polynomial Pn(1)P_n(1) approximates ee within 0.0010.001.

Solution. Every derivative of exe^x is exe^x, which is increasing, so on 0≤z≤10 \le z \le 1 the largest value is e1<3e^1 \lt 3. So M=3M = 3 works, and ∣x−a∣=1|x - a| = 1:

∣Rn(1)∣≤3(n+1)! (1)n+1=3(n+1)!|R_n(1)| \le \frac{3}{(n+1)!}\,(1)^{n+1} = \frac{3}{(n+1)!}

You need (n+1)!>3000(n+1)! \gt 3000. Since 6!=7206! = 720 and 7!=50407! = 5040, you need n+1=7n + 1 = 7, so n=6n = 6.

Using the wrong derivative. For PnP_n, the bound uses the (n+1)(n+1)th derivative and (n+1)!(n+1)!, one step past the polynomial. For P2P_2, use f′′′f''' and 3!3!.

Evaluating M at the centre instead of finding the maximum. MM must bound ∣f(n+1)∣\left|f^{(n+1)}\right| on the whole interval from aa to xx. In Example 2 the maximum happened to be at the centre, but for exe^x on [0,0.5][0, 0.5] it’s at 0.50.5.

Rounding M down. e0.2≈1.2214e^{0.2} \approx 1.2214, so M=1.22M = 1.22 is too small. Use 1.231.23, 1.31.3, or even 33.

Forgetting the absolute value or using x instead of x − a. The bound uses ∣x−a∣n+1|x - a|^{n+1}. For a polynomial about x=1x = 1 evaluated at 0.90.9, that’s ∣−0.1∣n+1|-0.1|^{n+1}, not 0.9n+10.9^{n+1}.

Thinking the bound is the error. The bound says the error is no more than this amount. The actual error is often much smaller.

Using the alternating series bound when the terms don’t alternate. For ln⁡0.9\ln 0.9, the Taylor terms about 11 are all negative, so only the Lagrange error bound applies.

1. (Warm-up) The approximation cos⁡0.3≈1−0.322=0.955\cos 0.3 \approx 1 - \dfrac{0.3^2}{2} = 0.955 uses P2P_2 for cos⁡x\cos x about 00. Find a Lagrange error bound.

Solution

n=2n = 2, so use f′′′(x)=sin⁡xf'''(x) = \sin x, with ∣sin⁡z∣≤1|\sin z| \le 1, so M=1M = 1:

∣R2(0.3)∣≤13! (0.3)3=0.0276=0.0045|R_2(0.3)| \le \frac{1}{3!}\,(0.3)^3 = \frac{0.027}{6} = 0.0045

2. (Warm-up) A function has ∣f(4)(x)∣≤10\left|f^{(4)}(x)\right| \le 10 for all xx. Its third-degree Maclaurin polynomial is used to approximate f(0.5)f(0.5). Find an upper bound for the error.

Solution∣R3(0.5)∣≤104! (0.5)4=10(0.0625)24≈0.026|R_3(0.5)| \le \frac{10}{4!}\,(0.5)^4 = \frac{10(0.0625)}{24} \approx 0.026

3. (Warm-up) P2(x)=1+x+x22P_2(x) = 1 + x + \dfrac{x^2}{2} is used to approximate e0.5e^{0.5}. Explain why M=2M = 2 is a valid choice, and find the error bound.

Solution

f′′′(x)=exf'''(x) = e^x is increasing, so on 0≤z≤0.50 \le z \le 0.5 its largest value is e0.5≈1.649<2e^{0.5} \approx 1.649 \lt 2. So M=2M = 2 works.

∣R2(0.5)∣≤23! (0.5)3=0.256≈0.0417|R_2(0.5)| \le \frac{2}{3!}\,(0.5)^3 = \frac{0.25}{6} \approx 0.0417

(Actual: P2(0.5)=1.625P_2(0.5) = 1.625 and e0.5≈1.6487e^{0.5} \approx 1.6487, an error of about 0.02370.0237.)

4. (Core) In the Taylor polynomials lesson, P3(0.2)≈1.221333P_3(0.2) \approx 1.221333 was used to approximate e0.2e^{0.2}. Use the Lagrange error bound with M=1.3M = 1.3 to show the error is less than 0.00010.0001.

Solution

f(4)(x)=exf^{(4)}(x) = e^x is increasing, so on 0≤z≤0.20 \le z \le 0.2 its maximum is e0.2≈1.2214<1.3e^{0.2} \approx 1.2214 \lt 1.3.

∣R3(0.2)∣≤1.34! (0.2)4=1.3(0.0016)24≈0.0000867<0.0001|R_3(0.2)| \le \frac{1.3}{4!}\,(0.2)^4 = \frac{1.3(0.0016)}{24} \approx 0.0000867 \lt 0.0001

5. (Core) The tangent line to f(x)=xf(x) = \sqrt{x} at x=4x = 4 gives 4.2≈2.05\sqrt{4.2} \approx 2.05. Find a Lagrange error bound for this approximation.

Solution

The tangent line is P1P_1, so use f′′(x)=−14x−3/2f''(x) = -\dfrac{1}{4}x^{-3/2}. Its absolute value 14x3/2\dfrac{1}{4x^{3/2}} is decreasing on 4≤z≤4.24 \le z \le 4.2, so the maximum is at z=4z = 4:

M=14⋅8=132M = \frac{1}{4 \cdot 8} = \frac{1}{32}∣R1(4.2)∣≤1/322! (0.2)2=0.0464=0.000625|R_1(4.2)| \le \frac{1/32}{2!}\,(0.2)^2 = \frac{0.04}{64} = 0.000625

(Actual error: 2.05−2.04939≈0.000612.05 - 2.04939 \approx 0.00061.)

6. (Core) A function ff has f(1)=2f(1) = 2, f′(1)=−1f'(1) = -1 and f′′(1)=3f''(1) = 3, and ∣f′′′(x)∣≤12\left|f'''(x)\right| \le 12 for 1≤x≤1.31 \le x \le 1.3.

  • (a) Use the second-degree Taylor polynomial about x=1x = 1 to approximate f(1.3)f(1.3).
  • (b) Find a Lagrange error bound for your approximation.
  • (c) Can f(1.3)f(1.3) equal 1.91.9? Explain.
Solution

(a)

P2(x)=2−(x−1)+32(x−1)2⇒f(1.3)≈2−0.3+1.5(0.09)=1.835P_2(x) = 2 - (x - 1) + \frac{3}{2}(x - 1)^2 \quad\Rightarrow\quad f(1.3) \approx 2 - 0.3 + 1.5(0.09) = 1.835

(b)

∣R2(1.3)∣≤123! (0.3)3=2(0.027)=0.054|R_2(1.3)| \le \frac{12}{3!}\,(0.3)^3 = 2(0.027) = 0.054

(c) No. f(1.3)f(1.3) must be within 0.0540.054 of 1.8351.835, that is, between 1.7811.781 and 1.8891.889. Since ∣1.9−1.835∣=0.065>0.054|1.9 - 1.835| = 0.065 \gt 0.054, f(1.3)f(1.3) cannot be 1.91.9.

7. (Core) Using M=1M = 1, what is the smallest degree nn for which the Lagrange error bound guarantees that the Maclaurin polynomial for sin⁡x\sin x approximates sin⁡1\sin 1 within 0.0010.001?

Solution

Every derivative of sin⁡x\sin x is ±sin⁡x\pm\sin x or ±cos⁡x\pm\cos x, so M=1M = 1, and ∣x−a∣=1|x - a| = 1:

∣Rn(1)∣≤1(n+1)!|R_n(1)| \le \frac{1}{(n+1)!}

You need (n+1)!>1000(n+1)! \gt 1000. Since 6!=7206! = 720 and 7!=50407! = 5040, n+1=7n + 1 = 7, so n=6n = 6. (The degree 6 polynomial is the same as the degree 5 one, x−x36+x5120x - \dfrac{x^3}{6} + \dfrac{x^5}{120}, because sine has no x6x^6 term.)

8. (Challenge) Use the third-degree Taylor polynomial for ln⁡x\ln x about x=1x = 1 to approximate ln⁡0.9\ln 0.9, and find a Lagrange error bound. Why can’t you use the alternating series error bound here?

Solution

The derivatives of ln⁡x\ln x at 11 are f′(1)=1f'(1) = 1, f′′(1)=−1f''(1) = -1, f′′′(1)=2f'''(1) = 2, so

P3(x)=(x−1)−(x−1)22+(x−1)33P_3(x) = (x - 1) - \frac{(x - 1)^2}{2} + \frac{(x - 1)^3}{3}

With x−1=−0.1x - 1 = -0.1:

ln⁡0.9≈−0.1−0.005−0.000333≈−0.105333\ln 0.9 \approx -0.1 - 0.005 - 0.000333 \approx -0.105333

Next, f(4)(x)=−6x4f^{(4)}(x) = -\dfrac{6}{x^4}, and 6x4\dfrac{6}{x^4} is decreasing, so on 0.9≤z≤10.9 \le z \le 1 its maximum is at z=0.9z = 0.9: M=60.94≈9.145M = \dfrac{6}{0.9^4} \approx 9.145 (use M=9.2M = 9.2 to be safe).

∣R3(0.9)∣≤9.24! ∣−0.1∣4=9.2(0.0001)24≈0.0000383|R_3(0.9)| \le \frac{9.2}{4!}\,|-0.1|^4 = \frac{9.2(0.0001)}{24} \approx 0.0000383

At x=0.9x = 0.9 every term −0.1-0.1, −0.005-0.005, −0.000333-0.000333, … is negative, so the series isn’t alternating and the alternating series bound doesn’t apply. (Check: ln⁡0.9≈−0.105361\ln 0.9 \approx -0.105361, an error of about 0.00002720.0000272.)

9. (Challenge) Use P6(1)=1+1+12!+13!+14!+15!+16!P_6(1) = 1 + 1 + \dfrac{1}{2!} + \dfrac{1}{3!} + \dfrac{1}{4!} + \dfrac{1}{5!} + \dfrac{1}{6!} and the Lagrange error bound with M=3M = 3 to show that 2.718<e<2.7192.718 \lt e \lt 2.719.

SolutionP6(1)=1957720≈2.718056P_6(1) = \frac{1957}{720} \approx 2.718056

As in Example 4, M=3M = 3 works on 0≤z≤10 \le z \le 1:

∣R6(1)∣≤37!=35040≈0.000595|R_6(1)| \le \frac{3}{7!} = \frac{3}{5040} \approx 0.000595

So e≤2.718056+0.000595=2.718651<2.719e \le 2.718056 + 0.000595 = 2.718651 \lt 2.719.

Also, every term of the Maclaurin series for e1e^1 is positive, so the remainder (the sum of the terms left out) is positive: e>P6(1)≈2.718056>2.718e \gt P_6(1) \approx 2.718056 \gt 2.718.

Together, 2.718<e<2.7192.718 \lt e \lt 2.719.