160 4. SEQUENCES, SERIES, AND FUNCTION APPROXIMATION
Example 4.81 Find the Taylor expansion for s.x/ D cos.x/ using c D
2
.
Solution:
e Taylor formula needs the nth derivatives at
2
. Lets start by computing these num-
bers.
n s
.n/
.x/ s
.n/
2
0 cos.x/ 0
1 sin.x/ -1
2 cos.x/ 0
3 sin.x/ 1
4 cos.x/ 0
5 sin.x/ -1
Which is enough to notice the values repeat every four steps.
Plug these values into the Taylor expansion formula with c D =2 and we get:
cos.x/ D
.x =2/
C
.x =2/
3
.x =2/
5
C
.x =2/
7
cos.x/ D
1
X
nD0
.1/
nC1
.x =2/
2nC1
.2n C1/Š
˙
Notice that the expansion of cos.x/ with a center of c D
2
has the same form as the negative
of the Taylor expansion of
sin
.x/
at
c
D
0
. is is a fairly extreme way of proving the identity
cos.x/ D sin.x =2/
4.4.1 TAYLOR POLYNOMIALS
If we take the first n terms of a Taylor series for f .x/ the result is called the Taylor polynomial of
degree n for f .x/. Taylor polynomials are approximations to the function they are derived from
and, as we already know, polynomials are among the very nicest functions to work with.
4.4. TAYLOR SERIES 161
Example 4.82 Find a fifth-degree Taylor polynomial for f .x/ D sin.x/ centered at c D 0.
Solution:
Since the Taylor series for sin.x/ centered at c D 0 is
1
X
nD0
.1/
n
x
2nC1
.2n C1/Š
we need only extract the terms of degree five or less from the infinite series. is gives us a
solution of
p.x/ D x
x
3
6
C
x
5
120
˙
A natural question is “how good is this polynomial as an approximation to sin.x/?
Lets graph both functions on the same set of axes.
4-4
2
-2
(0,0)
p.x/ D x
x
3
6
C
x
5
120
f .x/ D sin.x/
In the range 2 x 2 the polynomial and the sine function agree really well after that they
diverge from one another and the polynomial shoots off to positive and negative infinity. Not
too surprisingly, the Taylor polynomial does a good job of approximating the function it was
drawn from near the center c for expansion. How do we figure out where the polynomial is a
good enough approximation?
If T .x/ is the Taylor series for a function f .x/ centered at c and T
n
.x/ is the nth degree Taylor
polynomial for that function, then we set R
n
.x/ D T .x/ T
n
.x/ to get the remainder for the
162 4. SEQUENCES, SERIES, AND FUNCTION APPROXIMATION
polynomial. Algebraically rearranging the terms:
T .x/ D T
n
.x/ C R
n
.x/
With this definition we can give Taylors inequality for the remainder of a power series.
Knowledge Box 4.25
Taylors Inequality
Suppose we are looking at a Taylor polynomial for the function f .x/ in the inter-
val jx aj d and that jf
.nC1/
.x/j M everywhere in this interval. en
for values of x in the interval we have that
jR
n
.x/j
M
.n C 1/Š
jx aj
nC1
:
It is not immediately obvious how to use this result, so lets do a couple examples.
Example 4.83 Find a bound on the error of approximation of T
5
.x/ for f .x/ D sin.x/ on the
interval 2 x 2. Note that this is the interval that looked good in the graph associated with
Example 4.82.
Solution:
We proceed by applying Taylors inequality. e derivative of sin.x/ are all sine and cosine
functions. is means that f
.nC1/
.x/ are always at most 1. So, we may set M D 1 for Taylors
inequality. e value of a is zero so jx aj 2 on the interval we are using.
Plugging these values into the formula for Taylors inequality we get:
jR
5
.x/j
1
2
6
D
64
720
Š 0:089
e error of T
5
.x/ on 2 x 2 is at most 0.089. Not bad.
Notice that Taylors inequality has .n C1/Š in the denominator. at means, if we use
T
7
.x/ D x
x
3
6
C
x
5
120
x
7
5040
4.4. TAYLOR SERIES 163
for f .x/ D sin.x/ on the interval 2 x 2, then the estimate of maximum error drops to
jR
7
.x/j
1
2
8
D
256
40320
Š 0:0063
e factorial in the denominator lets the error drop really quickly.
˙
e hard part of using Taylors inequality is finding the constant M . Standard practice is to
simply find the largest value of f
nC1
.x/ in the interval and live with it. e fact that both sine
and cosine are bounded in absolute value by 1 make them especially easy functions to work with.
Lets do an example with an exponential function.
Example 4.84 Suppose we are approximating f .x/ D e
x
in the interval 3 x 3 with
T
n
.x/. What value of n makes the Taylors inequality estimate of error at most 0.1?
Solution:
If f .x/ D e
x
then f
.nC1/
D e
x
, which is very convenient. We again have that a D 0. So, it is
pretty easy to see that
jf
.nC1/
.x/j e
3
everywhere on the interval. So, we set M D e
3
. e largest value of jx a j on the interval is 3,
so we need to find the smallest value of n that makes
e
3
.n C1/Š
3
nC1
< 0:1
e simplest way to do this is to tabulate.
n jR
n
.x/j j
e
3
.nC1/Š
3
nC1
j n jR
n
.x/j j
e
3
.nC1/Š
3
nC1
j
1 90.3849161543 6 8.7156883435
2 90.3849161543 7 3.2683831288
3 67.7886871158 8 1.0894610429
4 40.6732122695 9 0.3268383129
5 20.3366061347 10 0.0891377217
164 4. SEQUENCES, SERIES, AND FUNCTION APPROXIMATION
So the first value of n with an acceptable error is n D 10, and T
10
.x/ is good enough to
approximate f .x/ D e
x
in the range 3 x 3.
˙
e error estimates given by Taylors inequality are not the best possible they are actually fairly
conservative. ey usually over-estimate the error. If you take a course in numerical analysis
later in your career you may study methods for building better error estimates. ere is also a
lot of room to be clever with how you use Taylor polynomials. e sine and cosine function are
periodic, and so if you know their values even on a very small interval, like Œ0; =2, you can use
those values to deduce any other value.
PROBLEMS
Problem 4.85 Using the Taylor series formula, verify the formula for y D sin.x/.
Problem 4.86 Using the Taylor series formula, verify the formula for y D cos.x/.
Problem 4.87 Find the Taylor expansion of f .x/ D sin.x/ using a center of c D . Use the
formula for Taylor expansion.
Problem 4.88 Find the Taylor expansion of f .x/ D sin.x/ using a center of c D =2. Use the
formula for the Taylor expansion.
Problem 4.89 Using any method, find power series for the following functions.
1. f .x/ D e
x
2. g.x/ D xe
2x
3. h.x/ D cos 2x
4. r.x/ D sin.x
2
/
5. s.x/ D ln.x
4
/
6. q.x/ D .e
x
C e
x
/=2
7. a.x/ D tan
1
.3x/
8. b.x/ D
3x
2
1 x
4
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.235.210