Mathematical approximations are necessary because on most computers the only built-in operations are
addition, subtraction, multiplication, and division. In order to do other mathematical operations, such as
evaluating functions like sin x or ex, solving algebraic or differential equations, or doing definite integrals, one
must approximate these operations with a finite number of built-in operations. The error in this type of
approximation is called a truncation error. In this section we look at approximating functions using a Taylor
series. In chapter 4 we consider other methods of approximating functions.
f(x) p(x)
where
an =
This is called the nth degree Taylor series approximation of f(x) at x = 0. For each n we get a different
approximation.
Example 1. Apply (1) to f(x) = ex. In this case f (n)(x) = ex for all n and f (n)(0) = 1 for all n. Therefore (1)
becomes
(2) ex 1 + x + + + +
1.1.1 - 1
R = Rn(x) is sometimes called the remainder and it depends on x and n. If x is restricted to a small interval,
the error is approximately a constant times xn+1. Thus the error is small when x is small, but increases rapidly
with x. More precisely one has the following Proposition.
(4) R = =
The proof of Proposition 1 is given at the end of this section. Since the number in (4) is usually not known,
we are usually content with an estimate of the error.
Example 2. Apply Proposition 1 to f(x) = ex. In this case (3) and (4) become
(5) R = ex - [ 1 + x + + + + ] =
Example 3. Use (3) with n = 3 to approximate e-0.5. Then use (5) to find an upper bound for the error in this
approximation.
(6) |f (x) | K
(n+1)
for | x | .
Then
Example 4. Use (3) with n = 2 and n = 3 to approximate ex for | x | ½. Find an upper bound for the error in
these approximations.
(8a) ex 1 + x +
(8b) ex 1 + x + +
(9a) R2 = for n = 2
(9) R3 = for n = 3
1.1.1 - 2
| R2 | = = 0.034.. for | x | ½.
| R3 | = = 0.00429.. for | x | ½.
The actual maximum for | R2 | for | x | ½ is about 0.024 so this method produces an over estimate for the
maximum for the absolute value of the error.
Sometimes one wants to know how small an interval of the form | x | one must restrict x to in order that the
error will be less than a given amount.
Example 5. Consider the approximation (8). Let’s find so that | R | 10-4 for | x | .
Arguing as in Example 4 one has | R | for | x | . So we need to find so that 4e 2.4 10-3. One
possibility is to take as the solution of the equation 4e = 2.4 10-3. This is a nonlinear equation for that
one can solve (approximately) using the methods of Chapter 2. Calculators and mathematical software have
these equation solving methods built-in and if we use one of them we get = 0.210021. Another approach is
to start with an upper bound for the solution of the equation, e.g. from Example 4 we see that is less than 1/2
. So e is less than e0.5 which is less than 2. We solve the equation 2 4 = 2.4 10-3. Its solution is = 0.18…
So = 0.18 is an answer to the question, although it is not as sharp as the one obtained by solving the equation
4e = 2.4 10-3.
Yet another problem is to find n so that | R | is less than a given amount for x in a given interval. Let’s suppose
the interval is of the form | x | .
Example 6. Consider the approximation (3). Let’s find n so that | R | is less than 10-3 in the interval | x | ½.
Arguing as in Example 3 one has | R | for | x | ½ . So we need to find n so that This is a nonlinear
inequality for n that is hard to solve analytically. One way to obtain a solution is to make a guess at a value of
n and check if it works. Based on the outcome we either increase or decrease our guess and try again. We
repeat this until we find the smallest one for which the inequality holds. From Example 4 we know that n = 3
doesn't work. If we try n = 4 then = 0.0004… < 0.001, so n = 4 works.
Equation (1) and Proposition 1 generalize to the nth degree Taylor series approximation of f(x) centered at x =
xo.
Section 1.9.1 has some illustrations of using mathematical software when making Taylor series
approximations.
Proof of Proposition 1. First consider the case n = 0 in which case (4) becomes
1.1.1 - 3
The first equality is just the fundamental theorem of calculus and the equality f(x) – f(0) = f '() x follows from
the mean value theorem for derivatives. To prove the left inequality in (4) for n = 1 we integrate by parts
letting u = f '(t) and dv = dt. Then du = f ''(t)dt and for v we can take v = - (x-t). Therefore
So
which is the left equality in (4) for n = 1. Integrating by parts again gives
which is the left equality in (4) for n = 2. Integrating by parts n – 2 more times gives the left inequaltiy in (4)
for general n. The right inequality in (4) follows from the integral mean value theorem. (See the
following.) //
Integral Mean Value Theorem. Suppose f(x) and g(x) are continuous for a x b and g(x) is of one sign
between a and b. Then there is a number between a and b such that .
Problems. You may use mathematical software to help with the calculations.
1 a. Find the 8th degree Taylor series approximation to f(x) = tan x centered at xo = 0.
b. Use this to estimate the value of tan(0.1). Estimate the error in this approximation.
c. Estimate the truncation error in part a as x varies over the interval | x | 0.2.
d. For the approximation in part a, find so that | R | 10-4 for | x | .
e. If in part a we take the terms up to order n, find n so that | R | 10-3 for | x | 0.2.
Answers. (a) tan x x + x3/3 + 2x5/15 + 17x7/315. (b) tan(0.1) 0.100335. The error is less than
2.8 10-11. (c) 2.4 10-8. (d) 0.42. (e) 3.
2 a. Find the 2nd degree Taylor series approximation to f(x) = centered at xo = 1.
b. Use this to estimate the value of and find an upper bound for the truncation error.
c. Find an upper bound for the truncation error in the approximation that you found in part a as x
varies over the interval 1 x 1.5.
d. For the approximation in part a, find so that | R | 10-4 for 1 x 1 + .
e. If in part a we take the terms up to order n, find n so that | R | 10-3 for 0.8 x 1.2.
1.1.1 - 4