Active Calculus · 8: Sequences and Series

8.5: Taylor Polynomials and Taylor Series

Motivating Questions 

What is a Taylor polynomial? For what purposes are Taylor polynomials used?
What is a Taylor series?
How do we determine the accuracy when we use a Taylor polynomial to approximate a function?


So far, each infinite series we have discussed has been a series of real numbers, such as
<br/>1+12+14+⋯+12k+⋯=∑k=0∞12k<br/><br /> 1+\frac{1}{2}+\frac{1}{4}+\cdots+\frac{1}{2^k}+\cdots=\sum_{k=0}^{\infty} \frac{1}{2^k}<br />
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=\frac{1}{2} with the variable xx, we have the infinite (still geometric) series
<br/>1+x+x2+⋯+xk+⋯=∑k=0∞xk<br/><br /> 1+x+x^2+\cdots+x^k+\cdots=\sum_{k=0}^{\infty} x^k<br />
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\frac{a}{1-r}, we can say that for ∣x∣<1|x|<1
<br/>1+x+x2+⋯+xk+⋯=11−x.<br/><br /> 1+x+x^2+\cdots+x^k+\cdots=\frac{1}{1-x} .<br />
Equation (8.5.3) states that the non-polynomial function 11−x\frac{1}{1-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
<br/>1+x+x2+x3≈11−x<br/><br /> 1+x+x^2+x^3 \approx \frac{1}{1-x} <br />

Preview Activity 8.5.18.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 exe^x around the origin. Let f(x)=exf(x)=e^x throughout this activity.


a. Find a formula for P1(x)P_1(x), the linearization of f(x)f(x) at x=0x=0. (We label this linearization P1P_1 because it is a first degree polynomial approximation.) Recall that P1(x)P_1(x) is a good approximation to f(x)f(x) for values of xx close to 0 . Plot ff and P1P_1 near x=0x=0 to illustrate this fact.
b. Since f(x)=exf(x)=e^x 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=0x=0. To do so, we add a quadratic term to P1(x)P_1(x). In other words, we let
<br/>P2(x)=P1(x)+c2x2<br/><br /> P_2(x)=P_1(x)+c_2 x^2 <br />
for some real number c2c_2. We need to determine the value of c2c_2 that makes the graph of P2(x)P_2(x) best fit the graph of f(x)f(x) near x=0x=0.

Remember that P1(x)P_1(x) was a good linear approximation to f(x)f(x) near 0 ; this is because P1(0)=f(0)P_1(0)=f(0) and P1′(0)=f′(0)P_1^{\prime}(0)=f^{\prime}(0). It is therefore reasonable to seek a value of c2c_2 so that
<br/>P2(0)=f(0),P2′(0)=f′(0), and P2′′(0)=f′′(0).<br/><br /> P_2(0)=f(0), \quad P_2^{\prime}(0)=f^{\prime}(0), \quad \text { and } P_2^{\prime \prime}(0)=f^{\prime \prime}(0) . <br />

Remember, we are letting P2(x)=P1(x)+c2x2P_2(x)=P_1(x)+c_2 x^2.

  1. Calculate P2(0)P_2(0) to show that P2(0)=f(0)P_2(0)=f(0).
  2. Calculate P2′(0)P_2^{\prime}(0) to show that P2′(0)=f′(0)P_2^{\prime}(0)=f^{\prime}(0).
  3. Calculate P2′′(x)P_2^{\prime \prime}(x). Then find a value for c2c_2 so that P2′′(0)=f′′(0)P_2^{\prime \prime}(0)=f^{\prime \prime}(0).
  4. Explain why the condition P2′′(0)=f′′(0)P_2^{\prime \prime}(0)=f^{\prime \prime}(0) will put an appropriate "bend" in the graph of P2P_2 to make P2P_2 fit the graph of ff around x=0x=0.

Taylor Polynomials

Preview Activity 8.5.18.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 xx ) 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 ff be a function that has as many derivatives as we need at a point x=ax=a. Recall that P1(x)P_1(x) is the tangent line to ff at (a,f(a))(a, f(a)) and is given by the formula
<br/>P1(x)=f(a)+f′(a)(x−a).<br/><br /> P_1(x)=f(a)+f^{\prime}(a)(x-a) . <br />
P1(x)P_1(x) is the linear approximation to ff near aa that has the same slope and function value as ff at the point x=ax=a.
We next want to find a quadratic approximation
<br/>P2(x)=P1(x)+c2(x−a)2 <br/><br /> P_2(x)=P_1(x)+c_2(x-a)^2  <br />
so that P2(x)P_2(x) more closely models f(x)f(x) near x=ax=a. Consider the following calculations of the values and derivatives of P2(x)P_2(x) :

P2(x)=P1(x)+c2(x−a)2P2(a)=P1(a)=f(a)P_2(x)=P_1(x)+c_2(x-a)^2 \quad P_2(a)=P_1(a)=f(a)
P2′(x)=P1′(x)+2c2(x−a)P2′(a)=P1′(a)=f′(a)P_2^{\prime}(x)=P_1^{\prime}(x)+2 c_2(x-a) \quad P_2^{\prime}(a)=P_1^{\prime}(a)=f^{\prime}(a)
P2′′(x)=2c2P2′′(a)=2c2P_2^{\prime \prime}(x)=2 c_2 \quad P_2^{\prime \prime}(a)=2 c_2.

To make P2(x)P_2(x) fit f(x)f(x) better than P1(x)P_1(x), we want P2(x)P_2(x) and f(x)f(x) to have the same concavity at x=ax=a, in addition to having the same slope and function value. That is, we want to have
<br/>P2′′(a)=f′′(a).<br/><br /> P_2^{\prime \prime}(a)=f^{\prime \prime}(a) . <br />
This implies that
<br/>2c2=f′′(a)<br/><br /> 2 c_2=f^{\prime \prime}(a) <br />
and thus
<br/>c2=f′′(a)2.<br/><br /> c_2=\frac{f^{\prime \prime}(a)}{2} . <br />
Therefore, the quadratic approximation P2(x)P_2(x) to ff centered at x=ax=a is
<br/>P2(x)=f(a)+f′(a)(x−a)+f′′(a)2!(x−a)2.<br/><br /> P_2(x)=f(a)+f^{\prime}(a)(x-a)+\frac{f^{\prime \prime}(a)}{2 !}(x-a)^2 . <br />

This approach extends naturally to polynomials of higher degree. We define polynomials
<br/><br/>P3(x)=P2(x)+c3(x−a)3,<br/>P4(x)=P3(x)+c4(x−a)4,<br/>P5(x)=P4(x)+c5(x−a)5,<br/> <br/><br /> \begin{array}{l}<br /> P_3(x)=P_2(x)+c_3(x-a)^3, \\<br /> P_4(x)=P_3(x)+c_4(x-a)^4, \\<br /> P_5(x)=P_4(x)+c_5(x-a)^5,<br /> \end{array}  <br />
and in general
<br/>Pn(x)=Pn−1(x)+cn(x−a)n.<br/><br /> P_n(x)=P_{n-1}(x)+c_n(x-a)^n . <br />
The defining property of these polynomials is that for each n,Pn(x)n, P_n(x) and all its first nn derivatives must agree with those of ff at x=ax=a. In other words we require that
<br/>Pn(k)(a)=f(k)(a)<br/><br /> P_n^{(k)}(a)=f^{(k)}(a) <br />
for all kk from 0 to nn.
To see the conditions under which this happens, suppose
<br/>Pn(x)=c0+c1(x−a)+c2(x−a)2+⋯+cn(x−a)n.<br/><br /> P_n(x)=c_0+c_1(x-a)+c_2(x-a)^2+\cdots+c_n(x-a)^n . <br />
Then
<br/><br/>Pn(0)(a)=c0<br/>Pn(1)(a)=c1<br/>Pn(2)(a)=2c2<br/>Pn(3)(a)=(2)(3)c3<br/>Pn(4)(a)=(2)(3)(4)c4<br/>Pn(5)(a)=(2)(3)(4)(5)c5<br/><br/><br /> \begin{array}{l}<br /> P_n^{(0)}(a)=c_0 \\<br /> P_n^{(1)}(a)=c_1 \\<br /> P_n^{(2)}(a)=2 c_2 \\<br /> P_n^{(3)}(a)=(2)(3) c_3 \\<br /> P_n^{(4)}(a)=(2)(3)(4) c_4 \\<br /> P_n^{(5)}(a)=(2)(3)(4)(5) c_5<br /> \end{array} <br />
and, in general,
<br/>Pn(k)(a)=(2)(3)(4)⋯(k−1)(k)ck=k!ck.<br/><br /> P_n^{(k)}(a)=(2)(3)(4) \cdots(k-1)(k) c_k=k ! c_k . <br />
So having Pn(k)(a)=f(k)(a)P_n^{(k)}(a)=f^{(k)}(a) means that k!ck=f(k)(a)k ! c_k=f^{(k)}(a) and therefore
<br/>ck=f(k)(a)k!<br/><br /> c_k=\frac{f^{(k)}(a)}{k !} <br />
for each value of kk. Using this expression for ckc_k, we have found the formula for the polynomial approximation of ff that we seek. Such a polynomial is called a Taylor polynomial.

Definition: 8.5.18.5.1:Taylor Polynomials

The nnth order Taylor polynomial of ff centered at x=ax=a is given by
<br/><br/>Pn(x)=f(a)+f′(a)(x−a)+f′′(a)2!(x−a)2+⋯+f(n)(a)n!(x−a)n<br/>=∑k=0nf(k)(a)k!(x−a)k.<br/> <br/><br /> \begin{aligned}<br /> P_n(x) &=f(a)+f^{\prime}(a)(x-a)+\frac{f^{\prime \prime}(a)}{2 !}(x-a)^2+\cdots+\frac{f^{(n)}(a)}{n !}(x-a)^n \\<br /> &=\sum_{k=0}^n \frac{f^{(k)}(a)}{k !}(x-a)^k .<br /> \end{aligned}  <br />
This degree nn polynomial approximates f(x)f(x) near x=ax=a and has the property that Pn(k)(a)=f(k)(a)P_n^{(k)}(a)=f^{(k)}(a) for k=0,1,…,nk=0,1, \ldots, n.

 

Example 8.5.18.5.1

Example 8.5.1. Determine the third order Taylor polynomial for f(x)=exf(x)=e^x, as well as the general nnth order Taylor polynomial for ff centered at x=0x=0.

Solution

We know that f′(x)=exf^{\prime}(x)=e^x and so f′′(x)=exf^{\prime \prime}(x)=e^x and f′′′(x)=exf^{\prime \prime \prime}(x)=e^x. Thus,
<br/>f(0)=f′(0)=f′′(0)=f′′′(0)=1.<br/><br /> f(0)=f^{\prime}(0)=f^{\prime \prime}(0)=f^{\prime \prime \prime}(0)=1 . <br />
So the third order Taylor polynomial of f(x)=exf(x)=e^x centered at x=0x=0 is
<br/><br/>P3(x)=f(0)+f′(0)(x−0)+f′′(0)2!(x−0)2+f′′′(0)3!(x−0)3<br/>=1+x+x22+x36.<br/><br/><br /> \begin{aligned}<br /> P_3(x) &=f(0)+f^{\prime}(0)(x-0)+\frac{f^{\prime \prime}(0)}{2 !}(x-0)^2+\frac{f^{\prime \prime \prime}(0)}{3 !}(x-0)^3 \\<br /> &=1+x+\frac{x^2}{2}+\frac{x^3}{6} .<br /> \end{aligned} <br />
In general, for the exponential function ff we have f(k)(x)=exf^{(k)}(x)=e^x for every positive integer kk. Thus, the kk th term in the nnth order Taylor polynomial for f(x)f(x) centered at x=0x=0 is
<br/>f(k)(0)k!(x−0)k=1k!xk.<br/><br /> \frac{f^{(k)}(0)}{k !}(x-0)^k=\frac{1}{k !} x^k . <br />
Therefore, the nnth order Taylor polynomial for f(x)=exf(x)=e^x centered at x=0x=0 is
<br/>Pn(x)=1+x+x22!+⋯+1n!xn=∑k=0nxkk!.<br/><br /> P_n(x)=1+x+\frac{x^2}{2 !}+\cdots+\frac{1}{n !} x^n=\sum_{k=0}^n \frac{x^k}{k !} . <br />

Activity 8.5.28.5.2

We have just seen that the nnth order Taylor polynomial centered at a=0a=0 for the exponential function exe^x is
<br/>∑k=0nxkk!.<br/><br /> \sum_{k=0}^n \frac{x^k}{k !} . <br />
In this activity, we determine small order Taylor polynomials for several other familiar functions, and look for general patterns.

a. Let f(x)=11−xf(x)=\frac{1}{1-x}.

i. Calculate the first four derivatives of f(x)f(x) at x=0x=0. Then find the fourth order Taylor polynomial P4(x)P_4(x) for 11−x\frac{1}{1-x} centered at 0 .
ii. Based on your results from part (i), determine a general formula for f(k)(0)f^{(k)}(0)

b. Let f(x)=cos⁡(x)f(x)=\cos (x).

i. Calculate the first four derivatives of f(x)f(x) at x=0x=0. Then find the fourth order Taylor polynomial P4(x)P_4(x) for cos⁡(x)\cos (x) centered at 0 .
ii. Based on your results from part (i), find a general formula for f(k)(0)f^{(k)}(0). (Think about how kk being even or odd affects the value of the kk th derivative.)

c. Let f(x)=sin⁡(x)f(x)=\sin (x).

i. Calculate the first four derivatives of f(x)f(x) at x=0x=0. Then find the fourth order Taylor polynomial P4(x)P_4(x) for sin⁡(x)\sin (x) centered at 0 .
ii. Based on your results from part (i), find a general formula for f(k)(0)f^{(k)}(0). (Think about how kk being even or odd affects the value of the kk th derivative.)

It is possible that an nnth order Taylor polynomial is not a polynomial of degree nn; 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)P_2(x) centered at 0 for sin⁡(x)\sin (x) is P2(x)=xP_2(x)=x. In this case, the second order Taylor polynomial is a degree 1 polynomial.

Taylor Series

In Activity 8.5.28.5.2 we saw that the fourth order Taylor polynomial P4(x)P_4(x) for sin⁡(x)\sin (x) centered at 0 is
<br/>P4(x)=x−x33!.<br/><br /> P_4(x)=x-\frac{x^3}{3 !} . <br />
The pattern we found for the derivatives f(k)(0)f^{(k)}(0) describe the higher-order Taylor polynomials, e.g.,
<br/><br/>P5(x)=x−x33!+x55!,<br/>P7(x)=x−x33!+x55!−x77!,<br/>P9(x)=x−x33!+x55!−x77!+x99!,<br/><br/><br /> \begin{array}{l}<br /> P_5(x)=x-\frac{x^3}{3 !}+\frac{x^5}{5 !}, \\<br /> P_7(x)=x-\frac{x^3}{3 !}+\frac{x^5}{5 !}-\frac{x^7}{7 !}, \\<br /> P_9(x)=x-\frac{x^3}{3 !}+\frac{x^5}{5 !}-\frac{x^7}{7 !}+\frac{x^9}{9 !},<br /> \end{array} <br />
and so on. It is instructive to consider the graphical behavior of these functions; Figure 8.5.18.5.1 shows the graphs of a few of the Taylor polynomials centered at 0 for the sine function.

8_5_Taylor1.svg
8_5_Taylor5.svg
8_5_Taylor7.svg
8_5_Taylor9.svg
Figure 8.5.18.5.1: The order 1,5,71,5,7, and 9 Taylor polynomials centered at x=0x=0 for f(x)=sin⁡(x)f(x)=\sin (x).


Notice that P1(x)P_1(x) is close to the sine function only for values of xx 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)}\left\{P_n(x)\right\} of Taylor polynomials converges to the function ff on larger and larger intervals (though those intervals may not necessarily increase without bound). If the Taylor polynomials ultimately converge to ff on its entire domain, we write

<br/>f(x)=∑k=0∞f(k)(a)k!(x−a)k.<br/><br /> f(x)=\sum_{k=0}^{\infty} \frac{f^{(k)}(a)}{k !}(x-a)^k . <br />

Definition: 8.5.28.5.2

 Let ff be a function all of whose derivatives exist at x=ax=a. The Taylor series for ff centered at x=ax=a is the series Tf(x)T_f(x) defined by
<br/>Tf(x)=∑k=0∞f(k)(a)k!(x−a)k.<br/><br /> T_f(x)=\sum_{k=0}^{\infty} \frac{f^{(k)}(a)}{k !}(x-a)^k .<br />


In the special case where a=0a=0 in Definition 8.5.3, the Taylor series is also called the Maclaurin series for ff. From Example 8.5.1 we know the nnth order Taylor polynomial centered at 0 for the exponential function exe^x; thus, the Maclaurin series for exe^x is
<br/>∑k=0∞xkk!.<br/><br /> \sum_{k=0}^{\infty} \frac{x^k}{k !} . <br />

Activity 8.5.38.5.3

In Activity 8.5.2\</span> 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.</p> <p>a. \(f(x)=\frac{1}{1-x}
b. f(x)=cos⁡(x)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.)
c. f(x)=sin⁡(x)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.)
d. f(x)=11+xf(x)=\frac{1}{1+x}

 

Activity 8.5.48.5.4
  1. Plot the graphs of several of the Taylor polynomials centered at 0 (of order at least 5) for exe^x and convince yourself that these Taylor polynomials converge to exe^x for every value of xx.
  2. Draw the graphs of several of the Taylor polynomials centered at 0 (of order at least 6)) for cos⁡(x)\cos (x) and convince yourself that these Taylor polynomials converge to cos⁡(x)\cos (x) for every value of xx. Write the Taylor series centered at 0 for cos⁡(x)\cos (x).
  3. Draw the graphs of several of the Taylor polynomials centered at 0 for 11−x\frac{1}{1-x}. Based on your graphs, for what values of xx do these Taylor polynomials appear to converge to 11−x\frac{1}{1-x} ? How is this situation different from what we observe with exe^x and cos⁡(x)\cos (x) ? In addition, write the Taylor series centered at 0 for 11−x\frac{1}{1-x}.


The Maclaurin series for ex,sin⁡(x),cos⁡(x)e^x, \sin (x), \cos (x), and 11−x\frac{1}{1-x} will be used frequently, so we should be certain to know and recognize them well.

The Interval of Convergence of a Taylor Series


In the previous section (in Figure 8.5.18.5.1 and Activity 8.5.48.5.4) we observed that the Taylor polynomials centered at 0 for ex,cos⁡(x)e^x, \cos (x), and sin⁡(x)\sin (x) converged to these functions for all values of xx in their domain, but that the Taylor polynomials centered at 0 for 11−x\frac{1}{1-x} converge to 11−x\frac{1}{1-x} on the interval (−1,1)(-1,1) and diverge for all other values of xx. So the Taylor series for a function f(x)f(x) does not need to converge for all values of xx in the domain of ff.
Our observations suggest two natural questions: can we determine the values of xx for which a given Taylor series converges? And does the Taylor series for a function ff actually converge to f(x)f(x) ?

Example 8.5.18.5.1

Graphical evidence suggests that the Taylor series centered at 0 for exe^x converges for all values of xx. To verify this, use the Ratio Test to determine all values of xx for which the Taylor series
<br/>∑k=0∞xkk! <br/><br /> \sum_{k=0}^{\infty} \frac{x^k}{k !} <br />
converges absolutely.

Solution

Recall that the Ratio Test applies only to series of nonnegative terms. In this example, the variable xx may have negative values. But we are interested in absolute convergence, so we apply the Ratio Test to the series
<br/>∑k=0∞∣xkk!∣=∑k=0∞∣x∣kk!.<br/><br /> \sum_{k=0}^{\infty}\left|\frac{x^k}{k !}\right|=\sum_{k=0}^{\infty} \frac{|x|^k}{k !} . <br />
Now, observe that
<br/><br/>lim⁡k→∞ak+1ak=lim⁡k→∞∣x∣k+1(k+1)!∣x∣kk<br/>=lim⁡k→∞∣x∣k+1k!∣x∣k(k+1)!<br/>=lim⁡k→∞∣x∣k+1<br/>=0<br/><br/><br /> \begin{aligned}<br /> \lim _{k \rightarrow \infty} \frac{a_{k+1}}{a_k} &=\lim _{k \rightarrow \infty} \frac{\frac{|x|^{k+1}}{(k+1) !}}{\frac{|x|^k}{k}} \\<br /> &=\lim _{k \rightarrow \infty} \frac{|x|^{k+1} k !}{|x|^k(k+1) !} \\<br /> &=\lim _{k \rightarrow \infty} \frac{|x|}{k+1} \\<br /> &=0<br /> \end{aligned} <br />
for any value of xx. So the Taylor series (8.5.48.5.4) converges absolutely for every value of xx, and thus converges for every value of xx.


One question still remains: while the Taylor series for exe^x converges for all xx, what we have done does not tell us that this Taylor series actually converges to exe^x for each xx. 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 xx for which a Taylor series
<br/>∑k=0∞ck(x−a)k<br/><br /> \sum_{k=0}^{\infty} c_k(x-a)^k <br />
centered at x=ax=a will converge, we apply the Ratio Test with ak=∣ck(x−a)k∣a_k=\left|c_k(x-a)^k\right|. The series converges if lim⁡k→∞ak+1ak<1\lim _{k \rightarrow \infty} \frac{a_{k+1}}{a_k}<1.
Observe that
<br/>ak+1ak=∣x−a∣∣ck+1∣∣ck∣<br/><br /> \frac{a_{k+1}}{a_k}=|x-a| \frac{\left|c_{k+1}\right|}{\left|c_k\right|} <br />
so when we apply the Ratio Test, we get
<br/>lim⁡k→∞ak+1ak=lim⁡k→∞∣x−a∣∣ck+1∣∣ck∣.<br/><br /> \lim _{k \rightarrow \infty} \frac{a_{k+1}}{a_k}=\lim _{k \rightarrow \infty}|x-a| \frac{\left|c_{k+1}\right|}{\left|c_k\right|} . <br />
Note suppose that
<br/>lim⁡k→∞∣ck+1∣∣ck∣=L<br/><br /> \lim _{k \rightarrow \infty} \frac{\left|c_{k+1}\right|}{\left|c_k\right|}=L <br />

so that
<br/>lim⁡k→∞ak+1ak=∣x−a∣⋅L.<br/><br /> \lim _{k \rightarrow \infty} \frac{a_{k+1}}{a_k}=|x-a| \cdot L . <br />
There are three possibilities for L:LL: L can be 0 , it can be a finite positive value, or it can be infinite. Based on this value of LL, we can determine for which values of xx the original Taylor series converges.

  • If L=0L=0, then the Taylor series converges on (−∞,∞)(-\infty, \infty).
  • If LL is infinite, then the Taylor series converges only at x=ax=a.
  • If LL is finite and nonzero, then the Taylor series converges absolutely for all xx that satisfy
    ∣x−a∣⋅L<1|x-a| \cdot L<1
    or for all xx such that
    ∣x−a∣<1L,|x-a|<\frac{1}{L}, 
    which is the interval
    (a−1L,a+1L).\left(a-\frac{1}{L}, a+\frac{1}{L}\right).  

Because the Ratio Test is inconclusive when the ∣x−a∣⋅L=1|x-a| \cdot L=1, the endpoints a±1La \pm \frac{1}{L} have to be checked separately.

It is important to notice that the set of xx values at which a Taylor series converges is always an interval centered at x=ax=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.48.5.4
  1. Use the Ratio Test to explicitly determine the interval of convergence of the Taylor series for f(x)=11−xf(x)=\frac{1}{1-x} centered at x=0x=0.
  2. Use the Ratio Test to explicitly determine the interval of convergence of the Taylor series for f(x)=cos⁡(x)f(x)=\cos (x) centered at x=0x=0.
  3. Use the Ratio Test to explicitly determine the interval of convergence of the Taylor series for f(x)=sin⁡(x)f(x)=\sin (x) centered at x=0x=0.


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

Error Approximations for Taylor Polynomials

We now know how to find Taylor polynomials for functions such as sin⁡(x)\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 nnth order Taylor polynomial Pn(x)P_n(x) approximates its generating function f(x)f(x). This error bound will also allow us to determine whether a Taylor series on its interval of convergence actually equals the function ff 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)P_n(x) that we will ensure that Pn(x)P_n(x) approximates f(x)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 aa ). We define the exact error, En(x)E_n(x), that results from approximating f(x)f(x) with Pn(x)P_n(x) by
<br/>En(x)=f(x)−Pn(x).<br/><br /> E_n(x)=f(x)-P_n(x) . <br />
We are particularly interested in ∣En(x)∣\left|E_n(x)\right|, the distance between PnP_n and ff.
Because
<br/>Pn(k)(0)=f(k)(0)<br/><br /> P_n^{(k)}(0)=f^{(k)}(0) <br />
for 0≤k≤n0 \leq k \leq n, we know that
<br/>En(k)(0)=0<br/><br /> E_n^{(k)}(0)=0 <br />
for 0≤k≤n0 \leq k \leq n. Furthermore, since Pn(x)P_n(x) is a polynomial of degree less than or equal to nn, we know that
<br/>Pn(n+1)(x)=0.<br/><br /> P_n^{(n+1)}(x)=0 . <br />
Thus, since En(n+1)(x)=f(n+1)(x)−Pn(n+1)(x)E_n^{(n+1)}(x)=f^{(n+1)}(x)-P_n^{(n+1)}(x), it follows that
<br/>En(n+1)(x)=f(n+1)(x)<br/><br /> E_n^{(n+1)}(x)=f^{(n+1)}(x) <br />
for all xx.

Suppose that we want to approximate f(x)f(x) at a number cc close to 0 using Pn(c)P_n(c). If we assume ∣f(n+1)(t)∣\left|f^{(n+1)}(t)\right| is bounded by some number MM on [0,c][0, c], so that
<br/>∣f(n+1)(t)∣≤M<br/><br /> \left|f^{(n+1)}(t)\right| \leq M <br />
for all 0≤t≤c0 \leq t \leq c, then we can say that
<br/>∣En(n+1)(t)∣=∣f(n+1)(t)∣≤M<br/><br /> \left|E_n^{(n+1)}(t)\right|=\left|f^{(n+1)}(t)\right| \leq M <br />
for all tt between 0 and cc. Equivalently,
<br/>−M≤En(n+1)(t)≤M <br/><br /> -M \leq E_n^{(n+1)}(t) \leq M <br />
on [0,c][0, c]. Next, we integrate the three terms in Inequality 8.5.58.5.5 from t=0t=0 to t=xt=x, and thus find that

<br/>∫0x−Mdt≤∫0xEn(n+1)(t)dt≤∫0xMdt<br/><br /> \int_0^x-M d t \leq \int_0^x E_n^{(n+1)}(t) d t \leq \int_0^x M d t <br />
for every value of xx in [0,c][0, c]. Since En(n)(0)=0E_n^{(n)}(0)=0, the First FTC tells us that
<br/>−Mx≤En(n)(x)≤Mx<br/><br /> -M x \leq E_n^{(n)}(x) \leq M x <br />
for every xx in [0,c][0, c].
Integrating this last inequality, we obtain
<br/>∫0x−Mtdt≤∫0xEn(n)(t)dt≤∫0xMt−dt<br/><br /> \int_0^x-M t d t \leq \int_0^x E_n^{(n)}(t) d t \leq \int_0^x M t_{-} d t <br />
and thus
<br/>−Mx22≤En(n−1)(x)≤Mx22<br/><br /> -M \frac{x^2}{2} \leq E_n^{(n-1)}(x) \leq M \frac{x^2}{2} <br />
for all xx in [0,c][0, c].
Integrating nn times, we arrive at
<br/>−Mxn+1(n+1)!≤En(x)≤Mxn+1(n+1)!<br/><br /> -M \frac{x^{n+1}}{(n+1) !} \leq E_n(x) \leq M \frac{x^{n+1}}{(n+1) !} <br />
for all xx in [0,c][0, c]. This enables us to conclude that
<br/>∣En(x)∣≤M∣x∣n+1(n+1)!<br/><br /> \left|E_n(x)\right| \leq M \frac{|x|^{n+1}}{(n+1) !} <br />
for all xx in [0,c][0, c], and we have found a bound on the approximation's error, EnE_n.
Our work above was based on the approximation centered at a=0a=0; the argument may be generalized to hold for any value of aa, which results in the following theorem.

Definition: 8.5.38.5.3: The Lagrange Error Bound 

The Lagrange Error Bound for Pn(x)P_n(x).

Let ff be a continuous function with n+1n+1 continuous derivatives. Suppose that MM is a positive real number such that ∣f(n+1)(x)∣≤M\left|f^{(n+1)}(x)\right| \leq M on the interval [a,c][a, c]. If Pn(x)P_n(x) is the nnth order Taylor polynomial for f(x)f(x) centered at x=ax=a, then
<br/>∣Pn(c)−f(c)∣≤M∣c−a∣n+1(n+1)!.<br/><br /> \left|P_n(c)-f(c)\right| \leq M \frac{|c-a|^{n+1}}{(n+1) !} . <br />

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.

Example 8.5.58.5.5

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

Solution

To answer this question we use f(x)=sin⁡(x),c=2,a=0f(x)=\sin (x), c=2, a=0, and n=10n=10 in the Lagrange error bound formula. We also need to find an appropriate value for MM. Note that the derivatives of f(x)=sin⁡(x)f(x)=\sin (x) are all equal to ±sin⁡(x)\pm \sin (x) or ±cos⁡(x)\pm \cos (x). Thus,
<br/>∣f(n+1)(x)∣≤1<br/><br /> \left|f^{(n+1)}(x)\right| \leq 1 <br />
for any nn and xx. Therefore, we can choose MM to be 1 . Then
<br/>∣P10(2)−f(2)∣≤(1)∣2−0∣11(11)!=211(11)!≈0.00005130671797.<br/><br /> \left|P_{10}(2)-f(2)\right| \leq(1) \frac{|2-0|^{11}}{(11) !}=\frac{2^{11}}{(11) !} \approx 0.00005130671797 . <br />
So P10(2)P_{10}(2) approximates sin⁡(2)\sin (2) to within at most 0.000051306717970.00005130671797. A computer algebra system tells us that
<br/>P10(2)≈0.9093474427 and sin⁡(2)≈0.9092974268<br/><br /> P_{10}(2) \approx 0.9093474427 \text { and } \sin (2) \approx 0.9092974268 <br />
with an actual difference of about 0.00005001590.0000500159.

 

Activity 8.5.68.5.6

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

 

Example 8.5.68.5.6

Show that the Taylor series for sin⁡(x)\sin (x) actually converges to sin⁡(x)\sin (x) for all xx.

Solution

Recall from the previous example that since f(x)=sin⁡(x)f(x)=\sin (x), we know
<br/>∣f(n+1)(x)∣≤1<br/><br /> \left|f^{(n+1)}(x)\right| \leq 1 <br />
for any nn and xx. This allows us to choose M=1M=1 in the Lagrange error bound formula. Thus,
<br/>∣Pn(x)−sin⁡(x)∣≤∣x∣n+1(n+1)! <br/><br /> \left|P_n(x)-\sin (x)\right| \leq \frac{|x|^{n+1}}{(n+1) !} <br />
for every xx.
We showed in earlier work that the Taylor series ∑k=0∞xkk!\sum_{k=0}^{\infty} \frac{x^k}{k !} converges for every value of xx. Because the terms of any convergent series must approach zero, it follows that
<br/>lim⁡n→∞xn+1(n+1)!=0 <br/><br /> \lim _{n \rightarrow \infty} \frac{x^{n+1}}{(n+1) !}=0  <br />
for every value of xx. Thus, taking the limit as n→∞n \rightarrow \infty in the inequality 8.5.68.5.6, it follows that
<br/>lim⁡n→∞∣Pn(x)−sin⁡(x)∣=0.<br/><br /> \lim _{n \rightarrow \infty}\left|P_n(x)-\sin (x)\right|=0 . <br />
As a result, we can now write
<br/>sin⁡(x)=∑n=0∞(−1)nx2n+1(2n+1)!<br/><br /> \sin (x)=\sum_{n=0}^{\infty} \frac{(-1)^n x^{2 n+1}}{(2 n+1) !} <br />
for every real number xx.

Activity 8.5.78.5.7
  1. Show that the Taylor series centered at 0 for cos⁡(x)\cos (x) converges to cos⁡(x)\cos (x) for every real number xx.
  2. Next we consider the Taylor series for exe^x.

 

  1. Show that the Taylor series centered at 0 for exe^x converges to exe^x for every nonnegative value of xx.
  2. Show that the Taylor series centered at 0 for exe^x converges to exe^x for every negative value of xx.
  3. Explain why the Taylor series centered at 0 for exe^x converges to exe^x for every real number xx. Recall that we earlier showed that the Taylor series centered at 0 for exe^x converges for all xx, and we have now completed the argument that the Taylor series for exe^x actually converges to exe^x for all xx.

 

  1. Let Pn(x)P_n(x) be the nnth order Taylor polynomial for exe^x centered at 0 . Find a value of nn so that Pn(5)P_n(5) approximates e5e^5 correct to 8 decimal places.

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 nnth order Taylor polynomial centered at x=ax=a of a function ff is
    Pn(x)=f(a)+f′(a)(x−a)+f′′(a)2!(x−a)2+⋯+f(n)(a)n!(x−a)n=∑k=0nf(k)(a)k!(x−a)k. \begin{aligned} P_n(x) &=f(a)+f^{\prime}(a)(x-a)+\frac{f^{\prime \prime}(a)}{2 !}(x-a)^2+\cdots+\frac{f^{(n)}(a)}{n !}(x-a)^n \\&=\sum_{k=0}^n \frac{f^{(k)}(a)}{k !}(x-a)^k .\end{aligned}   
  • The Taylor series centered at x=ax=a for a function ff is
    ∑k=0∞f(k)(a)k!(x−a)k.\sum_{k=0}^{\infty} \frac{f^{(k)}(a)}{k !}(x-a)^k .
    The nnth order Taylor polynomial centered at aa for ff is the nnth partial sum of its Taylor series centered at aa. So the nnth order Taylor polynomial for a function ff is an approximation to ff on the interval where the Taylor series converges; for the values of xx for which the Taylor series converges to ff we write
    f(x)=∑k=0∞f(k)(a)k!(x−a)k.f(x)=\sum_{k=0}^{\infty} \frac{f^{(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)P_n(x) is the nnth order Taylor polynomial for ff centered at x=ax=a and if MM is an upper bound for ∣f(n+1)(x)∣\left|f^{(n+1)}(x)\right| on the interval [a,c][a, c], then
    ∣Pn(c)−f(c)∣≤M∣c−a∣n+1(n+1)!.\left|P_n(c)-f(c)\right| \leq M \frac{|c-a|^{n+1}}{(n+1) !} .

Credit and licence

This page titled 8.5: Taylor Polynomials and Taylor Series was last modified on Fri, 29 Sep 2023 01:08:48 GMT and is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Matthew Boelkins, David Austin, and Steven Schlicker ( ScholarWorks @Grand Valley State University ) via source content that was edited to the style and standards of the LibreTexts platform.

Source: https://math.libretexts.org/Bookshelves/Calculus/Active_Calculus_(Boelkins_et_al.)/08%3A_Sequences_and_Series/8.05%3A_Taylor_Polynomials_and_Taylor_Series

Licence: CC BY-SA 4.0 (creativecommons.org/licenses/by-sa/4.0/). You may share and adapt it under the same licence, with this credit. WorldClass adapted the formatting only: the text is the authors', with interactive parts and links to other sites left out.

Build status · Flash Infinity AI™ is a trademark of AI-Flash Inc.. WorldClass is not affiliated with, approved or accredited by any exam board, curriculum provider or university unless a page says so.