Skip to main content

Section 8.5 Taylor Polynomials and Taylor Series

So far, each infinite series we have discussed has been a series of real numbers, such as

1+12+14+β‹―+12k+β‹―=βˆžβˆ‘k=012k.1+12+14+β‹―+12k+β‹―=βˆžβˆ‘k=012k.(8.5.1)

In the remainder of this chapter, we will include series that involve a variable. For instance, if in the geometric series in Equation (8.5.1) we replace the ratio r=12r=12 with the variable x,x, we have the infinite (still geometric) series

1+x+x2+β‹―+xk+β‹―=βˆžβˆ‘k=0xk.1+x+x2+β‹―+xk+β‹―=βˆžβˆ‘k=0xk.(8.5.2)

Here we see something very interesting: because a geometric series converges whenever its ratio rr satisfies |r|<1,|r|<1, and the sum of a convergent geometric series is a1βˆ’r,a1βˆ’r, we can say that for |x|<1,|x|<1,

1+x+x2+β‹―+xk+β‹―=11βˆ’x.1+x+x2+β‹―+xk+β‹―=11βˆ’x.(8.5.3)

Equation (8.5.3) states that the non-polynomial function 11βˆ’x11βˆ’x on the right is equal to the infinite polynomial expresssion on the left. Because the terms on the left get very small as kk gets large, we can truncate the series and say, for example, that

1+x+x2+x3β‰ˆ11βˆ’x1+x+x2+x3β‰ˆ11βˆ’x

for small values of x.x. This shows one way that a polynomial function can be used to approximate a non-polynomial function; such approximations are one of the main themes in this section and the next.

In Preview Activity 8.5.1, we begin our exploration of approximating functions with polynomials.

Preview Activity 8.5.1.

Preview Activity 8.3.1 showed how we can approximate the number ee using linear, quadratic, and other polynomial functions; we then used similar ideas in Preview Activity 8.4.1 to approximate ln(2).ln(2). In this activity, we review and extend the process to find the β€œbest” quadratic approximation to the exponential function exex around the origin. Let f(x)=exf(x)=ex throughout this activity.

  1. Find a formula for P1(x),P1(x), the linearization of f(x)f(x) at x=0.x=0. (We label this linearization P1P1 because it is a first degree polynomial approximation.) Recall that P1(x)P1(x) is a good approximation to f(x)f(x) for values of xx close to 0.0. Plot ff and P1P1 near x=0x=0 to illustrate this fact.

  2. Since f(x)=exf(x)=ex is not linear, the linear approximation eventually is not a very good one. To obtain better approximations, we want to develop a different approximation that β€œbends” to make it more closely fit the graph of ff near x=0.x=0. To do so, we add a quadratic term to P1(x).P1(x). In other words, we let

    P2(x)=P1(x)+c2x2P2(x)=P1(x)+c2x2

    for some real number c2.c2. We need to determine the value of c2c2 that makes the graph of P2(x)P2(x) best fit the graph of f(x)f(x) near x=0.x=0.

    Remember that P1(x)P1(x) was a good linear approximation to f(x)f(x) near 0;0; this is because P1(0)=f(0)P1(0)=f(0) and Pβ€²1(0)=fβ€²(0).Pβ€²1(0)=fβ€²(0). It is therefore reasonable to seek a value of c2c2 so that

    P2(0)=f(0),Pβ€²2(0)=fβ€²(0),and Pβ€³2(0)=fβ€³(0).P2(0)=f(0),Pβ€²2(0)=fβ€²(0),and Pβ€²β€²2(0)=fβ€²β€²(0).

    Remember, we are letting P2(x)=P1(x)+c2x2.

    1. Calculate P2(0) to show that P2(0)=f(0).

    2. Calculate Pβ€²2(0) to show that Pβ€²2(0)=fβ€²(0).

    3. Calculate Pβ€³2(x). Then find a value for c2 so that Pβ€³2(0)=fβ€³(0).

    4. Explain why the condition Pβ€³2(0)=fβ€³(0) will put an appropriate β€œbend” in the graph of P2 to make P2 fit the graph of f around x=0.

Solution
  1. We know that

    \begin{equation*} P_1(x) = f(0) + f'(0)x = 1+x\text{.} \end{equation*}

    Since \(P_1(0) = f(0) = 1\) and \(P'_1(0) = f'(0) = 1\text{,}\) the graphs of \(P_1\) and \(f\) agree at \(x=a\) and have the same slope at \(x=0\) (which means they go in the same direction at \(x=0\)). This is why \(P_1(x)\) is a good approximation to \(f(x)\) for values of \(x\) close to \(0\text{.}\)

    1. Since

      \begin{equation*} P_2(x) = P_1(x) + c_2(x)^2 = f(0) + f'(0)x + c_2x^2 \end{equation*}

      we have that

      \begin{equation*} P_2(0) = 1 = f(0) \end{equation*}

      as desired.

    2. A simple calculation shows \(P'_2(x) = P'1(x) + 2c_2x\text{.}\) So \(P'_2(0) = P'_1(0) = 1 = f'(0)\) as desired.

    3. A simple calculation shows \(P''_2(x) = 2c_2\text{.}\) So \(P''_2(0) = 2c_2\text{.}\) To have \(P''_2(0) = f''(0)\) we must have \(2c_2 = f''(0)\) or \(c_2 = \frac{f''(0)}{2} = \frac{1}{2}\text{.}\)

    4. The second derivative of a function tells us the concavity of the function. Concavity measures how the slopes of the tangent lines to the graph of the function are changing. This tells us how much bend there is in the graph. So if \(P''_2(0) = f''(0)\text{,}\) then \(P_2\) will have the same bend in it at \(x=0\) as \(f\) does. This will make the graph of \(P_2\) mold to the graph of \(f\) around \(x=0\text{.}\)

Subsection 8.5.1 Taylor Polynomials

Preview Activity 8.5.1 illustrates the first steps in the process of approximating functions with polynomials. Using this process we can approximate trigonometric, exponential, logarithmic, and other nonpolynomial functions as closely as we like (for certain values of x) with polynomials. This is extraordinarily useful in that it allows us to calculate values of these functions to whatever precision we like using only the operations of addition, subtraction, multiplication, and division, which can be easily programmed in a computer.

We next extend the approach in Preview Activity 8.5.1 to arbitrary functions at arbitrary points. Let f be a function that has as many derivatives as we need at a point x=a. Recall that P1(x) is the tangent line to f at (a,f(a)) and is given by the formula

P1(x)=f(a)+fβ€²(a)(xβˆ’a).

P1(x) is the linear approximation to f near a that has the same slope and function value as f at the point x=a.

We next want to find a quadratic approximation

P2(x)=P1(x)+c2(xβˆ’a)2

so that P2(x) more closely models f(x) near x=a. Consider the following calculations of the values and derivatives of P2(x):

P2(x)=P1(x)+c2(xβˆ’a)2P2(a)=P1(a)=f(a)Pβ€²2(x)=Pβ€²1(x)+2c2(xβˆ’a)Pβ€²2(a)=Pβ€²1(a)=fβ€²(a)Pβ€³2(x)=2c2Pβ€³2(a)=2c2.

To make P2(x) fit f(x) better than P1(x), we want P2(x) and f(x) to have the same concavity at x=a, in addition to having the same slope and function value. That is, we want to have

Pβ€³2(a)=fβ€³(a).

This implies that

2c2=fβ€³(a)

and thus

c2=fβ€³(a)2.

Therefore, the quadratic approximation P2(x) to f centered at x=a is

P2(x)=f(a)+fβ€²(a)(xβˆ’a)+fβ€³(a)2!(xβˆ’a)2.

This approach extends naturally to polynomials of higher degree. We define polynomials

P3(x)=P2(x)+c3(xβˆ’a)3,P4(x)=P3(x)+c4(xβˆ’a)4,P5(x)=P4(x)+c5(xβˆ’a)5,

and in general

Pn(x)=Pnβˆ’1(x)+cn(xβˆ’a)n.

The defining property of these polynomials is that for each n, Pn(x) and all its first n derivatives must agree with those of f at x=a. In other words we require that

P(k)n(a)=f(k)(a)

for all k from 0 to n.

To see the conditions under which this happens, suppose

Pn(x)=c0+c1(xβˆ’a)+c2(xβˆ’a)2+β‹―+cn(xβˆ’a)n.

Then

P(0)n(a)=c0P(1)n(a)=c1P(2)n(a)=2c2P(3)n(a)=(2)(3)c3P(4)n(a)=(2)(3)(4)c4P(5)n(a)=(2)(3)(4)(5)c5

and, in general,

P(k)n(a)=(2)(3)(4)β‹―(kβˆ’1)(k)ck=k!ck.

So having P(k)n(a)=f(k)(a) means that k!ck=f(k)(a) and therefore

ck=f(k)(a)k!

for each value of k. Using this expression for ck, we have found the formula for the polynomial approximation of f that we seek. Such a polynomial is called a Taylor polynomial.

Taylor Polynomials.

The nth order Taylor polynomial of f centered at x=a is given by

Pn(x)=(f(a)+fβ€²(a)(xβˆ’a)+fβ€³(a)2!(xβˆ’a)2+β‹―+f(n)(a)n!(xβˆ’a)n=(nβˆ‘k=0f(k)(a)k!(xβˆ’a)k.

This degree n polynomial approximates f(x) near x=a and has the property that P(k)n(a)=f(k)(a) for k=0,1,…,n.

Determine the third order Taylor polynomial for \(f(x) = e^x\text{,}\) as well as the general \(n\)th order Taylor polynomial for \(f\) centered at \(x=0\text{.}\)

Solution

We know that \(f'(x) = e^x\) and so \(f''(x) = e^x\) and \(f'''(x) = e^x\text{.}\) Thus,

\begin{equation*} f(0) = f'(0) = f''(0) = f'''(0) = 1\text{.} \end{equation*}

So the third order Taylor polynomial of \(f(x) = e^x\) centered at \(x=0\) is

\begin{align*} P_3(x) \amp = f(0) + f'(0)(x-0) + \frac{f''(0)}{2!}(x-0)^2 + \frac{f'''(0)}{3!}(x-0)^3\\ \amp = 1 + x + \frac{x^2}{2} + \frac{x^3}{6}\text{.} \end{align*}

In general, for the exponential function \(f\) we have \(f^{(k)}(x) = e^x\) for every positive integer \(k\text{.}\) Thus, the \(k\)th term in the \(n\)th order Taylor polynomial for \(f(x)\) centered at \(x=0\) is

\begin{equation*} \frac{f^{(k)}(0)}{k!}(x-0)^k = \frac{1}{k!}x^k\text{.} \end{equation*}

Therefore, the \(n\)th order Taylor polynomial for \(f(x) = e^x\) centered at \(x=0\) is

\begin{equation*} P_n(x) = 1+x+\frac{x^2}{2!} + \cdots + \frac{1}{n!}x^n = \sum_{k=0}^n \frac{x^k}{k!}\text{.} \end{equation*}
Activity 8.5.2.

We have just seen that the nth order Taylor polynomial centered at a=0 for the exponential function ex is

nβˆ‘k=0xkk!.

In this activity, we determine small order Taylor polynomials for several other familiar functions, and look for general patterns.

  1. Let f(x)=11βˆ’x.

    1. Calculate the first four derivatives of f(x) at x=0. Then find the fourth order Taylor polynomial P4(x) for 11βˆ’x centered at 0.

    2. Based on your results from part (i), determine a general formula for f(k)(0).

  2. Let f(x)=cos(x).

    1. Calculate the first four derivatives of f(x) at x=0. Then find the fourth order Taylor polynomial P4(x) for cos(x) centered at 0.

    2. Based on your results from part (i), find a general formula for f(k)(0). (Think about how k being even or odd affects the value of the kth derivative.)

  3. Let f(x)=sin(x).

    1. Calculate the first four derivatives of f(x) at x=0. Then find the fourth order Taylor polynomial P4(x) for sin(x) centered at 0.

    2. Based on your results from part (i), find a general formula for f(k)(0). (Think about how k being even or odd affects the value of the kth derivative.)

Hint
  1. Small hints for each of the prompts above.

Answer
    1. \(f^{k}(0) = 0 \text{ if } k \text{ is odd, and } f^{2k}(0) = (-1)^k \text{.}\)

    2. \(P_n(x) = 1 - \frac{x^2}{2} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots + (-1)^{n/2}\frac{x^n}{n!}\) if \(n\) is even and \(P_n(x) = 1 - \frac{x^2}{2} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots + (-1)^{(n-1)/2}\frac{x^(n-1)}{(n-1)!}\) if \(n\) is odd.

    1. \(f^{k}(0) = 0 \text{ if } k \text{ is even } \ \ \ \text{ and } \ \ \ f^{2k+1}(0) = (-1)^k \text{.}\)

    2. \(P_n(x) = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots + (-1)^{(n-1)/2}\frac{x^n}{n!}\) if \(n\) is odd and \(P_n(x) = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots + (-1)^{n/2+1}\frac{x^{n-1}}{(n-1)!}\) if \(n\) is even.

    1. \(f^{(k)}(0) = k! \text{.}\)

    2. \begin{equation*} P_n(x) = \sum_{k=0}^n x^k\text{.} \end{equation*}
Solution
    1. The first four derivatives of \(f(x)\) at \(x=0\) are

      \begin{align*} f(x) \amp = \cos(x) \amp f(0) \amp = 1\\ f'(x) \amp = -\sin(x) \amp f'(0) \amp = 0\\ f''(x) \amp = -\cos(x) \amp f''(0) \amp = -1\\ f^{(3)}(x) \amp = \sin(x) \amp f^{(3)}(0) \amp = 0\\ f^{(4)}(x) \amp = \cos(x) \amp f^{(4)}(0) \amp = 1\text{.} \end{align*}

      It appears that the odd derivatives of \(f(x)\) are all plus or minus \(\sin(x)\) and so have values of 0 at \(x=0\) and the even derivatives are \(\pm \cos(x)\) and have alternating values of 1 and \(-1\) at \(x-0\text{.}\) Since the even numbers can be represented in the form \(2k\) where \(k\) is an integer we have

      \begin{equation*} f^{k}(0) = 0 \text{ if } k \text{ is odd, and } f^{2k}(0) = (-1)^k\text{.} \end{equation*}
    2. Based on the previous part of this problem the \(n\)th order Taylor polynomial for \(\cos(x)\) is

      \begin{equation*} 1 - \frac{x^2}{2} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots + (-1)^{n/2}\frac{x^n}{n!} \end{equation*}

      if \(n\) is even and

      \begin{equation*} 1 - \frac{x^2}{2} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots + (-1)^{(n-1)/2}\frac{x^(n-1)}{(n-1)!} \end{equation*}

      if \(n\) is odd.

    1. The first four derivatives of \(f(x)\) at \(x=0\) are

      \begin{align*} f(x) \amp = \sin(x) \amp f(0) \amp = 0\\ f'(x) \amp = \cos(x) \amp f'(0) \amp = 1\\ f''(x) \amp = -\sin(x) \amp f''(0) \amp = 0\\ f^{(3)}(x) \amp = -\cos(x) \amp f^{(3)}(0) \amp = -1\\ f^{(4)}(x) \amp = \sin(x) \amp f^{(4)}(0) \amp = 0\text{.} \end{align*}

      It appears that the even derivatives of \(f(x)\) are all plus or minus \(\sin(x)\) and so have values of 0 at \(x=0\) and the odd derivatives are \(\pm \cos(x)\) and have alternating values of 1 and \(-1\) at \(x-0\text{.}\) Since the odd numbers can be represented in the form \(2k+1\) where \(k\) is an integer we have

      \begin{equation*} f^{k}(0) = 0 \text{ if } k \text{ is even } \ \ \ \text{ and } \ \ \ f^{2k+1}(0) = (-1)^k\text{.} \end{equation*}
    2. Based on the previous part of this problem the \(n\)th order Taylor polynomial for \(\sin(x)\) is

      \begin{equation*} x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots + (-1)^{(n-1)/2}\frac{x^n}{n!} \end{equation*}

      if \(n\) is odd and

      \begin{equation*} x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots + (-1)^{n/2+1}\frac{x^{n-1}}{(n-1)!} \end{equation*}

      if \(n\) is even.

    1. The first four derivatives of \(f(x)\) at \(x=0\) are

      \begin{align*} f(x) \amp = \frac{1}{1-x} \amp f(0) \amp = 1\\ f'(x) \amp = \frac{1}{(1-x)^2} \amp f'(0) \amp = 1\\ f''(x) \amp = \frac{2}{(1-x)^3} \amp f''(0) \amp = 2\\ f^{(3)}(x) \amp = \frac{3!}{(1-x)^4} \amp f^{(3)}(0) \amp = 3!\\ f^{(4)}(x) \amp = \frac{4!}{(1-x)^5} \amp f^{(4)}(0) \amp = 4!\text{.} \end{align*}

      It appears that the pattern is

      \begin{equation*} f^{(k)}(0) = k!\text{.} \end{equation*}
    2. The \(n\)th order Taylor polynomial for \(f\) at \(x=0\) is

      \begin{equation*} \sum_{k=0}^n \frac{f^{(k)}}{k!} x^k = \sum_{k=0}^n \frac{k!}{k!} x^k = \sum_{k=0}^n x^k\text{.} \end{equation*}

      This makes sense since \(f(x)\) is the sum of the geometric series with ratio \(x\text{,}\) so the \(n\)th order Taylor polynomial should just be the \(n\)th partial sum of this geometric series.

It is possible that an nth order Taylor polynomial is not a polynomial of degree n; that is, the order of the approximation can be different from the degree of the polynomial. For example, in Activity 8.5.3 we found that the second order Taylor polynomial P2(x) centered at 0 for sin(x) is P2(x)=x. In this case, the second order Taylor polynomial is a degree 1 polynomial.

Subsection 8.5.2 Taylor Series

In Activity 8.5.2 we saw that the fourth order Taylor polynomial P4(x) for sin(x) centered at 0 is

P4(x)=xβˆ’x33!.

The pattern we found for the derivatives f(k)(0) describe the higher-order Taylor polynomials, e.g.,

P5(x)=xβˆ’x33!+x(5)5!,P7(x)=xβˆ’x33!+x(5)5!βˆ’x(7)7!,P9(x)=xβˆ’x33!+x(5)5!βˆ’x(7)7!+x(9)9!,

and so on. It is instructive to consider the graphical behavior of these functions; Figure 8.5.2 shows the graphs of a few of the Taylor polynomials centered at 0 for the sine function.

Figure 8.5.2. The order 1, 5, 7, and 9 Taylor polynomials centered at x=0 for f(x)=sin(x).

Notice that P1(x) is close to the sine function only for values of x that are close to 0, but as we increase the degree of the Taylor polynomial the Taylor polynomials provide a better fit to the graph of the sine function over larger intervals. This illustrates the general behavior of Taylor polynomials: for any sufficiently well-behaved function, the sequence {Pn(x)} of Taylor polynomials converges to the function f on larger and larger intervals (though those intervals may not necessarily increase without bound). If the Taylor polynomials ultimately converge to f on its entire domain, we write

f(x)=βˆžβˆ‘k=0f(k)(a)k!(xβˆ’a)k.
Definition 8.5.3.

Let f be a function all of whose derivatives exist at x=a. The Taylor series for f centered at x=a is the series Tf(x) defined by

Tf(x)=βˆžβˆ‘k=0f(k)(a)k!(xβˆ’a)k.

In the special case where a=0 in Definition 8.5.3, the Taylor series is also called the Maclaurin series for f. From Example 8.5.1 we know the nth order Taylor polynomial centered at 0 for the exponential function ex; thus, the Maclaurin series for ex is

βˆžβˆ‘k=0xkk!.
Activity 8.5.3.

In Activity 8.5.2 we determined small order Taylor polynomials for a few familiar functions, and also found general patterns in the derivatives evaluated at 0. Use that information to write the Taylor series centered at 0 for the following functions.

  1. f(x)=11βˆ’x

  2. f(x)=cos(x) (You will need to carefully consider how to indicate that many of the coefficients are 0. Think about a general way to represent an even integer.)

  3. f(x)=sin(x) (You will need to carefully consider how to indicate that many of the coefficients are 0. Think about a general way to represent an odd integer.)

  4. Determine the n order Taylor polynomial for f(x)=11βˆ’x centered at x=0.

Hint
  1. Small hints for each of the prompts above.

Answer
  1. \(P(x) = 1 + x + x^2 + x^3 + \cdots + x^n + \cdots\)

  2. \(P(x) = 1 - \frac{1}{2!}x^2 + \frac{1}{4!}x^4 - \cdots + (-1)^{n}\frac{1}{(2n)!}x^{2n} + \cdots \text{.}\)

  3. \(P(x) = x - \frac{1}{3!}x^3 + \frac{1}{5!}x^5 - \cdots + (-1)^{n}\frac{1}{(2n+1)!}x^{2n+1} + \cdots \text{.}\)

  4. \(P_n(x) = 1 + x + x^2 + x^3 + \cdots + x^n\)

Solution
  1. For \(f(x) = \frac{1}{1-x}\text{,}\) its Taylor series is

    \begin{equation*} P(x) = 1 + x + x^2 + x^3 + \cdots + x^n + \cdots \end{equation*}
  2. For \(f(x) = \cos(x)\text{,}\) its Taylor series is

    \begin{equation*} P(x) = 1 - \frac{1}{2!}x^2 + \frac{1}{4!}x^4 - \cdots + (-1)^{n}\frac{1}{(2n)!}x^{2n} + \cdots\text{.} \end{equation*}
  3. For \(f(x) = \sin(x)\text{,}\) its Taylor series is

    \begin{equation*} P(x) = x - \frac{1}{3!}x^3 + \frac{1}{5!}x^5 - \cdots + (-1)^{n}\frac{1}{(2n+1)!}x^{2n+1} + \cdots\text{.} \end{equation*}
  4. For \(f(x) = \frac{1}{1-x}\text{,}\)

    \begin{equation*} P_n(x) = 1 + x + x^2 + x^3 + \cdots + x^n \end{equation*}
Activity 8.5.4.
  1. Plot the graphs of several of the Taylor polynomials centered at 0 (of order at least 5) for ex and convince yourself that these Taylor polynomials converge to ex for every value of x.

  2. Draw the graphs of several of the Taylor polynomials centered at 0 (of order at least 6) for cos(x) and convince yourself that these Taylor polynomials converge to cos(x) for every value of x. Write the Taylor series centered at 0 for cos(x).

  3. Draw the graphs of several of the Taylor polynomials centered at 0 for 11βˆ’x. Based on your graphs, for what values of x do these Taylor polynomials appear to converge to 11βˆ’x? How is this situation different from what we observe with ex and cos(x)? In addition, write the Taylor series centered at 0 for 11βˆ’x.

Hint
  1. Small hints for each of the prompts above.

Answer
  1. It appears that as we increase the order of the Taylor polynomials, they fit the graph of \(f\) better and better over larger intervals.

  2. It appears that as we increase the order of the Taylor polynomials, they fit the graph of \(f\) better and better over larger intervals.

  3. The Taylor polynomials converge to \(\frac{1}{1-x}\) only on the interval \((-1,1)\text{.}\)

Solution
  1. The graphs of the 10th (magenta), 20th (blue), and 30th (green) Taylor polynomials centered at \(0\) for \(e^x\) are shown below along with the graph of \(f(x)\) in red:

    It appears that as we increase the order of the Taylor polynomials, they fit the graph of \(f\) better and better over larger intervals. So it looks like the Taylor polynomials converge to \(e^x\) for every value of \(x\text{.}\)

  2. The graphs of the 10th (magenta), 20th (blue), and 30th (green) Taylor polynomials centered at \(0\) for \(\cos(x)\) are shown below along with the graph of \(f(x)\) in red:

    It appears that as we increase the order of the Taylor polynomials, they fit the graph of \(f\) better and better over larger intervals. So it looks like the Taylor polynomials converge to \(\cos(x)\) for every value of \(x\text{.}\) Based on the \(n\)th order Taylor polynomials we found earlier for \(\cos(x)\text{,}\) the Taylor series for \(f(x)\) centered at \(0\) is

    \begin{equation*} \sum_{k=0}^{\infty} \frac{x^{2k}}{(2k)!}\text{.} \end{equation*}
  3. The graphs of the 10th (magenta), 20th (blue), and 30th (green) Taylor polynomials centered at \(0\) for \(\frac{1}{1-x}\) are shown below along with the graph of \(f(x)\) in red:

    It appears that as we increase the order of the Taylor polynomials, they only fit the graph of \(f\) better and better over the interval \((-1,1)\) and appear to diverge outside that interval. So it looks like the Taylor polynomials converge to \(\frac{1}{1-x}\) only on the interval \((-1,1)\text{.}\)

    Based on the \(n\)th order Taylor polynomials we found earlier for \(\frac{1}{1-x}\text{,}\) the Taylor series for \(f(x)\) centered at \(0\) is

    \begin{equation*} \sum_{k=0}^{\infty} x^k\text{.} \end{equation*}

The Maclaurin series for ex, sin(x), cos(x), and 11βˆ’x will be used frequently, so we should be certain to know and recognize them well.

Subsection 8.5.3 The Interval of Convergence of a Taylor Series

In the previous section (in Figure 8.5.2 and Activity 8.5.4) we observed that the Taylor polynomials centered at 0 for ex, cos(x), and sin(x) converged to these functions for all values of x in their domain, but that the Taylor polynomials centered at 0 for 11βˆ’x converge to 11βˆ’x on the interval (βˆ’1,1) and diverge for all other values of x. So the Taylor series for a function f(x) does not need to converge for all values of x in the domain of f.

Our observations suggest two natural questions: can we determine the values of x for which a given Taylor series converges? And does the Taylor series for a function f actually converge to f(x)?

Graphical evidence suggests that the Taylor series centered at \(0\) for \(e^x\) converges for all values of \(x\text{.}\) To verify this, use the Ratio Test to determine all values of \(x\) for which the Taylor series

\begin{equation} \sum_{k=0}^{\infty} \frac{x^k}{k!}\label{yUl}\tag{8.5.4} \end{equation}

converges absolutely.

Solution

Recall that the Ratio Test applies only to series of nonnegative terms. In this example, the variable \(x\) may have negative values. But we are interested in absolute convergence, so we apply the Ratio Test to the series

\begin{equation*} \sum_{k=0}^{\infty} \left| \frac{x^k}{k!} \right| = \sum_{k=0}^{\infty} \frac{| x |^k}{k!}\text{.} \end{equation*}

Now, observe that

\begin{align*} \lim_{k \to \infty} \frac{a_{k+1}}{a_k} \amp = \lim_{k \to \infty} \frac{\frac{| x |^{k+1}}{(k+1)!} }{ \frac{| x |^k}{k} }\\ \amp = \lim_{k \to \infty} \frac{| x |^{k+1}k!}{ | x |^{k}(k+1)! }\\ \amp = \lim_{k \to \infty} \frac{| x |}{k+1}\\ \amp = 0 \end{align*}

for any value of \(x\text{.}\) So the Taylor series (8.5.4) converges absolutely for every value of \(x\text{,}\) and thus converges for every value of \(x\text{.}\)

One question still remains: while the Taylor series for ex converges for all x, what we have done does not tell us that this Taylor series actually converges to ex for each x. We'll return to this question when we consider the error in a Taylor approximation near the end of this section.

We can apply the main idea from Example 8.5.4 in general. To determine the values of x for which a Taylor series

βˆžβˆ‘k=0ck(xβˆ’a)k,

centered at x=a will converge, we apply the Ratio Test with ak=|ck(xβˆ’a)k|. The series converges if limkβ†’βˆžak+1ak<1.

Observe that

ak+1ak=|xβˆ’a||ck+1||ck|,

so when we apply the Ratio Test, we get

limkβ†’βˆžak+1ak=limkβ†’βˆž|xβˆ’a||ck+1||ck|.

Note suppose that

limkβ†’βˆž|ck+1||ck|=L,

so that

limkβ†’βˆžak+1ak=|xβˆ’a|β‹…L.

There are three possibilities for L: L can be 0, it can be a finite positive value, or it can be infinite. Based on this value of L, we can determine for which values of x the original Taylor series converges.

  • If L=0, then the Taylor series converges on (βˆ’βˆž,∞).

  • If L is infinite, then the Taylor series converges only at x=a.

  • If L is finite and nonzero, then the Taylor series converges absolutely for all x that satisfy

    |xβˆ’a|β‹…L<1

    or for all x such that

    |xβˆ’a|<1L,

    which is the interval

    (aβˆ’1L,a+1L).

    Because the Ratio Test is inconclusive when the |xβˆ’a|β‹…L=1, the endpoints aΒ±1L have to be checked separately.

It is important to notice that the set of x values at which a Taylor series converges is always an interval centered at x=a. For this reason, the set on which a Taylor series converges is called the interval of convergence. Half the length of the interval of convergence is called the radius of convergence. If the interval of convergence of a Taylor series is infinite, then we say that the radius of convergence is infinite.

Activity 8.5.5.
  1. Use the Ratio Test to explicitly determine the interval of convergence of the Taylor series for f(x)=11βˆ’x centered at x=0.

  2. Use the Ratio Test to explicitly determine the interval of convergence of the Taylor series for f(x)=cos(x) centered at x=0.

  3. Use the Ratio Test to explicitly determine the interval of convergence of the Taylor series for f(x)=sin(x) centered at x=0.

Hint
  1. Small hints for each of the prompts above.

Answer
  1. \((-\infty, \infty)\text{.}\)

  2. \((-\infty, \infty)\text{.}\)

  3. The interval \((-1,1)\text{.}\)

Solution
  1. Using the Ratio Test with the \(k\)th term \(\frac{|x|^{2k}}{(2k)!}\) we get

    \begin{align*} \lim_{k \to \infty} \frac{ \frac{|x|^{2(k+1)}}{(2(k+1))!} }{ \frac{|x|^{2k}}{(2k)!} } \amp = \lim_{k \to \infty} \frac{|x|^{2(k+1)}(2k)!}{|x|^{2k}(2(k+1))!}\\ \amp = \lim_{k \to \infty} \frac{|x|^{2}}{(2k+2)(2k+1)}\\ \amp = 0\text{.} \end{align*}

    So the interval of convergence of the Taylor series for \(f(x) = \cos(x)\) centered at \(x=0\) is \((-\infty, \infty)\text{.}\)

  2. Using the Ratio Test with the \(k\)th term \(\frac{|x|^{2k+1}}{(2k+1)!}\) we get

    \begin{align*} \lim_{k \to \infty} \frac{ \frac{|x|^{2(k+1)+1}}{(2(k+1)+1)!} }{ \frac{|x|^{2k+1}}{(2k+1)!} } \amp = \lim_{k \to \infty} \frac{|x|^{2(k+1)+1}(2k+1)!}{|x|^{2k+1}(2(k+1)+1)!}\\ \amp = \lim_{k \to \infty} \frac{|x|^{2}}{(2k+3)(2k+2)}\\ \amp = 0\text{.} \end{align*}

    So the interval of convergence of the Taylor series for \(f(x) = \sin(x)\) centered at \(x=0\) is \((-\infty, \infty)\text{.}\)

  3. Using the Ratio Test with the \(k\)th term \(|x|^{k}\) we get

    \begin{equation*} \lim_{k \to \infty} \frac{ |x|^{k+1} }{ |x|^{k} } = \lim_{k \to \infty} |x| = |x|\text{,} \end{equation*}

    So the series \(\sum_{k=0}^{\infty} x^k\) converges absolutely when \(|x| \lt 1\) or for \(-1 \lt x \lt 1\) and diverges when \(|x| \gt 1\text{.}\) Since the Ratio Test doesn't tell us what happens when \(x=1\text{,}\) we need to check the endpoints separately.

    • When \(x=1\) we have the series \(\sum_{k=0}^{\infty} 1\) which diverges since \(\lim_{k \to \infty} 1 \neq 0\text{.}\)

    • When \(x=-1\) we have the series \(\sum_{k=0}^{\infty} (-1)^k\) which diverges since \(\lim_{k \to \infty} (-1)^k\) does not exist.

    Therefore, the interval of convergence of the Taylor series for \(f(x) = \frac{1}{1-x}\) centered at \(x=0\) is \((-1,1)\text{.}\)

The Ratio Test allows us to determine the set of x values for which a Taylor series converges absolutely. However, just because a Taylor series for a function f converges, we cannot be certain that the Taylor series actually converges to f(x). To show why and where a Taylor series does in fact converge to the function f, we next consider the error that is present in Taylor polynomials.

Subsection 8.5.4 Error Approximations for Taylor Polynomials

We now know how to find Taylor polynomials for functions such as sin(x), and how to determine the interval of convergence of the corresponding Taylor series. We next develop an error bound that will tell us how well an nth order Taylor polynomial Pn(x) approximates its generating function f(x). This error bound will also allow us to determine whether a Taylor series on its interval of convergence actually equals the function f from which the Taylor series is derived. Finally, we will be able to use the error bound to determine the order of the Taylor polynomial Pn(x) that we will ensure that Pn(x) approximates f(x) to the desired degree of accuracy.

For this argument, we assume throughout that we center our approximations at 0 (but a similar argument holds for approximations centered at a). We define the exact error, En(x), that results from approximating f(x) with Pn(x) by

En(x)=f(x)βˆ’Pn(x).

We are particularly interested in |En(x)|, the distance between Pn and f. Because

P(k)n(0)=f(k)(0)

for 0≀k≀n, we know that

E(k)n(0)=0

for 0≀k≀n. Furthermore, since Pn(x) is a polynomial of degree less than or equal to n, we know that

P(n+1)n(x)=0.

Thus, since E(n+1)n(x)=f(n+1)(x)βˆ’P(n+1)n(x), it follows that

E(n+1)n(x)=f(n+1)(x)

for all x.

Suppose that we want to approximate f(x) at a number c close to 0 using Pn(c). If we assume |f(n+1)(t)| is bounded by some number M on [0,c], so that

|f(n+1)(t)|≀M

for all 0≀t≀c, then we can say that

|E(n+1)n(t)|=|f(n+1)(t)|≀M

for all t between 0 and c. Equivalently,

βˆ’M≀E(n+1)n(t)≀M

on [0,c]. Next, we integrate the three terms in Inequality (8.5.5) from t=0 to t=x, and thus find that

∫x0βˆ’M dtβ‰€βˆ«x0E(n+1)n(t) dtβ‰€βˆ«x0M dt

for every value of x in [0,c]. Since E(n)n(0)=0, the First FTC tells us that

βˆ’Mx≀E(n)n(x)≀Mx

for every x in [0,c].

Integrating this last inequality, we obtain

∫x0βˆ’Mt dtβ‰€βˆ«x0E(n)n(t) dtβ‰€βˆ«x0Mt dt

and thus

βˆ’Mx22≀E(nβˆ’1)n(x)≀Mx22

for all x in [0,c].

Integrating n times, we arrive at

βˆ’Mxn+1(n+1)!≀En(x)≀Mxn+1(n+1)!

for all x in [0,c]. This enables us to conclude that

|En(x)|≀M|x|n+1(n+1)!

for all x in [0,c], and we have found a bound on the approximation's error, En.

Our work above was based on the approximation centered at a=0; the argument may be generalized to hold for any value of a, which results in the following theorem.

The Lagrange Error Bound for Pn(x).

Let f be a continuous function with n+1 continuous derivatives. Suppose that M is a positive real number such that |f(n+1)(x)|≀M on the interval [a,c]. If Pn(x) is the nth order Taylor polynomial for f(x) centered at x=a, then

|Pn(c)βˆ’f(c)|≀M|cβˆ’a|n+1(n+1)!.

We can use this error bound to tell us important information about Taylor polynomials and Taylor series, as we see in the following examples and activities.

Determine how well the 10th order Taylor polynomial \(P_{10}(x)\) for \(\sin(x)\text{,}\) centered at \(0\text{,}\) approximates \(\sin(2)\text{.}\)

Solution

To answer this question we use \(f(x) = \sin(x)\text{,}\) \(c = 2\text{,}\) \(a=0\text{,}\) and \(n = 10\) in the Lagrange error bound formula. We also need to find an appropriate value for \(M\text{.}\) Note that the derivatives of \(f(x) = \sin(x)\) are all equal to \(\pm \sin(x)\) or \(\pm \cos(x)\text{.}\) Thus,

\begin{equation*} \left| f^{(n+1)}(x) \right| \leq 1 \end{equation*}

for any \(n\) and \(x\text{.}\) Therefore, we can choose \(M\) to be \(1\text{.}\) Then

\begin{equation*} \left|P_{10}(2) - f(2)\right| \leq (1)\frac{|2-0|^{11}}{(11)!} = \frac{2^{11}}{(11)!} \approx 0.00005130671797\text{.} \end{equation*}

So \(P_{10}(2)\) approximates \(\sin(2)\) to within at most \(0.00005130671797\text{.}\) A computer algebra system tells us that

\begin{equation*} P_{10}(2) \approx 0.9093474427 \ \ \text{ and } \ \ \sin(2) \approx 0.9092974268 \end{equation*}

with an actual difference of about \(0.0000500159\text{.}\)

Activity 8.5.6.

Let Pn(x) be the nth order Taylor polynomial for sin(x) centered at x=0. Determine how large we need to choose n so that Pn(2) approximates sin(2) to 20 decimal places.

Hint

Small hints for each of the prompts above.

Answer

\(n \ge 27\text{.}\)

Solution

In this example, if we can find a value of \(n\) so that

\begin{equation*} M\frac{|2-0|^{n+1}}{(n+1)!} \lt 10^{-20} \end{equation*}

then we will have

\begin{equation*} |P_n(2) - f(2)| \leq M\frac{|2-0|^{n+1}}{(n+1)!} \lt 10^{-20}\text{.} \end{equation*}

Again we use \(f(x) = \sin(x)\text{,}\) \(c = 2\text{,}\) \(a=0\text{,}\) and \(M = 1\) from the previous example. So we need to find \(n\) to make

\begin{equation*} \frac{2^{n+1}}{(n+1)!} \leq 10^{-20}\text{.} \end{equation*}

There is no good way to solve equations involving factorials, so we simply use trial and error, evaluating \(\frac{2^{n+1}}{(n+1)!}\) at different values of \(n\) until we get one we need.

\(n\) \(\frac{2^{n+1}}{(n+1)!}\)
\(10\) \(5.130671797 \times 10^{-5}\)
\(20\) \(4.104743250 \times 10^{-14}\)
\(25\) \(1.664028884 \times 10^{-19}\)
\(26\) \(1.232613988 \times 10^{-20}\)
\(27\) \(8.804385630 \times 10^{-22}\)

So we need to use an \(n\) of at least 27 to ensure accuracy to 20 decimal places.

A computer algebra system gives

\begin{align*} P_{27}(2)\amp \approx 0.9092974268256816953960\\ \sin(2)\amp \approx 0.9092974268256816953960 \end{align*}

and we can see that these agree to 20 places.

Show that the Taylor series for \(\sin(x)\) actually converges to \(\sin(x)\) for all \(x\text{.}\)

Solution

Recall from the previous example that since \(f(x) = \sin(x)\text{,}\) we know

\begin{equation*} \left| f^{(n+1)}(x) \right| \leq 1 \end{equation*}

for any \(n\) and \(x\text{.}\) This allows us to choose \(M = 1\) in the Lagrange error bound formula. Thus,

\begin{equation} |P_n(x) - \sin(x)| \leq \frac{|x|^{n+1}}{(n+1)!}\label{bbv}\tag{8.5.6} \end{equation}

for every \(x\text{.}\)

We showed in earlier work that the Taylor series \(\sum_{k=0}^{\infty} \frac{x^k}{k!}\) converges for every value of \(x\text{.}\) Because the terms of any convergent series must approach zero, it follows that

\begin{equation*} \lim_{n \to \infty} \frac{x^{n+1}}{(n+1)!} = 0 \end{equation*}

for every value of \(x\text{.}\) Thus, taking the limit as \(n \to \infty\) in the inequality (8.5.6), it follows that

\begin{equation*} \lim_{n \to \infty} |P_n(x) - \sin(x)| = 0\text{.} \end{equation*}

As a result, we can now write

\begin{equation*} \sin(x) = \sum_{n=0}^{\infty} \frac{(-1)^nx^{2n+1}}{(2n+1)!} \end{equation*}

for every real number \(x\text{.}\)

Activity 8.5.7.
  1. Show that the Taylor series centered at 0 for cos(x) converges to cos(x) for every real number x.

  2. Next we consider the Taylor series for ex.

    1. Show that the Taylor series centered at 0 for ex converges to ex for every nonnegative value of x.

    2. Show that the Taylor series centered at 0 for ex converges to ex for every negative value of x.

    3. Explain why the Taylor series centered at 0 for ex converges to ex for every real number x. Recall that we earlier showed that the Taylor series centered at 0 for ex converges for all x, and we have now completed the argument that the Taylor series for ex actually converges to ex for all x.

  3. Let Pn(x) be the nth order Taylor polynomial for ex centered at 0. Find a value of n so that Pn(5) approximates e5 correct to 8 decimal places.

Hint
  1. Small hints for each of the prompts above.

Answer
  1. Compare Example 8.5.6.

    1. Use the fact that that \(|f^{(n)}(x)| \le e^c\) on the interval \([0,c]\) for any fixed positive value of \(c\text{.}\)

    2. Repeat the argument in (a) but replace \(e^c\) with \(1\text{,}\) and everything else holds in the same way.

    3. Combine the results of (a) and (b)

  2. \(n = 28\text{.}\)

Solution
  1. Compare Example 8.5.6.

    1. Let \(x \ge 0\text{.}\) Since \(f(x) = e^x\text{,}\) \(f^{(n)}(x) = e^x\) for every natural number \(n\text{.}\) Since \(e^x\) is an increasing function, we know that \(|f^{(n)}(x)| \le e^c\) on the interval \([0,c]\) for any fixed positive value of \(c\text{.}\) Thus, by the Lagrange error formula, we can say that

      \begin{equation*} |P_n(x) - e^x| \le e^c \frac{x^{n+1}}{(n+1)!}\text{.} \end{equation*}

      Since the series \(\sum \frac{x^{n}}{n!}\) converges for every \(x\text{,}\) \(\frac{x^{n}}{n!} \to 0\) as \(x \to \infty\text{,}\) and thus \(\frac{x^{n+1}}{(n+1)!} \to 0\) as \(n \to \infty\) for every \(x\) in \([0,c]\text{.}\) Further, since \(e^c\) is a constant independent of \(n\text{,}\) \(e^c \frac{x^{n+1}}{(n+1)!} \to 0\) as well. Thus,

      \begin{equation*} \lim_{n \to \infty} |P_n(x) - e^x| = 0\text{,} \end{equation*}

      as desired.

    2. When \(x \lt 0\text{,}\) we know \(e^x \lt 1\text{.}\) Thus, we can repeat our argument in (a) but replace \(e^c\) with \(1\text{,}\) and everything else holds in the same way.

    3. Because we have shown that the Taylor series for \(e^x\) converges to \(e^x\) for both every nonnegative \(x\)-value and for every negative \(x\)-value, it follows that we have convergence for every value of \(x\text{.}\)

  2. Since \(e^x\) is increasing on \([0,5]\) we know that \(e^x \lt e^5\) on \([0,5]\text{.}\) Now \(e^5 \lt 243\text{,}\) so

    \begin{equation*} \left|P_n(5) - e^5\right| \leq 243\frac{|5|^{n+1}}{(n+1)!}\text{.} \end{equation*}

    We want a value of \(n\)that makes this error term less than \(10^{-8}\text{.}\) Testing various values of \(n\) gives

    \begin{equation*} 243\frac{|5|^{28+1}}{(28+1)!} \approx 5.119146745 \times 10^{-9} \end{equation*}

    so we can choose \(n = 28\text{.}\) A computer algebra system shows that \(P_{28}(5) \approx 148.413159102551\) while \(e^5 \approx 148.413159102577\) and we can see that these two approximations agree to 8 decimal places.

Subsection 8.5.5 Summary

  • We can use Taylor polynomials to approximate functions. This allows us to approximate values of functions using only addition, subtraction, multiplication, and division of real numbers. The nth order Taylor polynomial centered at x=a of a function f is

    Pn(x)=(f(a)+fβ€²(a)(xβˆ’a)+fβ€³(a)2!(xβˆ’a)2+β‹―+f(n)(a)n!(xβˆ’a)n=(nβˆ‘k=0f(k)(a)k!(xβˆ’a)k.
  • The Taylor series centered at x=a for a function f is

    βˆžβˆ‘k=0f(k)(a)k!(xβˆ’a)k.

    The nth order Taylor polynomial centered at a for f is the nth partial sum of its Taylor series centered at a. So the nth order Taylor polynomial for a function f is an approximation to f on the interval where the Taylor series converges; for the values of x for which the Taylor series converges to f we write

    f(x)=βˆžβˆ‘k=0f(k)(a)k!(xβˆ’a)k.
  • The Lagrange Error Bound shows us how to determine the accuracy in using a Taylor polynomial to approximate a function. More specifically, if Pn(x) is the nth order Taylor polynomial for f centered at x=a and if M is an upper bound for |f(n+1)(x)| on the interval [a,c], then

    |Pn(c)βˆ’f(c)|≀M|cβˆ’a|n+1(n+1)!.

Exercises 8.5.6 Exercises

1. Determining Taylor polynomials from a function formula.
2. Determining Taylor polynomials from given derivative values.
3. Finding the Taylor series for a given rational function.
4. Finding the Taylor series for a given trigonometric function.
5. Finding the Taylor series for a given logarithmic function.
6.

In this exercise we investigation the Taylor series of polynomial functions.

  1. Find the 3rd order Taylor polynomial centered at a=0 for f(x)=x3βˆ’2x2+3xβˆ’1. Does your answer surprise you? Explain.

  2. Without doing any additional computation, find the 4th, 12th, and 100th order Taylor polynomials (centered at a=0) for f(x)=x3βˆ’2x2+3xβˆ’1. Why should you expect this?

  3. Now suppose f(x) is a degree m polynomial. Completely describe the nth order Taylor polynomial (centered at a=0) for each n.

Answer
  1. \(P_3(x) = -1 + 3x - \frac{4}{2!}x^2 + \frac{6}{3!}x^3 \text{,}\) which is the same polynomial as \(f(x)\text{.}\)

  2. For \(n \ge 3\text{,}\) \(P_n(x) = f(x)\text{.}\)

  3. For \(n \ge m\text{,}\) \(P_n(x) = f(x)\text{.}\)

Solution
  1. Observe that \(f'(x) = 3x^2 - 4x + 3\text{,}\) \(f''(x) = 6x - 4\text{,}\) and \(f'''(x) = 6\text{,}\) so \(f'(0) = 3\text{,}\) \(f''(0) = -4\text{,}\) and \(f'''(0) = 6\text{.}\) In addition, \(f(0) = -1\) Thus, the 3rd order Taylor polynomial centered at \(a = 0\) is

    \begin{equation*} P_3(x) = -1 + 3x - \frac{4}{2!}x^2 + \frac{6}{3!}x^3\text{.} \end{equation*}

    Note that this is the same polynomial as \(f(x)\text{,}\) which is not surprising since the degree 3 Taylor polynomial is the degree 3 polynomial that has the same value, slope, concavity, and third derivative at \(a = 0\) as the original.

  2. Since \(f^{(4)}(x) = 0\) for all \(x\text{,}\) \(f^{(4)}(0) = 0\text{,}\) and similarly every higher derivative of \(f\) will be zero. Thus, the the 4th, 12th, and 100th order Taylor polynomials (centered at \(a = 0\)) are all identical to \(P_3(x)\) found in (a). for \(f(x) = x^3-2x^2+3x-1\text{.}\) We should expect this because all of the higher derivatives (than the third) of the original function are identically zero.

  3. For \(n = 1, 2, \ldots, m-1\text{,}\) the degree \(n\) Taylor polyomial of \(f\) will be given by the usual formula. But for every \(n \ge m\text{,}\) \(P_n(x) = f(x)\text{.}\) That is, all of the Taylor polynomials of degree at least that of the original function are simply the function itself.

7.

The examples we have considered in this section have all been for Taylor polynomials and series centered at 0, but Taylor polynomials and series can be centered at any value of a. We look at examples of such Taylor polynomials in this exercise.

  1. Let f(x)=sin(x). Find the Taylor polynomials up through order four of f centered at x=Ο€2. Then find the Taylor series for f(x) centered at x=Ο€2. Why should you have expected the result?

  2. Let f(x)=ln(x). Find the Taylor polynomials up through order four of f centered at x=1. Then find the Taylor series for f(x) centered at x=1.

  3. Use your result from (b) to determine which Taylor polynomial will approximate ln(2) to two decimal places. Explain in detail how you know you have the desired accuracy.

Answer
  1. \begin{align*} P_1(x) &= 1 + 0\left(x - \frac{\pi}{2} \right) = 1\\ P_2(x) &= 1 + 0\left(x - \frac{\pi}{2} \right) - \frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2 = 1-\frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2\\ P_3(x) &= 1 + 0\left(x - \frac{\pi}{2} \right) - \frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2 + \frac{0}{3!}\left(x - \frac{\pi}{2} \right)^3\\ &= 1-\frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2 = P_2(x)\\ P_4(x) &= 1 + 0\left(x - \frac{\pi}{2} \right) - \frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2 + \frac{0}{3!}\left(x - \frac{\pi}{2} \right)^3 + \frac{1}{4!}\left(x - \frac{\pi}{2} \right)^4\\ &= 1 - \frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2 + \frac{1}{4!}\left(x - \frac{\pi}{2} \right)^4\\ P(x) &= 1 - \frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2 + \frac{1}{4!}\left(x - \frac{\pi}{2} \right)^4 - \frac{1}{6!}\left(x - \frac{\pi}{2} \right)^6 + \cdots \end{align*}
  2. \begin{equation*} P_4(x) = 0 + 1(x-1) - \frac{1}{2!}(x-1)^2 + \frac{2}{3!}(x-1)^3 - \frac{6}{4!}(x-1)^4\text{.} \end{equation*}
    \begin{equation*} P(x) = 1(x-1) - \frac{1}{2}(x-1)^2 + \frac{1}{3}(x-1)^3 - \frac{1}{4}(x-1)^4 + \frac{1}{5}(x-1)^5 - \cdots \end{equation*}
  3. \(P_{101}(1) \approx 0.698073\)

Solution
  1. For \(f(x) = \sin(x)\text{,}\) \(f'(x) = \cos(x)\text{,}\) \(f''(x) = -\sin(x)\text{,}\) \(f'''(x) = -\cos(x)\text{,}\) and \(f^{(4)}(x) = \sin(x)\text{.}\) Thus, \(f\left(\frac{\pi}{2} \right) = 1\text{,}\) \(f'f\left(\frac{\pi}{2} \right) = 0\text{,}\) \(f''f\left(\frac{\pi}{2} \right) = -1\text{,}\) \(f'''f\left(\frac{\pi}{2} \right) = 0\text{,}\) and \(f^{(4)}f\left(\frac{\pi}{2} \right) = 1\text{.}\) It follows that the first four Taylor polynomials of \(f\) are

    \begin{align*} P_1(x) &= 1 + 0\left(x - \frac{\pi}{2} \right) = 1\\ P_2(x) &= 1 + 0\left(x - \frac{\pi}{2} \right) - \frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2 = 1-\frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2\\ P_3(x) &= 1 + 0\left(x - \frac{\pi}{2} \right) - \frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2 + \frac{0}{3!}\left(x - \frac{\pi}{2} \right)^3\\ &= 1-\frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2 = P_2(x)\\ P_4(x) &= 1 + 0\left(x - \frac{\pi}{2} \right) - \frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2 + \frac{0}{3!}\left(x - \frac{\pi}{2} \right)^3 + \frac{1}{4!}\left(x - \frac{\pi}{2} \right)^4\\ &= 1 - \frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2 + \frac{1}{4!}\left(x - \frac{\pi}{2} \right)^4 \end{align*}

    From the pattern, the Taylor series for \(f(x)\) centered at \(x = \frac{\pi}{2}\) is

    \begin{equation*} P(x) = 1 - \frac{1}{2!}\left(x - \frac{\pi}{2} \right)^2 + \frac{1}{4!}\left(x - \frac{\pi}{2} \right)^4 - \frac{1}{6!}\left(x - \frac{\pi}{2} \right)^6 + \cdots \end{equation*}

    which is expected because of the repeating patterns in the derivatives of the sine function evaluated at \(\frac{pi}{2}\text{.}\)

  2. For \(f(x) = \ln(x)\text{,}\) \(f'(x) = x^{-1}\text{,}\) \(f''(x) = -x^{-2}\text{,}\) \(f'''(x) = 2x^{-3}\text{,}\) and \(f^{(4)}(x) = -6x^{-4}\text{.}\) It follows that \(f(1) = 0\text{,}\) \(f'(1) = 1\text{,}\) \(f''(1) = -1\text{,}\) \(f'''(1) = 2\text{,}\) and \(f^{(4)}(1) = -6\text{.}\) Thus, the fourth Taylor polynomial (in which we can see the polynomials of lower degree) is

    \begin{equation*} P_4(x) = 0 + 1(x-1) - \frac{1}{2!}(x-1)^2 + \frac{2}{3!}(x-1)^3 - \frac{6}{4!}(x-1)^4\text{.} \end{equation*}

    Simplifying the coefficients and seeing the pattern, it follows that the Taylor series for \(f(x)\) centered at \(x = 1\) is

    \begin{equation*} P(x) = 1(x-1) - \frac{1}{2}(x-1)^2 + \frac{1}{3}(x-1)^3 - \frac{1}{4}(x-1)^4 + \frac{1}{5}(x-1)^5 - \cdots \end{equation*}
  3. To estimate \(\ln(2)\) to two decimal places, we use the fact that \(\ln(x) = = 1(x-1) - \frac{1}{2}(x-1)^2 + \frac{1}{3}(x-1)^3 - \frac{1}{4}(x-1)^4 + \frac{1}{5}(x-1)^5 - \cdots\) for \(x\) near \(1\text{,}\) and thus

    \begin{equation*} \ln(2) = P(2) = 1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \cdots\text{.} \end{equation*}

    Because \(P(2)\) is an alternating series, we need to know when the next term in the series is less than \(0.01\text{,}\) which occurs when \(n = 101\text{.}\) Thus, if we compute \(P_{101}(1) = \sum_{k = 1}^{101} (-1)^{k+1} \frac{1}{k}\text{,}\) we get the desired estimate. We note particularly that \(P_{101}(1) \approx 0.698073\text{,}\) which is indeed an estimate of \(\ln(2)\) accurate to two decimal places.

8.

We can use known Taylor series to obtain other Taylor series, and we explore that idea in this exercise, as a preview of work in the following section.

  1. Calculate the first four derivatives of sin(x2) and hence find the fourth order Taylor polynomial for sin(x2) centered at a=0.

  2. Part (a) demonstrates the brute force approach to computing Taylor polynomials and series. Now we find an easier method that utilizes a known Taylor series. Recall that the Taylor series centered at 0 for f(x)=sin(x) is

    βˆžβˆ‘k=0(βˆ’1)kx2k+1(2k+1)!.
    1. Substitute x2 for x in the Taylor series (8.5.7). Write out the first several terms and compare to your work in part (a). Explain why the substitution in this problem should give the Taylor series for sin(x2) centered at 0.

    2. What should we expect the interval of convergence of the series for sin(x2) to be? Explain in detail.

Answer
  1. \(P_4(x) = x^2 \text{.}\)

    1. \(g(x) = P(x^2) = x^2 - \frac{1}{3!}x^6 + \frac{1}{5!}x^10 - \cdots \text{.}\)

    2. All real numbers.

Solution
  1. Let \(f(x) = \sin(x^2)\text{.}\) Then

    \(\sin(x^2)\) \(f(0) = 0\)
    \(f'(x) = 2x\cos(x^2)\) \(f'(0) = 0\)
    \(f''(x) = -4x^2\sin(x^2) + 2\cos(x^2)\) \(f''(0) = 0\)
    \(f'''(x) = -8x^3\cos(x^2) - 12x\sin(x^2)\) \(f'''(0) = 0\)
    \(f^{(4)}(x) = 16x^4\sin(x^2) - 48x^2\cos(x^2) - 12\sin(x^2)\) \(f^{(4)}(0) = 0\)

    so the fourth order Taylor polynomial for \(f\) centered at \(a=0\) is

    \begin{equation*} P_4(x) = x^2\text{.} \end{equation*}
    1. Substituting \(x^2\) for \(x\) in the Taylor series for \(\sin(x)\text{,}\) we find that since

      \begin{equation*} P(x) = x - \frac{1}{3!}x^3 + \frac{1}{5!}x^5 - \cdots\text{,} \end{equation*}

      we have

      \begin{equation*} g(x) = P(x^2) = x^2 - \frac{1}{3!}x^6 + \frac{1}{5!}x^10 - \cdots \end{equation*}

      which should be the Taylor series for \(\sin(x^2)\) since \(\sin(x) = x - \frac{1}{3!}x^3 + \frac{1}{5!}x^5 - \cdots\) for every value of \(x\text{.}\)

    2. We expect the interval of convergence of the series for \(\sin(x^2)\) to be the same as the series for \(\sin(x)\text{,}\) since \(\sin(x) = x - \frac{1}{3!}x^3 + \frac{1}{5!}x^5 - \cdots\) for every value of \(x\text{.}\)

9.

Based on the examples we have seen, we might expect that the Taylor series for a function f always converges to the values f(x) on its interval of convergence. We explore that idea in more detail in this exercise. Let f(x)={eβˆ’1/x2 if xβ‰ 0,0 if x=0.

  1. Show, using the definition of the derivative, that fβ€²(0)=0.

  2. It can be shown that f(n)(0)=0 for all nβ‰₯2. Assuming that this is true, find the Taylor series for f centered at 0.

  3. What is the interval of convergence of the Taylor series centered at 0 for f? Explain. For which values of x the interval of convergence of the Taylor series does the Taylor series converge to f(x)?