Kim’s Math NotesCourse index

Lagrange Error Bound

How do I bound the error of a Taylor polynomial?

Bound the error of a Taylor polynomial with M(n+1)!|x−a|n+1, choosing M yourself.

A negative bound

Common mistake M=−6 → bound =−12500

Correction M=|−6|=6 → bound =12500

Idea 1: the error, and a bound

Idea one: the error, and a bound. The error of a Taylor polynomial at x is the difference: f of x minus P sub n of x. On the graph, it's the gap between the curve of f and the curve of P sub n, measured at x. For the exact error, we'd need f of x itself. But that's the value we don't have.

So we ask for a bound instead. That's a number we can compute, and the size of the error never passes it.

Watch this part of the concept lesson

Read the rest of this scene

Say the bound is one over one hundred. Then P sub n of x and f of x are at most that far apart. That's guaranteed, even though we never see the exact value.

Idea 2: the Lagrange error bound

Idea two: the Lagrange error bound. The bound is one formula. The size of the error, f of x minus P sub n of x, is at most M over the quantity n plus one, factorial, times the size of x minus A, to the n plus one. It's called the Lagrange error bound. The exam never asks for the proof.

It asks you to use the bound.

Watch this part of the concept lesson

Read the rest of this scene

So learn to read its three parts. First, n plus one. It's one more than n, the n in P sub n. It sits in three places: the next derivative, the next factorial, and the next power. Second, M.

The size of the derivative of order n plus one is at most M, everywhere between A and x: from the point where we built the polynomial to the point where we want the value. Third, the size of x minus A. That's how far x, where we want the value, is from A, where we built the polynomial. Now compare it with the next term of the polynomial, the first omitted term: the derivative of order n plus one at A, over the quantity n plus one, factorial, times x minus A, to the n plus one. The bound has the same shape, with M in place of that derivative at A.

One check, with n equals zero. P sub zero is just f of A. So the bound says the size of f of x minus f of A is at most M times the size of x minus A. For a continuous, differentiable function, that's what the Mean Value Theorem gives, when the size of f prime is at most M.

Idea 2: using the bound in three steps

Idea two, again: using the bound. Let's use it. Last time we built P sub two for root x, centered at four. Evaluate it at x equals six. How big can the error be? Step one. n is two, so we need the next derivative.

Last time, f double prime of x was negative one fourth, x to the negative three halves.

Watch this part of the concept lesson

Read the rest of this scene

Differentiate once more: the next derivative is three eighths, x to the negative five halves. That's three, over eight x to the five halves. Step two: find M, an upper bound for the absolute value of the next derivative on the interval from four to six. Here the derivative is positive and gets smaller as x grows, so it's biggest at x equals four. Four to the five halves is root four, to the fifth.

That's two to the fifth, which is thirty-two. So M is three, over eight times thirty-two. That's three over two hundred fifty-six. Step three: plug in. The error is at most M over three factorial, times the size of six minus four, cubed.

Three factorial is six, and two cubed is eight. So that's three over two hundred fifty-six, times one sixth, times eight. Multiply across: twenty-four over one thousand five hundred thirty-six, which reduces to one over sixty-four. A calculator shows the real error is about zero point zero one two. The bound, one over sixty-four, is about zero point zero one six.

The real error is inside the bound.

Idea 3: choosing M

Idea three: choosing M. M doesn't have to be the exact maximum. Any number that the size of the derivative never passes, between A and x, will do. A bigger M gives a looser bound, but it's still a true bound. So pick an M that's easy to justify.

Often it's handed to you.

Watch this part of the concept lesson

Read the rest of this scene

If the problem says the size of the fourth derivative is at most six, then M is six. Or the derivative only goes up, or only goes down, between A and x, like ours did. Then its biggest size is at an endpoint.

Idea 3: sine, cosine, and the sign of a bound

Idea three, again: sine and cosine. Now, for sine x and cosine x, every derivative is plus or minus a sine or a cosine again, so its size never passes one. M equals one always works. Careful: a bound is a size, so it's never negative. M comes from the absolute value of the derivative.

Watch this part of the concept lesson

Idea 3: a second bound, from alternating terms

Idea three, again: a second bound. One more bound, and it needs no derivative. For cosine x, the Maclaurin polynomials add these terms: one, minus x squared over two factorial, plus x to the fourth over four factorial, minus x to the sixth over six factorial, and so on. Put in x equals one. The terms become one, minus one half, plus one over twenty-four, minus one over seven hundred twenty, and so on.

The signs alternate, and the sizes shrink to zero. So the values of the polynomials zigzag, and the swings get smaller. Stop at P sub two.

Watch this part of the concept lesson

Read the rest of this scene

At one, its value is one half. The next term, the first unused one, is one over twenty-four. Is the sum really cosine of one? Today's bound can check it. Take M equals one.

At x equals one, the error is at most one over the quantity n plus one, factorial, and that goes to zero. So the sum of the series is cosine of one. Now use the alternating series error bound. The sum is always between two neighboring dots, so the error is at most the size of the first unused term. Here, we stopped at P sub two, so that term is one over twenty-four.

No derivative needed.

Example 1: show the error is small

Example one is a free response question. The fourth-degree Taylor polynomial for f about x equals zero is used to approximate f of zero point one. Given that the size of the fifth derivative of f is at most fifteen, for x from zero to zero point five, show that the error is less than one over ten to the fifth. The plan: P sub four means n plus one is five. Write the bound with the fifth derivative, and then compare it with the target.

The size of the error, f of zero point one minus P sub four of zero point one, is at most fifteen over five factorial, times zero point one to the fifth.

Watch this part of the concept lesson

Read the rest of this scene

That's fifteen over one hundred twenty, times one over ten to the fifth, which is one eighth, times one over ten to the fifth. This line earns the point. One eighth of one over ten to the fifth is less than one over ten to the fifth. So, by the Lagrange error bound, the error is less than one over ten to the fifth. Name the bound when you write it.

Example 2: find M yourself

Example two is multiple choice. Let f of x be the natural log of one plus x, so that its fourth derivative is negative six, over one plus x, to the fourth. The third-degree Maclaurin polynomial is used to approximate f of zero point two. Which is the Lagrange error bound, with the smallest possible M? The plan: P sub three means n plus one is four.

Find M between zero and zero point two, and then write the bound.

Watch this part of the concept lesson

Read the rest of this scene

Take the size of the fourth derivative: six, over one plus x, to the fourth. The minus sign is gone. That size is decreasing as x grows. So between zero and zero point two, it's biggest at zero. There it equals six, so M is six.

Use six for M. That's six over four factorial, times zero point two to the fourth. Six over twenty-four is one fourth, and zero point two is one fifth. One fifth to the fourth is one over six hundred twenty-five. Multiply and you get positive one over twenty-five hundred.

So the answer is B. Choice D used three factorial and the cube: the degree of the polynomial, instead of the next one.

Common mistake: a negative bound

Stay with that derivative for a moment. It's negative on the whole interval, and that sign leads to a very common wrong answer. This is where people lose points. If you use negative six for M, the bound comes out as negative one over two thousand five hundred. But a bound on a size can never be negative.

M is the biggest size of the derivative, the absolute value of negative six, which is six. So the bound is positive: one over two thousand five hundred.

Watch this part of the concept lesson

Worked examples

Example 1

The fourth-degree Taylor polynomial P4 for f about x=0 is used to approximate f(0.1). Given that |f(5)(x)|≤15 for 0≤x≤0.5, show that |f(0.1)−P4(0.1)|<1105.
Hint

P4, so the next derivative is the 5th.

Answer and solution

Answer error ≤155!(0.1)5=18⋅1105<1105

  1. |f(0.1)−P4(0.1)|≤155!(0.1)5=18⋅1105
  2. <1105

Example 2

Let f(x)=ln(1+x), so that f(4)(x)=−6(1+x)4. The third-degree Maclaurin polynomial P3 is used to approximate f(0.2). Which is the Lagrange error bound, with the smallest possible M?
  1. −12500
  2. 12500
  3. 1625
  4. 1125
Hint

The size 6(1+x)4 is biggest at x=0.

Answer and solution

Answer B. 12500

  1. M=6:64!(0.2)4=14⋅1625=12500
  2. Answer B.

Workbook

Problem 1

Let P2 be the second-degree Maclaurin polynomial for a function f, and suppose |f′′′(x)|≤4 for 0≤x≤12. Find the Lagrange error bound for |f(12)−P2(12)|.
Hint

n=2, so use 3! and the cube.

Answer and solution

Answer 112

  1. 43!(12)3=46⋅18=112

Common mistake Using 2! and the square.

Watch the worked solution to Problem 1

Problem 2

Let P1 be the tangent line approximation to f at x=2, and suppose |f′′(x)|≤5 for 2≤x≤2.2. What is the Lagrange error bound for |f(2.2)−P1(2.2)|?
  1. 1
  2. 12
  3. 110
  4. 150
Hint

The tangent line is P1.

Answer and solution

Answer C. 110

  1. 52!(15)2=52⋅125=110.Answer C.

Common mistake (B) forgets to square the distance.

Watch the worked solution to Problem 2

Problem 3

The second-degree Maclaurin polynomial for cosx is P2(x)=1−x22. It is used to approximate cos(15). (a) Use the Lagrange error bound with n=2 to find a bound on the error. (b) The x3 term of the Maclaurin polynomial for cosx is 0, so P2=P3. Use the Lagrange error bound with n=3 to find a smaller bound.
Hint

Sine and cosine never pass 1 in size.

Answer and solution

Answer (a) 1750 (b) 115000

  1. (a) |sinx|≤1:13!(15)3=1750(b) |cosx|≤1:14!(15)4=115000

Common mistake Both bounds are true; the smaller one says more.

Watch the worked solution to Problem 3

Problem 4

The second-degree Maclaurin polynomial for ex is P2(x)=1+x+x22. It is used to approximate e12. Using e<4, show that the error is less than 124.
Hint

ex is increasing, so its biggest value is at the right end.

Answer and solution

Answer error <23!(12)3=124

  1. |f′′′(x)|=ex≤e12<4=2⇒error<23!(12)3=124

Common mistake Looking for the exact maximum; any number that is never passed will do.

Watch the worked solution to Problem 4

Problem 5

Let f(x)=ln(1+x), so that f(4)(x)=−6(1+x)4. The third-degree Maclaurin polynomial P3 is used to approximate f(12)=ln32. Show that the error is less than 150.
Hint

The size of the fourth derivative is biggest at 0.

Answer and solution

Answer error ≤64!(12)4=164<150

  1. |f(4)(x)|=6(1+x)4≤6 on [0,12]⇒error≤64!(12)4=164<150

Common mistake M is a size: 6, never −6.

Watch the worked solution to Problem 5

Problem 6

Let Pn be the nth-degree Maclaurin polynomial for a function f. For every n, |f(n)(x)|≤1 for 0≤x≤1. Find the least n for which the Lagrange error bound guarantees |f(1)−Pn(1)|<1100.
Hint

Write the bound with n in it.

Answer and solution

Answer n=4

  1. 1(n+1)!<1100⇒(n+1)!>100;4!=24,5!=120⇒n+1=5,n=4

Common mistake Answering 5, which is n+1.

Watch the worked solution to Problem 6