Error Bounds for Power Series (College Board AP® Calculus BC): Revision Note

Roger B

Written by: Roger B

Reviewed by: Mark Curtis

Updated on

Lagrange error bound

What is a Lagrange error bound?

  • A Lagrange error bound gives a maximum interval for the error when a Taylor polynomial is used to approximate a function

  • Let f be a function and let  pn be the nth degree Taylor polynomial for f about x=a

    •  pn may be thought of as the nth partial sum of the function's Taylor series

    • Note that  pn will also be a function of x, i.e.  pn=pn(x)

  • Then the remainder, Rn, of the Taylor series is Rn(x)=f(x)pn(x)

    • The difference between the exact value of the function and the value of  pn at a particular value of x

  • If f can be differentiated n+1 times on an interval containing a (i.e. containing the center of the Taylor series expansion), then for all x in that interval

    |Rn(x)|M(n+1)!|xa|n+1

    • where M is a number such that |f(n+1)(x)|M for all x in the interval

      • I.e. M is an upper bound on the absolute value of the (n+1)th derivative of f for all values of x within the interval we're interested in

      • Ideally, you want the smallest value of M that still bounds the absolute value of the (n+1)th derivative

        • But any value of M satisfying the inequality will still give a mathematically valid result

How do I calculate a Lagrange error bound for an interval of x values?

  • Calculating a Lagrange error bound is best shown using an example, e.g. consider the Taylor series of ex1 about x=1

    n=0(x1)nn!=1+(x1)+12(x1)2+16(x1)3+...

    • Say we want to use the first three terms to approximate the value of the function on the interval [0, 2]

      • I.e.  ex1p2(x)=1+(x1)+12(x1)2 for x[0, 2]

    • The Lagrange error bound will be

      |R2(x)|M(2+1)!|x1|2+1=M6|x1|3

    • To find M we need to find a number such that |f(n+1)(x)|M for all x in [0, 2]

      • Note that ddx(ex1)=ex1, so f(n+1)(x)=ex1 for all n

      • And ex1 is an increasing positive function, so on [0, 2] it is true that ex1 is less than its value at x=2, i.e.|f(n+1)(x)|e21=e

      • So we can use M=e

    • Therefore for any x[0, 2], the Lagrange error bound is

      |R2(x)|e6|x1|3

      • I.e., the difference between the exact value and the approximated value cannot be greater than that for any x in the interval

    • By substituting a value of x into that formula, you can obtain an error bound for that value of x

Examiner Tips and Tricks

Remember that |sinx|1 and |cosx|1 for any real number x. Because all derivatives of sine or cosine functions are also sine or cosine functions, those inequalities can be very useful for finding a value for M when you have a Taylor series for sine or cosine.

How do I calculate a Lagrange error bound for a particular value of x?

  • A question may ask to calculate an error bound for a particular value of x only, say x=x0

    • rather than an error bound valid for x in an interval containing x0

  • To do this, first substitute x0 into the same formula above to get |Rn(x0)|M(n+1)!|x0a|n+1

    • Then calculate M such that |f(n+1)(x)|M for x in the interval:

      • [x0, a]  if x0<a

      • or [a, x0]  if x0>a

  • Using the example above, if we now want the Lagrange error bound from using p2(x) about x=1 to approximate ex1 at the particular value x=32

    • then calculate M is as follows:

      • f(n+1)(x)=ex1 is an increasing positive function, so on the interval [1,32] then ex1 is less than its value at x=32, i.e.|f(n+1)(x)|e321=e12=e

      • So |R2(32)|e6|321|3=e48

    • e48 is a better (tighter) error bound than you would have found by substituting x=32 into the previous Lagrange error bound for [0, 2] (which gives e48)

Worked Example

x

 f(x)

 f'(x)

 f''(x)

 f'''(x)

 f(4)(x)

2

7

5

3

2

1

3

14

9

235

229

95

4

26

15

152

7725

5120

Let f be a function having derivatives of all orders for x>0. Selected values of f and its first four derivatives are indicated in the table above. The function f and these four derivatives are all increasing on the interval 2x4.

(a) Write the third-degree Taylor polynomial for f about x=3 and use it to approximate f(2.9).

(b) Use the Lagrange error bound to show that the third-degree Taylor polynomial for f about x=3 approximates f(2.9) with error less than 8×106.

Answer:

(a)

The third-degree Taylor polynomial about x=3 is given by  p3(x)=f(3)+f'(3)(x3)+f''(3)2!(x3)2+f'''(3)3!(x3)3

Substitute in the values from the table

 p3(x)=f(3)+f'(3)(x3)+f''(3)2!(x3)2+f'''(3)3!(x3)3=14+9(x3)+2352(x3)2+2296(x3)3=14+9(x3)+2310(x3)2+2254(x3)3

14+9(x3)+2310(x3)2+1127(x3)3

To find the estimate for f(2.9), substitute x=2.9 into that polynomial

f(2.9)14+9(2.93)+2310(2.93)2+1127(2.93)3=14+9(0.1)+2310(0.1)2+1127(0.1)3=13.122592...

13.123 (3 d.p.)

(b)

The Lagrange error bound is given by

|Rn(x)|=|f(x)pn(x)|M(n+1)!|xa|n+1

where M is a constant such that |f(n+1)(x)|M

Here n=3, so to find a value for M we need to consider the fourth derivative; i.e.f(n+1)(x)=f(3+1)(x)=f(4)(x)

We are told that the first four derivatives are all increasing on the interval 2x4, so we can say that the maximum value of the fourth derivative on the interval 2.9x3 is equal to f(4)(3)

max2.9x3|f(4)(x)|=f(4)(3)=95

(Note that using the maximum value on a bigger interval, say 2x4 or 2.9x4, would also give a mathematically valid bound; but using 2.9x3 will give a tighter, and hence more accurate, bound)

Substitute this as M and x=2.9 into the Lagrange error bound formula

|R3(2.9)|M(3+1)!|2.93|3+1=954!|0.1|4=340(0.1)4=7.5×106<8×106

|R3(2.9)|<8×106

Alternating series error bound with power series

How can I use the alternating series error bound with power series?

  • If a Taylor series (or other power series) is an alternating series, then you may be able to use the alternating series error bound to find a bound on the error for a particular value of x

    • The power series must be convergent, and the value of x must lie within the interval of convergence of the series

    • Recall that the alternating series error bound is |Ssn|<an+1 where

      • S is the limit of the alternating series

      • sn is the partial sum (the sum of the first n terms)

      • an+1 is the positive part of the (n+1)th term

  • For example, consider the Maclaurin series for sinx (where x is in radians)

    sinx=xx36+x5120x75040+...

    • That is a convergent power series, whose interval of convergence is (, )

      • So in this case the alternating series error bound can be used with any value of x

  • Say we want to find the error bound for using the first three terms of the Maclaurin expansion to calculate the value of sin(1)

    • First write out the series with the value x=1 substituted in

      sin(1)=1(1)36+(1)5120(1)75040+...=116+112015040+...

    • The error bound |Ss3|<a4 is then given by

      |sin(1)(sum of first 3 terms)||4th term|

      • sin(1)=0.841470...

      • s3=116+1120=101120=0.841666...

      • So |sin(1)101120|=0.0001956..., which is indeed less than a4=|15040|=15040=0.0001984...

  • See the 'Alternating Series Error Bound' study guide for more info on this form of error bound

Examiner Tips and Tricks

You may be asked to find an error bound for a function that is only given in power series form. In such a case it will not be possible to calculate the f(n+1)(x) derivative that is needed for the Lagrange error bound. However if the power series is an alternating series, the alternating series error bound can still be used.

Worked Example

The function f has derivatives of all orders, and the Maclaurin series for f is n=1(1)n+1(xnn·3n)=x3x218+x381x4324+.... The interval of convergence for the series is 3<x3.

(a) Approximate the value of f(12) using the first three non-zero terms of the Maclaurin series.

(b) Find an upper bound for the error of this approximation.

Answer:

(a)

Substitute x=12 into the series, just using the first three terms

f(12)(12)3(12)218+(12)381=12·314·18+18·81=16172+1648=25162

25162

(b)

From the information given the series converges for x=12 (since it is in the interval of convergence 3<x3) so we can use the alternating series error bound here

The first three terms are used for the approximation, so the error given by |f(12)25162|will be less than or equal to the absolute value of the fourth term when x=12

|(12)4324|=116·324=15184

|f(12)25162|15184

How can I find an alternating series error bound for an interval of x values?

  • If a Taylor series (or other power series) is an alternating series, then you may also be able to use the alternating series error bound to find a bound on the error over an interval of x values

    • The power series must be convergent, and the x values all must lie within the interval of convergence of the series

    • Recall that the alternat series error bound is |Ssn|<an+1 where

      • S is the limit of the alternating series

      • sn is the partial sum (the sum of the first n terms)

      • an+1 is the positive part of the (n+1)th term

  • For example, consider again the Maclaurin series for sinx (where x is in radians)

    sinx=xx36+x5120x75040+...

    • That is a convergent power series, whose interval of convergence is (, )

      • So in this case the alternating series error bound can be used with any value of x

  • Say we want to find an error bound for using the first three terms of the Maclaurin expansion to calculate values of sin(x) in the interval 13x14

    • The error bound |Ss3|<a4 is then given by

      |sin(x)(sum of first 3 terms)||4th term|

    • The absolute value of the fourth term is

      |x75040|=|x|75040

    • To find an error bound that is valid for the entire interval, you need to pick the value of x that maximises |x|75040

    • Here that is going to be x=13, which gives an error bound of

      |13|75040=111022480=0.00000009072...

    • That error bound will apply to all x in the interval 13x14

      • Although you would be able to calculate smaller error bounds for individual values of x within the interval

  • Note that in general the largest error bound on an interval will come from

    • the value of x that is furthest away

    • from the point about which the Taylor series is centered

Examiner Tips and Tricks

Be careful with apparently alternating power series, as they might not be alternating for all values of x!

This is not a problem with the Maclaurin series for sinx:

sinx=n=0(1)nx2n+1(2n+1)!=xx36+x5120x75040+...

sin(1)=116+112015040+...

sin(1)=(1)(1)36+(1)5120(1)75040+...=1+161120+15040...

For negative value of x, the signs flip, but it is still an alternating series.

But consider instead the Maclaurin series for ex:

ex=n=0(1)nxnn!=1x+x22x36+...

That is indeed an alternating series for positive powers of x, for example if x=1

e(1)=11+1216+...

But it is not an alternating series for negative values of x, for example if x=1

e(1)=1(1)+(1)22(1)36+...=1+1+12+16+...

So the alternating series error bound would not be appropriate to use with the Maclaurin series for ex for any values of x<0.

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Build on this topic

Roger B

Author: Roger B

Expertise: Development Editor

Roger's teaching experience stretches all the way back to 1992, and in that time he has taught students at all levels between Year 7 and university undergraduate. Having conducted and published postgraduate research into the mathematical theory behind quantum computing, he is more than confident in dealing with mathematics at any level the exam boards might throw at you.

Mark Curtis

Reviewer: Mark Curtis

Expertise: Maths Content Creator

Mark graduated twice from the University of Oxford: once in 2009 with a First in Mathematics, then again in 2013 with a PhD (DPhil) in Mathematics. He has had nine successful years as a secondary school teacher, specialising in A-Level Further Maths and running extension classes for Oxbridge Maths applicants. Alongside his teaching, he has written five internal textbooks, introduced new spiralling school curriculums and trained other Maths teachers through outreach programmes.