How Taylor polynomials with a remainder bound give function values and integrals to a guaranteed accuracy, and how to pick the center and the degree to meet a given tolerance.
Before computers, tables of sinx, ex and lnx were filled in by hand, and the people who computed them needed to know every digit was right. Taylor’s formula gives both halves of that job. The polynomial gives the number, and the remainder term says how far off it can be. The same idea, integrated term by term, handles integrals that have no elementary antiderivative.
Key terms
Taylor’s formula with remainder
Definition Let n≥0 be an integer and let f be n+1 times differentiable on an open interval I containing a. For each x in I,
f(x)=Pn(x)+Rn(x),Pn(x)=k=0∑nk!f(k)(a)(x−a)k,
and there is a number ξ strictly between a and x (or ξ=a when x=a) with
Rn(x)=(n+1)!f(n+1)(ξ)(x−a)n+1.
Consequently, if ∣f(n+1)(t)∣≤M for every t between a and x, then
∣Rn(x)∣≤(n+1)!M∣x−a∣n+1.
This is Taylor’s inequality.
In plain words The Taylor polynomial is the best polynomial match at a, and the remainder is the exact error. You rarely know ξ, but bounding the derivative bounds the error.
Example For f(x)=ex at a=0, every derivative is ex, so
P2(x)=1+x+2x2,R2(x)=6eξx3
for some ξ between 0 and x.
Evaluating functions with Taylor polynomials
Definition To evaluate f(x) with a Taylor polynomial, compute Pn(x) and report it together with a bound B on ∣Rn(x)∣ from Taylor’s inequality, so that
Pn(x)−B≤f(x)≤Pn(x)+B.
In plain words You get the approximate value and a guarantee in one step. The answer is an interval that must contain the true value.
Example Approximate e0.1 with n=3 and a=0. The polynomial gives
P3(0.1)=1+0.1+0.005+60.001≈1.1051667.
On [0,0.1] the fourth derivative satisfies f(4)(t)=et≤e0.1<1.2, so
∣R3(0.1)∣≤241.2⋅0.14=5×10−6.
The true value is e0.1≈1.1051709, and the actual error 4.3×10−6 is within the bound.
Taylor-based quadrature
Definition To approximate ∫cdf(x)dx, expand f in a Taylor polynomial Pn about a point a, where [c,d] lies inside an open interval I containing a on which f is n+1 times differentiable, and integrate the polynomial exactly. Since f=Pn+Rn on I,
∫cdf(x)dx=∫cdPn(x)dx+∫cdRn(x)dx.
The first integral is the approximation. The second is its error. When f is the sum of a power series about a and [c,d] lies inside the open interval of convergence, the series may be integrated term by term over [c,d] instead.
In plain words Polynomials are easy to integrate. Replace the hard integrand by its Taylor polynomial and integrate that.
Example Approximate ∫01/2e−x2dx, which has no elementary antiderivative. Put u=−x2 in eu=1+u+2u2+… and keep three terms.
∫01/2(1−x2+2x4)dx=21−241+3201≈0.4614583.
The full series integrates to an alternating series whose terms decrease to 0, so the error is at most the first omitted term,
6⋅7(1/2)7≈1.86×10−4.
The true value is about 0.4612810, an error of 1.77×10−4.
Integrated remainder bound
Definition Suppose Taylor’s formula holds on an interval containing [c,d]. If ∣Rn(x)∣≤ρ(x) for all x in [c,d] and ρ is integrable on [c,d], then
where M bounds ∣f(n+1)∣ on the smallest closed interval containing both a and [c,d].
In plain words Bound the error at each point, then integrate the bound. This works whether or not the series alternates.
Example Approximate ∫01xsinxdx, where the integrand is defined as 1 at x=0. For sinx about 0 the polynomials P5 and P6 are both x−6x3+120x5, and ∣sin(7)∣≤1, so ∣R6(x)∣≤5040∣x∣7. Dividing by x>0 gives
xsinx−(1−6x2+120x4)≤5040x6,
which also holds at x=0. Integrating over [0,1] gives the approximation
1−181+6001≈0.946111
with error at most
∫015040x6dx=352801≈2.83×10−5.
The true value is about 0.946083, an error of 2.80×10−5.
Expansion center
Definition The expansion center is the point a about which Pn is built. It must lie in an open interval on which f has the required derivatives, and the values f(k)(a) must be known exactly or cheaply. Because the remainder bound contains the factor ∣x−a∣n+1, a center close to x gives a smaller error for the same degree.
In plain words Expand around a nearby point where you already know the function exactly.
Example To approximate 4.1, a center at 0 is useless because x is not differentiable there. Center at a=4, where 4=2. With f′(x)=21x−1/2 and f′′(x)=−41x−3/2,
P2(x)=2+4x−4−64(x−4)2,P2(4.1)=2.02484375.
On [4,4.1] the third derivative satisfies
f′′′(t)=83t−5/2≤83⋅4−5/2=2563,
so the error is at most 2563⋅60.13≈1.95×10−6. In fact 4.1≈2.02484567, off by 1.92×10−6.
Polynomial degree
Definition For a fixed center a and point x, the degree n of Pn is the highest power of (x−a) allowed in it. To meet a target error, choose the smallest n whose remainder bound
(n+1)!Mn+1∣x−a∣n+1
is small enough, where Mn+1 bounds ∣f(n+1)∣ between a and x. The guarantee comes from the bound, so a degree that happens to give a small actual error without a bound to show it is not guaranteed.
In plain words More terms usually means a better answer, and the factorial in the bound tells you how many terms are enough.
Example Approximate e=e1 with center 0 within 10−6. Here ∣f(n+1)(t)∣=et≤e<3 on [0,1], so you need
(n+1)!3≤10−6,that is(n+1)!≥3×106.
Since 9!=362880 and 10!=3628800, take n=9. Then P9(1)≈2.7182815 with actual error 3.0×10−7. With n=8 the error is 3.1×10−6, too large.
Error tolerance
Definition An error tolerance is a number τ>0 that the error must not exceed. An approximation A of a quantity Q meets an absolute tolerance τ if ∣Q−A∣≤τ, and a relative tolerance τ if ∣Q−A∣≤τ∣Q∣. To certify a Taylor approximation, show that the remainder bound is at most τ.
In plain words The tolerance is the accuracy you were asked for. You are done when your error bound, not your hope, is below it.
Example Find ln(1.1) within τ=10−5 using f(x)=ln(1+x) at a=0. Here
f(n+1)(t)=(1+t)n+1(−1)nn!,
so for 0≤t≤x we get
∣Rn(x)∣≤(n+1)!n!xn+1=n+1xn+1.
At x=0.1 the choice n=3 gives 410−4=2.5×10−5, too big, while n=4 gives 510−5=2×10−6. So
ln(1.1)≈0.1−20.01+30.001−40.0001≈0.0953083,
and the true value 0.0953102 is indeed within 10−5.
Check yourself
Approximate cos(0.2) by 1−2x2 and bound the error.
Show the answer
The approximation is 1−0.02=0.98. For cosine P2=P3, and ∣cos(4)∣≤1, so the error is at most
240.24≈6.7×10−5.
In fact cos0.2≈0.980067.
What degree n of the Taylor polynomial for sinx about 0 guarantees sin1 within 10−4?
Show the answer
Every derivative of sin is bounded by 1, so ∣Rn(1)∣≤(n+1)!1. You need (n+1)!≥104. Since 7!=5040 and 8!=40320, take n=7, giving
1−61+1201−50401≈0.841468.
Use cosu≈1−2u2 to approximate ∫01/2cos(x2)dx and bound the error.
Show the answer
The approximation is
∫01/2(1−2x4)dx=21−10(1/2)5=0.496875.
Since ∣cosu−(1−2u2)∣≤24u4, the integrand error is at most 24x8, and
May we count page visits to understand which courses and learning features are useful? Cloudflare collects visit and performance statistics, without your account details or answers. Your choice does not affect access. Details