shaun ault

ap calculus bc review: lagrange error bound

what is the lagrange error bound? basically, it’s a theoretical limit that measures how bad a taylor polynomial estimate could be. read on to find out more!

lagrange error bound - magoosh

taylor series and taylor polynomials

the whole point in developing taylor series is that they replace more complicated functions with polynomial-like expressions. the properties of taylor series make them especially useful when doing calculus.

remember, a taylor series for a function f, with center c, is:

taylor series for a function f

taylor series are wonderful tools. however, the biggest drawback associated with them is the fact that they typically involve infinitely many terms.

infinitely many terms?  ain't nobody got time for that

so in practice, we tend to use only the first few terms. maybe 3 terms, maybe 30, but at least a finite number of terms is more reasonable than all infinitely many of them, right?

but there is a trade-off. you lose accuracy. a taylor polynomial (that is, finitely many terms of a taylor series) can provide a very good approximation for a function, but it can’t model the function exactly.

that’s where the error comes in.

by the way, now would be a great time to review: ap calculus bc review: taylor polynomials and ap calculus bc review: taylor and maclaurin series.

the lagrange error bound

let t(x) be the nth order taylor polynomial for a given function f, with center at c.

taylor polynomial definition

then the error between t(x) and f(x) is no greater than the lagrange error bound (also called the remainder term),

lagrange error bound

here, m stands for the maximum absolute value of the (n+1)-order derivative on the interval between c and x. in other words, m is found by plugging in the z-value between x and c that maximizes the following expression:

m in lagrange error bound

that may sound complicated, but in practice, there’s usually a quick way to decide what m should be.

example

use the lagrange error bound to estimate the error in using a 4th degree maclaurin polynomial to approximate cos(π/4).

solution

first, you need to find the 4th degree maclaurin polynomial for cos x. a maclaurin polynomial is simply a taylor polynomial centered at c = 0.

t(x) = 1 - x^2/2 + x^4/24

now, for the error bound, we’ll need to know what the 5th-derivative of f(x) = cos x is. (you probably would have computed all of the derivatives up to the 4th order when you constructed the maclaurin polynomial for the function, anyway.)

derivatives of cos x

now, the largest that |-sin x| could possibly be is 1. (actually, we could do even better than that if we realize that |-sin(π/4)| = 0.707 maximizes the quantity on the interval [0, π/4], but we’ll stick with our first estimate of 1. after all, this is only an estimate!)

so, we have m = 1. plugging this into the error bound formula with n = 4, we get:

example error bound

the error is roughly 0.0025

follow-up: how good was our estimate?

because the computed error bound was so tiny, we can be sure that t(x) approximates the values of cos x incredibly well, at least when the input is within the interval from 0 to π/4.

let’s compare values to see just how close the approximation really is. computing each of t(π/4) and cos(π/4) to eight digits of accuracy:

t(pi/4) = 0.70742921

cos(pi/4) = 0.70710678

the actual error is: 0.70742921 – 0.70710678 = 0.00032243. this is much better than our estimated error of 0.0025. really, the lagrange error bound is just a worst-case scenario in terms of estimating error; the actual error is often much less.

author

  • shaun ault

    shaun earned his ph. d. in mathematics from the ohio state university in 2008 (go bucks!!). he received his ba in mathematics with a minor in computer science from oberlin college in 2002. in addition, shaun earned a b. mus. from the oberlin conservatory in the same year, with a major in music composition. shaun still loves music — almost as much as math! — and he (thinks he) can play piano, guitar, and bass. shaun has taught and tutored students in mathematics for about a decade, and hopes his experience can help you to succeed!

more from magoosh