Professional Documents
Culture Documents
Taylor Polynomials: Answer
Taylor Polynomials: Answer
Taylor Polynomials: Answer
Taylor Polynomials
Question A broker offers you bonds at 90% of their face value. When you cash
them in later at their full face value, what percentage profit will you make?
Answer The answer is not 10%. In fact, since you will get $1 for each $0.90 you
invest, you get back
1
0.90 $1.11
for each dollar that you invest, giving you an 11% profit.
Now think about this problem in another way. You are being offered a discount of x
(in this case, x = 0.10). To find your profit you need to compute
1
f(x) = 1x 1.
We would like to find an easier-to-compute approximation to f(x), to see why f(0.90)
0.11, and to see quickly what would happen for other discount rates. In fact, we
shall see very soon that a good approximation is
2
f(x) x + x ,
if x is close to 0. When x = 0.10, this gives
f(x) 0.10 + 0.01 = 0.11.
What we are claiming then is that f(x) can be approximated by a polynomial. This is
nice because polynomials are the easiest functions to compute and manipulate. The
more general question behind all of this is:
Question How can any function f(x) be approximated, for values of x close to some
point a, by a polynomial?
Answer One very useful answer is given by the following theorem. Its proof is
really quite easy from the column method of integration by parts, and we shall give
this proof at the end of the section.
Taylor Polynomials
(n)
(n+1)
n
(t)(xt)
f
Rn =
dt
n!
(n)
+
2!
3!
n!
(n)
+
2!
3!
n!
For this reason, we often call the Taylor sum the Taylor approximation of degree n.
The larger n is, the better the approximation.
When a
so f(0) = 0
Taylor Polynomials
1
2
(1x)
2
f"(x) =
2
(1x)
6
f ' ' ' (x) =
2
(1x)
f'(x) =
so f'(0) = 1
so f"(0) = 2
so f ' ' ' (0) = 6
2x
1
2
0
+
(1)x
+
1x
2! = x + x .
2
2x
6x
1
2
3
1x 1 0 + (1)x + 2! + 3! = x + x + x .
2
Taylor Polynomials
approximate f(x) by polynomials of larger and larger degree, f(x) itself is not exactly a
polynomial, but rather an infinite polynomial, (called a power series).
Figure 1 shows the graphs of these approximations, together with the graph of f(x) =
1
1x 1.
Figure 1
Notice how the graphs of the successive approximations get closer and closer to the
curve near x = 0, but nowhere near the curve when x > 1.
f(x) = e
x
f'(x) = e
x
f"(x) = e
x
f ' ' ' (x) = e
(4)
x
f (x) = e
(5)
x
f (x) = e
so f(0) = 1
so f'(0) = 1
so f"(0) = 1
so f ' ' ' (0) = 1
(4)
so f (0) = 1
(5)
so f (0) = 1
Taylor Polynomials
(4)
(5)
Before we go on... This approximation turns out to be quite accurate for small
values of xeven as large as 1. For instance, if we take x = 1, the left-hand side is
2.7182..., while the right-hand side is 2.71666..., an accuracy to within about 0.002. It
turns out (and we shall see why shortly) that the error terms approach zero, no matter
what the value of x, so that
2
3
4
n
x x x
x
x
e 1 + x + 2! + 3! + 4! + + n! +
In particular,
1 1 1
1
1
e = e = 1 + 1 + 2! + 3! + 4! + + n! +
x
so f(1) = 0
so f'(1) = 1
so f"(1) = 1
so f ' ' ' (1) = 2
(4)
so f (1) = 6
Taylor Polynomials
(5)
f (x) =
24
5
x
(5)
so f (x) = 24
Before we go on... If |x| < 1, then the remainders go to zero as n gets large, so that
we can also represent ln x as an infinite polynomial:
2
(n+1)
n
(t)(xt)
f
Rn =
dt .
n!
This formula gives the exact error when f(x) is approximated by the nth Taylor sum.
The problem is that it is often too cumbersome to evaluate as it stands; what we're
going to do is get rid of this formula completely, and replace it by something more
manageable. Our philosophy is the following: rather than try to get the exact error, we
shall judiciously overestimate the magnitude of the error using a far simpler formula.
and claim, for instance, that e = 2.718 to within 0.0002, you would be dead wrong!
Question Fine. Now how do we overestimate the magnitude of Rn ?
Answer First, we look at the magnitude of the (n+1)st derivative of f(t) as t varies
between a and x, and overestimate that by a single number M. (See Figure 2.)
Taylor Polynomials
y
M
Graph of |f
(n+1) (t)|
t
a
x
(n+1)
M is an overestimation of the value of |f
(t)| for t between a and x.
Figure 2
We can then use the overestimation M to overestimate the error term Rn :
M(xa)
Rn (n+1)!
(n+1)
Quick Example
6
4 . For values of t
t
1, its magnitude is 6 or smaller, so we can take M = 6 for x = 2. If we expand f(x)
about a = 1, the third degree Taylor polynomial
2
3
(x1) (x1)
T(x) = (x1) 2 + 3 .
See Example 3
2
3
(21)
(21)
5
T(2) = (21)
2 + 3 = 6
is accurate to within
n+1
4
M(xa)
6(21) 1
=4
(n+1)! = 4!
5
1
Thus, ln 2 6 to within 4 .
(n+1)
(4)
(t) = f (t) =
Taylor Polynomials
T(x) = x + x + x .
To estimate the error, we need to calculate M . For this, we need to look at the
24
magnitude of the (n+1) = 4th derivative of f(t), which is
5 . Now t varies between
(1t)
0 and x, which is anywhere between 0 and 12 . In other words, t varies between 0 and 12
.
24
1
5 can be if t is between 0 and ? If
2
(1t)
you look at the graph of this function of t (plot a few points or use a graphing
calculator) you will see that it increases with t from 0 to 12 . (Figure 3).
We now ask ourselves: What is the biggest
Graph of f(t) =
24
5
(1t)
Figure 3
24
In other words, it is largest when t = 12 . Its value there is
)5 = 2432 = 768. In
(112
other words, we can take M = 768 (or even 800, if we prefersee the Figureas
long as we don't underestimate it!). Thus the error is
n+1
M(xa)
Rn (n+1)!
Taylor Polynomials
(3+1)
768x
R1 (3+1)!
768x
4.
= 4! = 32x
2
3
4
Thus, for example, if we take x = 13, then f(13) 13 +13 + 13 to within 3213 = 0.395
Example 5 Approximating e
1
1 1
Calculate the error when e is approximated by 1 + 1 + 2! + 3! + 4!.
x
Solution The given polynomial is the 4th Taylor approximation of e with a = 0 and
t
x = 1 (see Example 2). To get M, we look at the fifth derivative of e , which is again
t
e , and overestimate that for t between 0 and 1. Since the largest value it can have in
t
this range is e = e. we can take M = e, or simpler yet, M = 3, since we can be sure
that 3 is a convenient overestimation of e. Thus the error is
R4
3|(1-0)4+1|
3
(4+1)! = 120 = 0.025.
1
1 1
Thus, we can be sure that e 1 + 1 + 2! + 3! + 4!. to within 0.025.
120(1.11)5+1 0.00012
= 720 0.000 000 167.
(5+1)!
Taylor Polynomials
Before we go on... The point of this example is that there is a way to calculate
natural logarithms using ordinary arithmetic. If we wish to know ln 1.1, this tells us:
2
(1.11)
(1.11) (1.11)
(1.11)
ln 1.1 (1.11)
+
+
0.095 310 3.
2
3
4
5
How accurate is this? The error is no larger than 0.000 000 167, so we can say with
absolute certainty that ln 1.1 is somewhere between 0.095 310 1 and 0.095 310 5.
Sometimes, we would like to approximate a certain quantity to a specified number
of decimal places.
Question What exactly does it mean to approximate a quantity to, say, 3 decimal
places.
Answer If we already know the exact value of the quantity, then we simply round it
to 3 decimal places. Notice that doing so may change the quantity by as much as
-4
0.000 5 = 510 . (For example, rounding 0.100 5 to 3 decimal places produces 0.101,
and so we have changed it by 0.000 5 .) This motivates the following definition:
Accuracy to n Decimal Places
If x is a quantity we want to approximate, and y is an approximation of x, then we say
that y approximates x to n decimal places if the magnitude of the difference is no
(n+1)
bigger than 510
; that is,
|y x| 510
(n+1)
Quick Examples
1. 0.12345 approximates 0.123454 to 5 decimal places because
-6
| 0.12345-0.123454 | = 0.000 004 0.000 005 = 0.510 .
2. 0.999 approximates 1.000 to 2 decimal places because
-3
| 0.999-1.000 | = 0.001 0.005 = 0.510 .
10
Taylor Polynomials
(n+1)
|f
(t)| =
n!
.
(n+1)!
As in the last example, we have a = 1 and x = 1.1, so the (n+1)st derivative is largest
when t = 1, giving M = n!. Thus,
Rn
n!(0.1)n+1 (0.1)n+1
(n+1)! = n+1 .
We want this error to be no larger than 0.510 -11, so we try a few numbers for n until
the above expression is 10-11 or smaller. After some trial and error we notice that
(0.1)9+1
-11
(9+1) = 10 ,
So, we need n = 9 in order to approximate ln 1.1 to 10 decimal places. That is,
2
0.1
0.1 0.1
0.1
0.1
0.1
0.1
0.1
ln 1.1 0.1 2 + 3 4 + 5 - 6 + 7 - 8 + 9
0.095 310 179 8
which is guaranteed to be accurate to the 10 decimal places shown.
Let us finish by giving the simple proof of Taylors Theorem. (You should turn back
several pages and look at what Taylors Theorem says.)
so that
x
f(x) = f(a) +
f'(t)dt
a
Now comes the clever part. We now use integration by parts in a strange way to
evaluate the integral.
11
Taylor Polynomials
D
f'(t)
I
1
- f''(t)
(t-x)
+ f'''(t)
(t-x)
2!
...
n1
(t-x)
(n1)!
...
n-1
(n)
(-1)
f (t)
(n+1)
(-1) f
(t-x)
n!
(t)
x
f'(t)(t-x)
2 x
3 x
(tx)
(tx)
n x
(n+1) (t)(tx)n
(n+1)
n
f (a)(xa)
(t)(xt)
f
+
+
dt
n!
n!
Here we have used many times the fact that (a-x)n = (x-a) n if n is even, but (a-x)n
= -(x-a)n if n is odd.
Taylor Series Exercises
In Exercises 114, find the 5th Taylor polynomials of the functions around the given
points.
1. f(x) = x3 + 2x2 - 3x + 1; a = 0
2. f(x) = x3 - x2 + 4x + 10; a = 0
3. f(x) = x3 + 2x2 - 3x + 1; a = 1
4. f(x) = x3 - x2 + 4x + 10; a = 1
12
Taylor Polynomials
5. f(x) = ln(1-x); a = 0
6. f(x) = ln(2-x); a = 0
7. f(x) = ex; a = 0
8. f(x) = e-x; a = 0
9. f(x) = e-x ; a = 0
11.
1
;x = 0
x-1
13. x ; x = 1
1
2; x = 0
(1-x)
14. x1/3; x = 1
1
; a = 1, approximate f(1.1)
x
1
18. f(x) = ; a = 1, approximate f(0.9)
x
19. f(x) =
20. f(x) =
21. How many terms of the Taylor series around x = 0 could you use to approximate
e to 3 decimal places?
22. How many terms of the Taylor series around x = 0 could you use to approximate
e to 4 decimal places?
23. To how many decimal places is the approximation
1
2
3
(1x) 1 x + x + x
in Example 4 accurate when x = 0.1?
24. To how many decimal places is the approximation
2
3
4
5
0.1
0.1 0.1
0.1
ln 1.1 0.1 2 + 3 4 + 5
Stefan Waner & Steven R. Costenoble 1992
13
Taylor Polynomials
in Example 7 accurate?
Applications
25. Investing The Amex Gold BUGS Index was at 150 points in January 2003,
2
decreasing at a rate of 14.5 points/month, and accelerating at 3.6 points/month .
Source: http://www.amex.com
(a) Taking t as time in months since January 2003, obtain the and second Taylor
polynomials of the BUGS index b as a function of t around t = 0.
(b) Use the second order Taylor polynomial to approximate the value of the index
in January 2004, and compare the predicted value with the (approximate) actual
value.
26. Investing The price of Consolidated Edison common stock (ED) was 40.5 at the
start of December 1, 2003, increasing at a rate of $3/month, and decelerating by
2
$1.10/month .
Source: http://money.excite.com
14
Taylor Polynomials
(a) Taking t as time in months since December 1 2003, obtain the and second
Taylor polynomials of the ED stock price p as a function of t around t = 0.
(b) Use the second order Taylor polynomial to approximate the ED stock price on
April 1 2004, and compare the predicted price with the (approximate) actual price.
Communication & Reasoning Exercises
27. The linear Taylor polynomial of f(x) around a is the equation of the tangent line to
the graph of f at a. Explain.
28. The quadratic Taylor polynomial of f(x) around a is the equation of the parabola
tangent to the graph of f at a with the same curvature as f at a. Explain.
29. An enthusiastic math student, having discovered that
2
3
(x-1)
(x-1)
ln x = x - 1 - 2 + 3 - ...
decides to save money by not buying the scientific feature on his new calculator,
figuring that all he has to do is to use this formula to calculate lnx. Being somewhat
lazy, he decides that the formula
2
(x-1)
ln x = x - 1 - 2
is probably accurate to three decimal places. Comment on this speculation.
30. Your friend tells you that the formula
2
(x-1)
ln x = x - 1 - 2
is definitely accurate to three decimal places provided x is close enough to 1. How
close?
15
Taylor Polynomials
16