9 Sequences and Series

9.10 Taylor Series

In Section 9.8, we showed how certain functions can be represented by a power series function. In Section 9.9, we showed how we can approximate functions with polynomials, given that enough derivative information is available. In this section we combine these concepts: if a function f(x) is infinitely differentiable, we show how to represent it with a power series function.

Definition 9.10.1      Taylor and Maclaurin Series

Let f(x) have derivatives of all orders at x=c.

  1. 1.

    The Taylor Series of f(x), centered at c is

    n=0f(n)(c)n!(x-c)n.
  2. 2.

    Setting c=0 gives the Maclaurin Series of f(x):

    n=0f(n)(0)n!xn.

The difference between a Taylor polynomial and a Taylor series is the former is a polynomial, containing only a finite number of terms, whereas the latter is a series, a summation of an infinite set of terms. When creating the Taylor polynomial of degree n for a function f(x) at x=c, we needed to evaluate f, and the first n derivatives of f, at x=c. When creating the Taylor series of f, we need to find a pattern that describes the nth derivative of f at x=c. We demonstrate this in the next two examples.

Example 9.10.1 The Maclaurin series of f(x)=cosx

Find the Maclaurin series of f(x)=cosx.

SolutionIn Example 9.9.4 we found the 8th degree Maclaurin polynomial of cosx. In doing so, we created the table shown in Figure 9.10.1. margin: f(x) =cosx f(0) =1 f(x) =-sinx f(0) =0 f′′(x) =-cosx f′′(0) =-1 f′′′(x) =sinx f′′′(0) =0 f(4)(x) =cosx f(4)(0) =1 f(5)(x) =-sinx f(5)(0) =0 f(6)(x) =-cosx f(6)(0) =-1 f(7)(x) =sinx f(7)(0) =0 f(8)(x) =cosx f(8)(0) =1 f(9)(x) =-sinx f(9)(0) =0 Figure 9.10.1: A table of the derivatives of f(x)=cosx evaluated at x=0. Notice how f(n)(0)=0 when n is odd, f(n)(0)=1 when n is divisible by 4, and f(n)(0)=-1 when n is even but not divisible by 4. Thus the Maclaurin series of cosx is

1-x22+x44!-x66!+x88!-

We can go further and write this as a summation. Since we only need the terms where the power of x is even, we write the power series in terms of x2n:

n=0(-1)nx2n(2n)!.
Example 9.10.2 The Taylor series of f(x)=lnx at x=1

Find the Taylor series of f(x)=lnx centered at x=1.

SolutionFigure 9.10.2 shows the nth derivative of lnx evaluated at x=1 for n=0,,5, along with an expression for the nth term:

f(n)(1)=(-1)n+1(n-1)!for n1.

Remember that this is what distinguishes Taylor series from Taylor polynomials; we are very interested in finding a pattern for the nth term, not just finding a finite set of coefficients for a polynomial. margin: f(x) =lnx f(1) =0 f(x) =1/x f(1) =1 f′′(x) =-1/x2 f′′(1) =-1 f′′′(x) =2/x3 f′′′(1) =2 f(4)(x) =-6/x4 f(4)(1) =-6 f(5)(x) =24/x5 f(5)(1) =24     f(n)(x) = f(n)(1) = (-1)n+1(n-1)!xn (-1)n+1(n-1)! Figure 9.10.2: Derivatives of lnx evaluated at x=1. Since f(1)=ln1=0, we skip the first term and start the summation with n=1, giving the Taylor series for lnx, centered at x=1, as

n=1(-1)n+1(n-1)!1n!(x-1)n=n=1(-1)n+1(x-1)nn.

It is important to note that Definition 9.10.1 defines a Taylor series given a function f(x); however, we cannot yet state that f(x) is equal to its Taylor series. We will find that “most of the time” they are equal, but we need to consider the conditions that allow us to conclude this.

Theorem 9.9.1 states that the error between a function f(x) and its nth-degree Taylor polynomial pn(x) is Rn(x), where

|Rn(x)|max|f(n+1)(z)|(n+1)!|x-c|n+1.

If Rn(x) goes to 0 for each x in an interval I as n approaches infinity, we conclude that the function is equal to its Taylor series expansion.

Theorem 9.10.1      Function and Taylor Series Equality

Let f(x) have derivatives of all orders at x=c, let Rn(x) be as stated in Theorem 9.9.1, and let I be an interval on which the Taylor series of f(x) converges. If limnRn(x)=0 for all x in I, then

f(x)=n=0f(n)(c)n!(x-c)n on I.

We demonstrate the use of this theorem in an example.

Example 9.10.3 Establishing equality of a function and its Taylor series

Show that f(x)=cosx is equal to its Maclaurin series, as found in Example 9.10.1, for all x.

SolutionGiven a value x, the magnitude of the error term Rn(x) is bounded by

|Rn(x)|max|f(n+1)(z)|(n+1)!|x|n+1.

Since all derivatives of cosx are ±sinx or ±cosx, whose magnitudes are bounded by 1, we can state

|Rn(x)|1(n+1)!|x|n+1

which implies

-|x|n+1(n+1)!Rn(x)|x|n+1(n+1)!. (9.10)

For any x, limnxn+1(n+1)!=0. Applying the Squeeze Theorem to Equation (9.10), we conclude that limnRn(x)=0 for all x, and hence

cosx=n=0(-1)nx2n(2n)!for all x.

It is natural to assume that a function is equal to its Taylor series on the series’ interval of convergence, but this is not the case. In order to properly establish equality, one must use Theorem 9.10.1. This is a bit disappointing, as we developed beautiful techniques for determining the interval of convergence of a power series, and proving that Rn(x)0 can be cumbersome as it deals with high order derivatives of the function.

There is good news. A function f(x) that is equal to its Taylor series, centered at any point the domain of f(x), is said to be an analytic function, and most, if not all, functions that we encounter within this course are analytic functions. Generally speaking, any function that one creates with elementary functions (polynomials, exponentials, trigonometric functions, etc.) that is not piecewise defined is probably analytic. For most functions, we assume the function is equal to its Taylor series on the series’ interval of convergence and only use Theorem 9.10.1 when we suspect something may not work as expected. The converse is also true: if a function is equal to some power series on an interval, then that power series is the Taylor series of the function.

We develop the Taylor series for one more important function, then give a table of the Taylor series for a number of common functions.

Example 9.10.4 The Binomial Series

Find the Maclaurin series of f(x)=(1+x)k, k0.

SolutionWhen k is a positive integer, the Maclaurin series is finite. For instance, when k=4, we have

f(x)=(1+x)4=1+4x+6x2+4x3+x4.

The coefficients of x when k is a positive integer are known as the binomial coefficients, giving the series we are developing its name.

When k=1/2, we have f(x)=1+x. Knowing a series representation of this function would give a useful way of approximating 1.3, for instance.

To develop the Maclaurin series for f(x)=(1+x)k for any value of k0, we consider the derivatives of f evaluated at x=0:

f(x) =(1+x)k f(0) =1
f(x) =k(1+x)k-1 f(0) =k
f′′(x) =k(k-1)(1+x)k-2 f′′(0) =k(k-1)
f′′′(x) =k(k-1)(k-2)(1+x)k-3 f′′′(0) =k(k-1)(k-2)
f(n)(x) =k(k-1)(k-(n-1))(1+x)k-n f(n)(0) =k(k-1)(k-(n-1))

Thus the Maclaurin series for f(x)=(1+x)k is

1+kx+k(k-1)2!x2+k(k-1)(k-2)3!x3++k(k-1)(k-(n-1))n!xn+

It is important to determine the interval of convergence of this series. With

an=k(k-1)(k-(n-1))n!xn,

we apply the Ratio Test:

limn|an+1||an| =limn|k(k-1)(k-n)(n+1)!xn+1||k(k-1)(k-(n-1))n!xn|
=limn|k-nn+1x|
=|x|.

The series converges absolutely when the limit of the Ratio Test is less than 1; therefore, we have absolute convergence when |x|<1.

While outside the scope of this text, the interval of convergence depends on the value of k. When k>0, the interval of convergence is [-1,1]. When -1<k<0, the interval of convergence is (-1,1]. If k-1, the interval of convergence is (-1,1).

We learned that Taylor polynomials offer a way of approximating a “difficult to compute” function with a polynomial. Taylor series offer a way of exactly representing a function with a series. One probably can see the use of a good approximation; is there any use of representing a function exactly as a series?

While we should not overlook the mathematical beauty of Taylor series (which is reason enough to study them), there are practical uses as well. They provide a valuable tool for solving a variety of problems, including problems relating to integration and differential equations.

In Key Idea 9.10.1 (on the following page) we give a table of the Maclaurin series of a number of common functions. We then give a theorem about the “algebra of power series,” that is, how we can combine power series to create power series of new functions. This allows us to find the Taylor series of functions like f(x)=excosx by knowing the Taylor series of ex and cosx.

Before we investigate combining functions, consider the Taylor series for the arctangent function (see Key Idea 9.10.1). Knowing that tan-1(1)=π/4, we can use this series to approximate the value of π:

π4 =tan-1(1)=1-13+15-17+19-
π =4(1-13+15-17+19-)

Unfortunately, this particular expansion of π converges very slowly. The first 100 terms approximate π as 3.13159, which is not particularly good.

Key Idea 9.10.1      Important Maclaurin Series Expansions
Function and Series First Few Terms

Interval of

Convergence

ex=n=0xnn! 1+x+x22!+x33!+ (-,)
sinx=n=0(-1)nx2n+1(2n+1)! x-x33!+x55!-x77!+ (-,)
cosx=n=0(-1)nx2n(2n)! 1-x22!+x44!-x66!+ (-,)
ln(x+1)=n=1(-1)n+1xnn x-x22+x33- (-1,1]
11-x=n=0xn 1+x+x2+x3+ (-1,1)
(1+x)k=n=0k(k-1)(k-(n-1))n!xn 1+kx+k(k-1)2!x2+ {(-1,1)k-1(-1,1]-1<k<0[-1,1]0<k
tan-1x=n=0(-1)nx2n+12n+1 x-x33+x55-x77+ [-1,1]
Theorem 9.10.2      Algebra of Power Series

Let f(x)=n=0anxn and g(x)=n=0bnxn converge absolutely for |x|<R, and let h(x) be continuous.

  1. 1.

    f(x)±g(x)=n=0(an±bn)xn  for |x|<R.

  2. 2.

    f(x)g(x)=(n=0anxn)(n=0bnxn)=  n=0(a0bn+a1bn-1++anb0)xn for |x|<R.

  3. 3.

    f(h(x))=n=0an(h(x))n  for |h(x)|<R.

Example 9.10.5 Combining Taylor series

Write out the first 3 terms of the Maclaurin Series for f(x)=excosx using Key Idea 9.10.1 and Theorem 9.10.2.

SolutionKey Idea 9.10.1 informs us that

ex=1+x+x22!+x33!+  and  cosx=1-x22!+x44!+.

Applying Theorem 9.10.2, we find that

excosx =(1+x+x22!+x33!+)(1-x22!+x44!+).
Distribute the right hand expression across the left:
=1(1-x22!+x44!+)+x(1-x22!+x44!+)
+x22!(1-x22!+x44!+)+x33!(1-x22!+x44!+)
+x44!(1-x22!+x44!+)+
Distribute again and collect like terms.
=1+x-x33-x46-x530+x7630+

While this process is a bit tedious, it is much faster than evaluating all the necessary derivatives of excosx and computing the Taylor series directly.

Because the series for ex and cosx both converge on (-,), so does the series expansion for excosx.

Example 9.10.6 Creating new Taylor series

Use Theorem 9.10.2 to create the Taylor series for y=sin(x2) centered at x=0 and a series for y=ln(x) centered at c=1.

SolutionGiven that

sinx=n=0(-1)nx2n+1(2n+1)!=x-x33!+x55!-x77!+,

we simply substitute x2 for x in the series, giving

sin(x2)=n=0(-1)n(x2)2n+1(2n+1)!=n=0(-1)nx4n+2(2n+1)!=x2-x63!+x105!-x147!.

Since the Taylor series for sinx has an infinite radius of convergence, so does the Taylor series for sin(x2).

The Taylor expansion for lnx given in Key Idea 9.10.1 is centered at x=1, so we will center the series for ln(x) at x=1 as well. With

lnx=n=1(-1)n+1(x-1)nn=(x-1)-(x-1)22+(x-1)33-,
margin: Note: In Example 9.10.6, one could create a series for ln(x) by simply recognizing that ln(x)=ln(x1/2)=1/2lnx, and hence multiplying the Taylor series for lnx by 1/2. This example was chosen to demonstrate other aspects of series, such as the fact that the interval of convergence changes.

we substitute x for x to obtain

ln(x)=n=1(-1)n+1(x-1)nn=(x-1)-(x-1)22+(x-1)33-.

While this is not strictly a power series because of the x, it is a series that allows us to study the function ln(x). Since the interval of convergence of lnx is (0,2], and the range of x on (0,4] is (0,2], the interval of convergence of this series expansion of ln(x) is (0,4].

Example 9.10.7 Using Taylor series to evaluate definite integrals

Use the Taylor series of e-x2 to evaluate 01e-x2𝑑x.

SolutionWe learned, when studying Numerical Integration, that e-x2 does not have an antiderivative expressible in terms of elementary functions. This means any definite integral of this function must have its value approximated, and not computed exactly.

We can quickly write out the Taylor series for e-x2 using the Taylor series of ex:

ex =n=0xnn!=1+x+x22!+x33!+
and so
e-x2 =n=0(-x2)nn!
=n=0(-1)nx2nn!
=1-x2+x42!-x63!+.

We use Theorem 9.8.3 to integrate:

e-x2𝑑x=C+x-x33+x552!-x773!++(-1)nx2n+1(2n+1)n!+

This is the antiderivative of e-x2; while we can write it out as a series, we cannot write it out in terms of elementary functions. We can evaluate the definite integral 01e-x2𝑑x using this antiderivative; substituting 1 and 0 for x and subtracting gives

01e-x2𝑑x=1-13+152!-173!+194!-.

Summing the 5 terms shown above gives the approximation of 0.74749. Since this is an alternating series, we can use the Alternating Series Approximation Theorem, (Theorem 9.5.3), to determine how accurate this approximation is. The next term of the series is 1/(115!)0.00075758. Thus we know our approximation is within 0.00075758 of the actual value of the integral. This is arguably much less work than using Simpson’s Rule to approximate the value of the integral.

Another advantage to using Taylor series instead of Simpson’s Rule is for making subsequent approximations. We found in Example 8.7.7 that the error in using Simpson’s Rule for 01e-x2𝑑x with four intervals was 0.00026. If we wanted to decrease that error, we would need to use more intervals, essentially starting the problem over. Using a Taylor series, if we wanted a more accurate approximation, we can just subtract the next term 1/(115!) to get an approximation of 0.7467, with an error of at most 1/(136!)0.0001.

Finding a pattern in the coefficients that match the series expansion of a known function, such as those shown in Key Idea 9.10.1, can be difficult. What if the coefficients are given in their reduced form; how could we still recover the function?

Suppose that all we know is that

a0=1,a1=2,a2=2,a3=43,a4=23.

Definition 9.10.1 states that each term of the Taylor expansion of a function includes an n!. This allows us to say that

a2=2=b22!,a3=43=b33!,anda4=23=b44!

for some values b2, b3 and b4. Solving for these values, we see that b2=4, b3=8 and b4=16. That is, we are recovering the pattern bn=2n, allowing us to write

f(x)=n=0anxn =n=0bnn!xn
=1+2x+42!x2+83!x3+164!x4+

From here it is easier to recognize that the series is describing an exponential function.

This chapter introduced sequences, which are ordered lists of numbers, followed by series, wherein we add up the terms of a sequence. We quickly saw that such sums do not always add up to “infinity,” but rather converge. We studied tests for convergence, then ended the chapter with a formal way of defining functions based on series. Such “series-defined functions” are a valuable tool in solving a number of different problems throughout science and engineering.

Coming in the next chapters are new ways of defining curves in the plane apart from using functions of the form y=f(x). Curves created by these new methods can be beautiful, useful, and important.

Exercises 9.10

 

Terms and Concepts

  1. 1.

    What is the difference between a Taylor polynomial and a Taylor series?

  2. 2.

    What theorem must we use to show that a function is equal to its Taylor series?

Problems

Key Idea 9.10.1 gives the nth term of the Taylor series of common functions. In Exercises 3–6, verify the formula given in the Key Idea by finding the first few terms of the Taylor series of the given function and identifying a pattern.

  1. 3.

    f(x)=ex; c=0

  2. 4.

    f(x)=sinx; c=0

  3. 5.

    f(x)=1/(1-x); c=0

  4. 6.

    f(x)=tan-1x; c=0

In Exercises 7–12, find a formula for the nth term of the Taylor series of f(x), centered at c, by finding the coefficients of the first few powers of x and looking for a pattern. (The formulas for several of these are found in Key Idea 9.10.1; show work verifying these formula.)

  1. 7.

    f(x)=cosx; c=π/2

  2. 8.

    f(x)=1/x; c=1

  3. 9.

    f(x)=e-x; c=0

  4. 10.

    f(x)=ln(1+x); c=0

  5. 11.

    f(x)=x/(x+1); c=1

  6. 12.

    f(x)=sinx; c=π/4

In Exercises 13–16, show that the Taylor series for f(x), as given in Key Idea 9.10.1, is equal to f(x) by applying Theorem 9.10.1; that is, show limnRn(x)=0.

  1. 13.

    f(x)=ex

  2. 14.

    f(x)=sinx

  3. 15.

    f(x)=ln(x+1) (show equality only on (0,1)).

  4. 16.

    f(x)=1/(1-x) (show equality only on (-1,0))

In Exercises 17–20, use the Taylor series given in Key Idea 9.10.1 to verify the given identity.

  1. 17.

    cos(-x)=cosx

  2. 18.

    sin(-x)=-sinx

  3. 19.

    ddx(sinx)=cosx

  4. 20.

    ddx(cosx)=-sinx

In Exercises 21–24, write out the first 5 terms of the Binomial series with the given k-value.

  1. 21.

    k=1/2

  2. 22.

    k=-1/2

  3. 23.

    k=1/3

  4. 24.

    k=4

In Exercises 25–30, use the Taylor series given in Key Idea 9.10.1 to create the Taylor series of the given functions.

  1. 25.

    f(x)=cos(x2)

  2. 26.

    f(x)=e-x

  3. 27.

    f(x)=sin(2x+3)

  4. 28.

    f(x)=tan-1(x/2)

  5. 29.

    f(x)=exsinx (only find the first non-zero 4 terms)

  6. 30.

    f(x)=(1+x)1/2cosx (only find the first non-zero 4 terms)

In Exercises 31–32, approximate the value of the given definite integral by using the first 4 nonzero terms of the integrand’s Taylor series.

  1. 31.

    0πsin(x2)𝑑x

  2. 32.

    0π2/4cos(x)𝑑x

Modern Campus CMS