Skip to main content
Logo image

Active Calculus 2nd Ed

Section 8.2 Taylor polynomials

Subsection 8.2.1 Introduction

In Activity 8.1.3, we used \(f(x) = e^x\) as a case study to investigate polynomial approximations to \(f(x)\) near near \(a = 0\text{.}\) For the degree \(3\) approximation, we chose the conditions \(T_3(0) = f(0)\text{,}\) \(T_3'(0) = f'(0)\text{,}\) \(T_3''(0) = f''(0)\text{,}\) and \(T_3'''(0) = f'''(0)\text{.}\) Starting with \(T_3(x) = c_0 + c_1 x + c_2 x^2 + c_3 x^3\) and \(f(x) = e^x\text{,}\) we found the first three derivatives of \(f\) and \(T_3\) and evaluated them at \(a = 0\text{,}\) which led to the results below.
\begin{align*} f(x) \amp= e^x \amp T_3(x) \amp= c_0 + c_1 x + c_2 x^2 + c_3 x^3\\ f'(x) \amp= e^x \amp T_3'(x) \amp= c_1 + 2 c_2 x + 3 c_3 x^2\\ f''(x) \amp= e^x \amp T_3''(x) \amp= 2 c_2 + 6 c_3 x\\ f'''(x) \amp= e^x \amp T_3'''(x) \amp= 6 c_3\\ \amp \\ f(0) \amp= 1 \amp T_3(0) \amp= c_0\\ f'(0) \amp= 1 \amp T_3'(0) \amp= c_1 \\ f''(0) \amp= 1 \amp T_3''(0) \amp= 2 c_2\\ f'''(0) \amp= 1 \amp T_3'''(0) \amp= 6 c_3 \end{align*}
Equating the function and derivative values of \(f\) and \(T_3\) at \(a = 0\text{,}\) it follows
\begin{equation*} c_0 = 1, c_1 = 1, 2c_2 = 1, 6c_3 = 1 \end{equation*}
and therefore
\begin{equation*} c_0 = 1, c_1 = 1, c_2 = \frac{1}{2}, c_3 = \frac{1}{6} \end{equation*}
so that
\begin{equation*} T_3(x) = 1 + x + \frac{1}{2}x^2 + \frac{1}{6}x^3\text{.} \end{equation*}
Moreover, plotting \(f\) and \(T_3\) near \(a = 0\text{,}\) we see in Figure 8.2.1 that the interval of accuracy for a tolerance of \(0.1\) is about \(-1.2 \le x \le 1.2\text{.}\)
Figure 8.2.1. The function \(f(x)=e^x\) and its degree \(3\) Taylor approximation \(T_3(x) = 1 + x + \frac{1}{2}x^2 + \frac{1}{6}x^3\) near the point \((0,f(0))\text{.}\)
One important pattern we observed in our work with \(f(x) = e^x\) is that for every natural number \(n\text{,}\) the \(n^{\text{th}}\) derivative’s value at \(a=0\) is \(f^{(n)}(0) = 1\text{.}\) As we will see, this information will ultimately help us find a general formula for \(c_n\text{,}\) the coefficient of \(x^n\) in the degree \(n\) polynomial approximation of \(f(x) = e^x\text{.}\)
In this section, we will learn how we can more systematically find degree \(n\) approximations for functions that have at least \(n\) derivatives, as well as how to center the approximation at a value other than \(a = 0\text{.}\)

Preview Activity 8.2.1.
Let \(f(x) = \sin(x)\) and let \(T_3(x) = c_0 + c_1 x + c_2 x^2 + c_3x^3\text{.}\) Our goal is to find the values of \(c_0, \ldots, c_3\) that make the sine function and its derivative values agree with those of the cubic polynomial \(T_3\) at \(a = 0\) and to study the resulting degree \(3\) approximation of the sine function.
(a)
As in previous work, the derivatives of \(T_3(x)\) and their respective values at \(a = 0\) are those shown below.
Compute the first three derivatives of \(f(x) = \sin(x)\) and evaluate them at \(a = 0\) accordingly, recording your results in the blanks provided below.
\begin{align*} f(x) \amp= \sin(x) \amp T_3(x) \amp= c_0 + c_1 x + c_2 x^2 + c_3 x^3 \\ f'(x) \amp= \fillinmath{XXXXX} \amp T_3'(x) \amp= c_1 + 2c_2 x + 3c_3 x^2 \\ f''(x) \amp= \fillinmath{XXXXX} \amp T_3''(x) \amp= 2c_2 + 6c_3x \\ f'''(x) \amp= \fillinmath{XXXXX} \amp T_3'''(x) \amp= 6c_3 \\ \amp \\ f(0) \amp= \fillinmath{XXX} \amp T_3(0) \amp= c_0 \\ f'(0) \amp= \fillinmath{XXX} \amp T_3'(0) \amp= c_1 \\ f''(0) \amp= \fillinmath{XXX} \amp T_3''(0) \amp= 2c_2 \\ f'''(0) \amp= \fillinmath{XXX} \amp T_3'''(0) \amp= 6c_3 \end{align*}
(b)
Now, set \(T_3(0) = f(0)\text{,}\) \(T_3'(0) = f'(0)\text{,}\) \(T_3''(0) = f''(0)\text{,}\) and \(T_3'''(0) = f'''(0)\text{.}\) What are the resulting values of \(c_0, \ldots, c_3\text{?}\) What is the resulting formula for \(T_3(x)\text{?}\)
(c)
Recall that the tangent line approximation \(T_1\) to \(f(x) = \sin(x)\) at \(a = 0\) is \(T_1(x) = x\text{.}\) Use appropriate computing technology to plot the cubic approximation \(T_3(x)\) you found in (b) along with \(f(x)\) and \(T_1(x)\) in the same window shown in Figure 8.2.2.
Figure 8.2.2. The function \(f(x)=\sin(x)\) and its tangent line approximation \(T_1(x) = x\) near the point \((0,f(0))\text{.}\)
(d)
What do you observe about the approximation of \(f(x)\) by \(T_3(x)\) compared to the approximation of \(f(x)\) by \(T_1(x)\text{?}\) For example, how do \(f(1) - T_1(1)\) and \(f(1) - T_3(1)\) compare?
(e)
In our work so far, we’ve seen that raising the degree of polynomial improves the approximation of the original function \(f(x)\text{.}\) If we wanted to find a degree \(9\) approximation to \(f(x) = \sin(x)\text{,}\) we’d need to find a polynomial whose value and first \(9\) derivatives match those of the sine function at \(a = 0\text{.}\)
Fill in the blanks below to determine the next six derivatives of \(f(x) = \sin(x)\text{,}\) up to \(f^{(9)}(x)\text{.}\)
\begin{align*} f(x) \amp= \sin(x) \amp f^{(5)}(x) \amp= \fillinmath{XXXXX} \\ f'(x) \amp= \cos(x) \amp f^{(6)}(x) \amp= \fillinmath{XXXXX} \\ f''(x) \amp= -\sin(x) \amp f^{(7)}(x) \amp= \fillinmath{XXXXX} \\ f'''(x) \amp= -\cos(x) \amp f^{(8)}(x) \amp= \fillinmath{XXXXX} \\ f^{(4)}(x) \amp= \fillinmath{XXXXX} \amp f^{(9)}(x) \amp= \fillinmath{XXXXX} \end{align*}
What pattern do you notice in the derivatives of \(f(x)=\sin(x)\text{?}\)

Subsection 8.2.2 Taylor polynomials

In our work so far in Chapter 8, we have found several different approximations of two important functions: \(e^x\) and \(\sin(x)\text{.}\) In Section 8.1, we saw that near \(a = 0\)
  • \(e^x \approx 1 + x\) (the degree \(1\) approximation);
  • \(e^x \approx 1 + x + \frac{1}{2}x^2\) (the degree \(2\) approximation);
  • \(e^x \approx 1 + x + \frac{1}{2}x^2 + \frac{1}{6}x^3\) (the degree \(3\) approximation); and
  • \(e^x \approx 1 + x + \frac{1}{2}x^2 + \frac{1}{6}x^3 + \frac{1}{24}x^4\) (the degree \(4\) approximation).
In Preview Activity 8.2.1, we saw further that
  • \(\sin(x) \approx x\) (the degree \(1\) approximation); and
  • \(\sin(x) \approx x - \frac{1}{6}x^3\) (the degree \(3\) approximation).
We’ve also observed that as the degree of the approximation increases, the polynomial approximation gets more accurate by being closer to the original function \(f(x)\) at each fixed value of \(x\) as well as on a wider interval. To find better and better approximations of any function with a sufficient number of derivatives, we naturally want to find approximations of arbitrary degree \(n\text{.}\) We thus define the Taylor polynomial of degree \(n\) centered at \(a = 0\).

Definition 8.2.3.

Let \(n\) be a natural number and let \(f\) be a function with at least \(n\) derivatives at \(a = 0\text{.}\) The degree \(n\) Taylor polynomial of \(f\) centered at \(a = 0\) is the function
\begin{equation*} T_n(x) = c_0 + c_1x + c_2x^2 + \cdots + c_nx^n \end{equation*}
that satisfies
\begin{equation*} T_n(0) = f(0), T_n'(0) = f'(0), T_n''(0) = f''(0), \ldots, T_n^{(n)}(0) = f^{(n)}(0)\text{.} \end{equation*}
By definition, \(T_n\) is the polynomial whose function value and first \(n\) derivative values at \(a = 0\) match the function value and all \(n\) derivative values of \(f\) at \(a = 0\text{.}\)
The \(n+1\) equations
\begin{equation*} T_n(0) = f(0), T_n'(0) = f'(0), T_n''(0) = f''(0), \ldots, T_n^{(n)}(0) = f^{(n)}(0) \end{equation*}
enable us to determine the coefficients \(c_0, c_1, \ldots, c_n\) in terms of the values of the various derivatives of \(f\text{.}\) First, we take \(n\) derivatives of \(T_n(x)\text{,}\) and assemble those below. As we do so, we choose not to combine products of numbers that arise in order to see certain patterns in the coefficients.
\begin{align*} T_n(x) \amp= c_0 + c_1x + c_2x^2 + c_3x^3 + c_4x^4 + \cdots + c_nx^n\\ T_n'(x) \amp= c_1 + 2c_2x + 3c_3x^2 + 4c_4x^3 + \cdots + nc_nx^{n-1} \\ T_n''(x) \amp= 2c_2 + (3 \cdot 2) c_3x + (4 \cdot 3) c_4x^2 + \cdots + n (n-1) c_nx^{n-2} \\ T_n'''(x) \amp= (3 \cdot 2 \cdot 1) c_3 + (4 \cdot 3 \cdot 2) c_4x + \cdots + n (n-1) (n-2) c_nx^{n-3} \\ T_n^{(4)}(x) \amp= (4 \cdot 3 \cdot 2 \cdot 1) c_4 + \cdots + n (n-1) (n-2) (n-3) c_nx^{n-4} \\ \amp\vdots \\ T_n^{(n)}(x) \amp= \bigl[ n (n-1) (n-2) (n-3) \cdots 3 \cdot 2 \cdot 1 \bigr] c_n\\ \amp \end{align*}
Next, we evaluate each of the derivatives of \(T_n(x)\) at \(a = 0\) and set each result equal to the corresponding derivative value of \(f\) evaluated at \(a = 0\text{,}\) which ultimately enables us to determine the coefficients \(c_0, c_1, \ldots, c_n\text{.}\) These two steps are summarized in Table 8.2.4. Note how we use the index variable, \(k\text{,}\) to track the various derivatives of \(T_n\) and \(f\text{.}\)
Table 8.2.4. Using the defining properties of a degree \(n\) Taylor polynomial to find equations involving the coefficients \(c_k\text{.}\)
\(k\) \(T_n^{(k)}(0)\) what follows from \(T_n^{(k)}(0) = f^{(k)}(0)\)
\(0\) \(T_n(0) = c_0\) \(c_0 = f(0)\)
\(1\) \(T_n'(0) = c_1\) \(c_1 = f'(0)\)
\(2\) \(T_n''(0) = 2c_2\) \(2c_2 = f''(0)\)
\(3\) \(T'''(0) = (3 \cdot 2 \cdot 1) c_3\) \((3 \cdot 2 \cdot 1) c_3 = f'''(0)\)
\(4\) \(T^{(4)}(0) = (4 \cdot 3 \cdot 2 \cdot 1) c_4\) \((4 \cdot 3 \cdot 2 \cdot 1) c_4 = f^{(4)}(0)\)
\(\vdots\) \(\vdots\) \(\vdots\)
\(n\) \(T^{(n)}(0) = \bigl[ n (n-1) \cdots 3 \cdot 2 \cdot 1 \bigr] c_n \) \(\bigl[ n (n-1) \cdots 3 \cdot 2 \cdot 1 \bigr] c_n = f^{(n)}(0)\)
We see a natural pattern that results from taking the \(k^{\text{th}}\) derivative of the \(k{\text{th}}\) power of \(x\text{,}\) \(x^k\text{.}\) For example, the repeated derivatives of \(x^4\) are \(4x^3\text{,}\) \((4 \cdot 3) x^2\text{,}\) \((4 \cdot 3 \cdot 2) x\text{,}\) and finally \(4 \cdot 3 \cdot 2 \cdot 1\text{.}\) By the time we get to the fourth derivative of \(x^4\text{,}\) only a constant remains, and that constant is the factorial
 1 
For any positive whole number \(n\text{,}\) its factorial, \(n!\text{,}\) is the product of all of the positive whole numbers less than or equal to \(n\text{:}\) \(n! = n \cdot (n-1) \cdot (n-2) \cdot \cdots \cdot 3 \cdot 2 \cdot 1\text{.}\)
\begin{equation*} \frac{d^4}{dx^4}\left[ x^4 \right] = 4 \cdot 3 \cdot 2 \cdot 1 = 4! \end{equation*}
From the rightmost column of Table 8.2.4, we now see how the values of \(c_0, c_1, \ldots, c_n\) are determined by the values of the various derivatives evaluated at \(a = 0\text{,}\) each scaled by a corresponding factorial. In particular, solving each equation in the rightmost column of Table 8.2.4 for \(c_k\text{,}\) we see that
\begin{equation*} c_0 = f(0), c_1 = f'(0), c_2 = \frac{f''(0)}{2!}, c_3 = \frac{f'''(0)}{3!}, \ldots, c_n = \frac{f^{(n)}(0)}{n!} \end{equation*}
This enables us to find the degree \(n\) Taylor polynomial for any function \(f\) by finding the values of \(f(0), f'(0), f''(0), \ldots, f^{(n)}(0)\) and using these numbers to determine \(c_0, c_1, c_2, \ldots, c_n\text{.}\) We summarize our recent work as follows.

Finding the degree \(n\) Taylor polynomial of \(f\) centered at \(a = 0\).

If \(f\) is a function with at least \(n\) derivatives at \(a = 0\text{,}\) then the degree \(n\) Taylor polynomial of \(f\) centered at \(a = 0\text{,}\) \(T_n(x)\text{,}\) is
\begin{equation*} T_n(x) = c_0 + c_1x + c_2x^2 + \cdots + c_nx^n \end{equation*}
where each coefficient \(c_k\) is given by
\begin{equation*} c_k = \frac{f^{(k)}(0)}{k!}\text{.} \end{equation*}
The Taylor polynomial is an approximation of \(f\) near \(a = 0\text{.}\) In particular,
\begin{equation*} f(x) \approx T_n(x) = f(0) + f'(0) x + \frac{f''(0)}{2!} x^2 + \cdots + \frac{f^{(n)}(0)}{n!} x^n\text{.} \end{equation*}

Example 8.2.5. The degree \(5\) Taylor polynomial of \(f(x) = \ln(1+x)\).

Find the degree \(5\) Taylor polynomial centered at \(a = 0\) for the function \(f(x) = \ln(1+x)\text{.}\)
Solution.
To find the degree \(5\) Taylor polynomial, we need to compute \(f(0)\text{,}\) \(f'(0)\text{,}\) \(f''(0)\text{,}\) \(\ldots\text{,}\) \(f^{(5)}(0)\text{,}\) so we first find the first through fifth derivatives of \(f\) in the first several rows of Table 8.2.6, and then evaluate those derivatives at \(a = 0\) in the last several rows.
Table 8.2.6. The derivatives of \(f(x) = \ln(1+x)\) at \(a = 0\text{.}\)
\(k = 0\) \(f(x) = \ln(1+x)\)
\(k = 1\) \(f'(x) = \frac{1}{1+x} = (1+x)^{-1}\)
\(k = 2\) \(f''(x) = (-1)(1+x)^{-2}\)
\(k = 3\) \(f'''(x) = (-2)(-1)(1+x)^{-3}\)
\(k = 4\) \(f^{(4)}(x) = (-3)(-2)(-1)(1+x)^{-4}\)
\(k = 5\) \(f^{(5)}(x) = (-4)(-3)(-2)(-1)(1+x)^{-5}\)
\(k = 0\) \(f(0) = \ln(1) = 0\)
\(k = 1\) \(f'(0) = (1)^{-1} = 1\)
\(k = 2\) \(f''(0) = (-1)(1)^{-2} = -1 \)
\(k = 3\) \(f'''(0) = (-2)(-1)(1)^{-3} = (-2)(-1)\)
\(k = 4\) \(f^{(4)}(0) = (-3)(-2)(-1)(1)^{-4} = (-3)(-2)(-1)\)
\(k = 5\) \(f^{(5)}(0) = (-4)(-3)(-2)(-1)(1)^{-5} = (-4)(-3)(-2)(-1)\)
When finding the coefficients of a Taylor polynomial, it is often helpful to not combine products such as \((-3)(-2)(-1)\) and \((-4)(-3)(-2)(-1)\) into a single number, in order to better observe patterns; indeed, by not combining the constants that arise in higher derivatives of \(f(x) = \ln(1+x)\text{,}\) we see patterns of alternating signs and factorials that arise. From the last six rows of Table 8.2.6 and the fact that \(c_k = \frac{f^{(k)}(0)}{k!}\text{,}\) we find that
\begin{align*} c_0 \amp= f(0) = 0 \\ c_1 \amp= f'(0) = 1 \\ c_2 \amp= \frac{1}{2!}f''(0) = \frac{-1}{2!} = -\frac{1}{2} \\ c_3 \amp= \frac{1}{3!}f'''(0) = \frac{(-2)(-1)}{3!} = \frac{1}{3} \\ c_4 \amp= \frac{1}{4!}f^{(4)}(0) = \frac{(-3)(-2)(-1)}{4!} = -\frac{1}{4} \\ c_5 \amp= \frac{1}{5!}f^{(5)}(0) = \frac{(-4)(-3)(-2)(-1)}{5!} = \frac{1}{5} \end{align*}
so that the degree \(5\) Taylor approximation of \(f(x) = \ln(1+x)\) at \(a = 0\) is
\begin{equation*} T_5(x) = 1x - \frac{1}{2}x^2 + \frac{1}{3}x^3 - \frac{1}{4}x^4 + \frac{1}{5}x^5\text{.} \end{equation*}
Thus, we have found the approximation
\begin{equation*} \ln(1+x) \approx 1x - \frac{1}{2}x^2 + \frac{1}{3}x^3 - \frac{1}{4}x^4 + \frac{1}{5}x^5\text{,} \end{equation*}
and by plotting \(T_5(x)\) along with \(f(x)\) and \(T_1(x)\) in Figure 8.2.7, we see how much better the degree \(5\) approximation is than the tangent line approximation.
Figure 8.2.7. The function \(f(x)=\ln(1+x)\) and its degree \(5\) Taylor approximation \(T_5(x) = x - \frac{1}{2}x^2 + \frac{1}{3}x^3 - \frac{1}{4}x^4 + \frac{1}{5}x^5\) near the point \((0,f(0))\text{,}\) along with \(T_1(x) = x\text{.}\)
From our work in Example 8.2.5, we see the pattern that arises in the various derivatives of \(f(x) = \ln(1+x)\text{.}\) We therefore find that the general degree \(n\) Taylor polynomial centered at \(a = 0\) for \(f(x) = \ln(1+x)\) is
\begin{equation*} T_n(x) = x - \frac{1}{2}x^2 + \frac{1}{3}x^3 - \cdots + (-1)^{n+1}\frac{1}{n}x^n. \end{equation*}
For many familiar functions, a pattern emerges in their derivatives that enables us to find the general form of the degree \(n\) Taylor polynomial.

Activity 8.2.2.
Let \(f(x) = \cos(x)\text{.}\) Through the questions that follow, we seek to find the degree \(n\) Taylor polynomial for \(f(x)\) centered at \(a = 0\text{.}\)
(a)
Determine the first \(8\) derivatives of \(f(x) = \cos(x)\) and evaluate each at \(a = 0\text{.}\) Summarize your work by filling in all the blanks below.
\begin{align*} k \amp= 0 \amp f(x) \amp= \cos(x) \amp f(0) \amp= \cos(0) = 1 \\ k \amp= \fillinmath{XX} \amp f'(x) \amp= \fillinmath{XXXXX} \amp f'(0) \amp= \fillinmath{XXXXX} \\ k \amp= \fillinmath{XX} \amp f''(x) \amp= \fillinmath{XXXXX} \amp f''(0) \amp= \fillinmath{XXXXX} \\ k \amp= \fillinmath{XX} \amp f'''(x) \amp= \fillinmath{XXXXX} \amp f'''(0) \amp= \fillinmath{XXXXX} \\ k \amp= \fillinmath{XX} \amp f^{(4)}(x) \amp= \fillinmath{XXXXX} \amp f^{(4)}(0) \amp= \fillinmath{XXXXX} \\ k \amp= \fillinmath{XX} \amp f^{(5)}(x) \amp= \fillinmath{XXXXX} \amp f^{(5)}(0) \amp= \fillinmath{XXXXX} \\ k \amp= \fillinmath{XX} \amp f^{(6)}(x) \amp= \fillinmath{XXXXX} \amp f^{(6)}(0) \amp= \fillinmath{XXXXX} \\ k \amp= \fillinmath{XX} \amp f^{(7)}(x) \amp= \fillinmath{XXXXX} \amp f^{(7)}(0) \amp= \fillinmath{XXXXX} \\ k \amp= \fillinmath{XX} \amp f^{(8)}(x) \amp= \fillinmath{XXXXX} \amp f^{(8)}(0) \amp= \fillinmath{XXXXX} \end{align*}
(b)
Use your work in (a) along with the fact that the coefficients of the Taylor polynomial are determined by \(c_k = \frac{f^{(k)}(0)}{k!}\) to find formulas for \(T_2(x)\text{,}\) \(T_4(x)\text{,}\) \(T_6(x)\text{,}\) and \(T_8(x)\text{.}\)
(c)
Based on the patterns you observe in your prior work, what do you expect to be the formula for \(T_{10}(x)\text{?}\)
(d)
Use appropriate computing technology to plot \(T_4(x)\) and \(T_6(x)\) along with \(f(x) = \cos(x)\) and \(T_2(x)\) in the same window as shown in Figure 8.2.10.
Figure 8.2.10. The function \(f(x)=\cos(x)\) and its degree \(2\) Taylor approximation \(T_2(x) = 1 - \frac{1}{2}x^2\) near the point \((0,f(0))\text{.}\)
What do you notice?
(e)
Build a spreadsheet similar to the one in Table 8.1.11 and Table 8.1.12 from Activity 8.1.4, but do so using \(\Delta x = 0.2\text{,}\) a start value of \(x = -2\text{,}\) and the functions \(f(x) = \cos(x)\text{,}\) \(T_2(x)\text{,}\) \(T_4(x)\text{,}\) and \(T_6(x)\text{.}\) The first six columns of your spreadsheet should begin as shown in Table 8.2.13.
Table 8.2.13. Comparing \(f(x) = \cos(x)\) and its degree \(2\text{,}\) \(4\text{,}\) and \(6\) approximations near \(a = 0\text{.}\)
\(\Delta x\) \(x\) \(f(x)\) \(T_2(x)\) \(T_4(x)\) \(T_6(x)\)
\(0.2\) \(-2.0\) \(-0.41615\) \(-1.00000\) \(-0.33333\) \(-0.42222\)
\(0.2\) \(-1.8\) \(-0.22720\) \(-0.62000\) \(-0.18260\) \(-0.22984\)
and the last three columns of your spreadsheet should begin as follows:
Table 8.2.14. The absolute error between \(f(x) = \cos(x)\) and its degree \(2\text{,}\) \(4\text{,}\) and \(6\) approximations.
\(|f(x)-T_2(x)|\) \(|f(x)-T_4(x)|\) \(|f(x)-T_6(x)|\)
\(0.58385\) \(0.08281\) \(0.00608\)
\(0.39280\) \(0.04460\) \(0.00263\)
For about what interval of \(x\)-values is it true that \(|f(x) - T_2(x)| \lt 0.1\text{?}\) How does the interval of \(x\)-values change if we instead consider where \(|f(x) - T_4(x)| \lt 0.1\text{?}\) \(|f(x) - T_6(x)| \lt 0.1\text{?}\)
Our work so far with the functions \(e^x\text{,}\) \(\sin(x)\text{,}\) \(\cos(x)\text{,}\) and \(\ln(1+x)\) has revealed patterns in their derivatives that enable us to find even higher degree Taylor polynomials easily. Furthermore, these higher degree polynomials provide outstanding approximations that only require the use of addition and multiplication.
For example, in Activity 8.2.2, we found that the degree \(8\) Taylor approximation of the cosine function at \(a = 0\) is
\begin{equation*} T_8(x) = 1 - \frac{1}{2!}x^2 + \frac{1}{4!}x^4 - \frac{1}{6!}x^6 + \frac{1}{8!}x^8\text{,} \end{equation*}
so
\begin{equation*} \cos(x) \approx 1 - \frac{1}{2!}x^2 + \frac{1}{4!}x^4 - \frac{1}{6!}x^6 + \frac{1}{8!}x^8 \text{.} \end{equation*}
The pattern of alternating signs and even numbers in the factorials and powers of \(x\) lets us see that we could easily write down, say, \(T_{20}(x)\text{.}\) We can reason similarly to extend what we found in Preview Activity 8.2.1 and observe that
\begin{equation*} \sin(x) \approx T_7(x) = x - \frac{1}{3!}x^3 + \frac{1}{5!}x^5 - \frac{1}{7!}x^7\text{,} \end{equation*}
the degree \(7\) Taylor approximation of the sine function at \(a = 0\text{.}\)
When we ask a computational device to find numerical estimates for quantities such as \(e^2\text{,}\) \(\sin(1)\text{,}\) and \(\cos(1.2)\text{,}\) high degree Taylor polynomials are one approach
 2 
For computing values of trigonometric functions, a method known as CORDIC (that remarkably doesn’t even use multiplication) is employed by many calculating devices.
that can be used to generate the results. For example,
\begin{equation*} \sin(1) \approx T_7(1) = 1 - \frac{1}{3!}1^3 + \frac{1}{5!}1^5 - \frac{1}{7!}1^7 = \frac{4241}{5040} \approx 0.84146825 \end{equation*}
is a surprisingly accurate estimate of \(\sin(1) = 0.84147098 \ldots\) that only involves the sum of four rational numbers.

Subsection 8.2.3 Taylor polynomial approximations centered at an arbitrary value \(a\)

In all of our work so far in Chapter 8, we have focused on approximating functions such as \(e^x\text{,}\) \(\sin(x)\text{,}\) \(\ln(1+x)\text{,}\) and \(\cos(x)\) near \(a = 0\text{.}\) But we could instead be interested in the behavior of some function \(f\) near \(a = 5\text{,}\) or be interested in a function \(f\) that wasn’t even defined at \(a = 0\text{.}\) Thus, we next generalize our earlier work to Taylor polynomial approximations centered at any value \(a\text{.}\)
From our early studies in Section 1.8, we know that at any input value \(x = a\) where a function \(f\) has a first derivative, \(f\) has a tangent line approximation
\begin{equation*} L(x) = f(a) + f'(a)(x-a) \end{equation*}
that satisfies \(f(x) \approx L(x)\) for \(x\) values near \(a\text{.}\) Provided that \(f\) has a second derivative at \(x=a\text{,}\) we can build a quadratic approximation near \(a\) for \(f\text{,}\) similar to the one we found at \(a = 0\) for \(f(x)=e^x\) in Activity 8.1.3. In addition, as long as \(f\) has a third derivative at \(x=a\text{,}\) we can even find a cubic approximation (just as we did at \(a = 0\) in Activity 8.1.4), and so on.
In developing such approximations centered at any value \(x = a\text{,}\) our guiding principle is the same as with our work at \(a = 0\text{:}\) we’ll require that at the input value \(a\text{,}\) the original function’s output and its derivatives’ outputs match the corresponding approximation’s output and derivatives’ output.
Building on the form of the tangent line approximation, which we now denote \(T_1(x)\text{,}\)
\begin{equation*} T_1(x) = f(a) + f'(a)(x-a)\text{,} \end{equation*}
it is natural for us to consider quadratic and cubic approximations of form
\begin{equation*} T_2(x) = c_0 + c_1(x-a) + c_2 (x-a)^2, {\text{ and}}\text{,} \end{equation*}
a cubic approximation of form
\begin{equation*} T_3(x) = c_0 + c_1 (x-a) + c_2 (x-a)^2 + c_3(x-a)^3\text{,} \end{equation*}
and so on. We define the more general degree \(n\) Taylor Polynomial centered at \(a\) as follows.

Definition 8.2.17.

Let \(n\) be a natural number and let \(f\) be a function with at least \(n\) derivatives at \(a\text{.}\) The degree \(n\) Taylor polynomial of \(f\) centered at \(a\) is the function
\begin{equation*} T_n(x) = c_0 + c_1(x-a) + c_2(x-a)^2 + \cdots + c_n(x-a)^n \end{equation*}
that satisfies \(T_n(a) = f(a), T_n'(a) = f'(a), T_n''(a) = f''(a), \ldots, T_n^{(n)}(a) = f^{(n)}(a) \text{.}\)
Similar to the situation when \(a = 0\text{,}\) it follows that we can find the coefficients \(c_k\) of the Taylor polynomial in terms of the various derivatives of \(f\) evaluated at \(a\text{.}\)

Finding the degree \(n\) Taylor polynomial of \(f\) centered at \(a\).

If \(f\) is a function with at least \(n\) derivatives at \(a\text{,}\) then the degree \(n\) Taylor polynomial of \(f\) centered at \(a\text{,}\) \(T_n(x)\text{,}\) is
\begin{equation*} T_n(x) = c_0 + c_1(x-a) + c_2(x-a)^2 + \cdots + c_n(x-a)^n \end{equation*}
where each coefficient \(c_k\) is given by
\begin{equation*} c_k = \frac{f^{(k)}(a)}{k!}\text{.} \end{equation*}
As with approximations centered at \(a = 0\text{,}\) the Taylor polynomial now provides us with an approximation of \(f\) near \(a\text{.}\) In particular,
\begin{equation*} f(x) \approx T_n(x) = f(a) + f'(a) (x-a) + \frac{f''(a)}{2!} (x-a)^2 + \cdots + \frac{f^{(n)}(a)}{n!} (x-a)^n\text{.} \end{equation*}

Activity 8.2.3.
Let \(f(x) = \ln(x)\text{,}\) and recall that \(f\) is only defined for \(x \gt 0\text{.}\) As such, we can’t consider the tangent line (or any other) approximation at \(a = 0\text{.}\) Instead, we choose to work with an approximation to \(f(x) = \ln(x)\) centered at \(a = 1\) and will find the degree \(4\) Taylor polynomial approximation
\begin{equation*} T_4(x) = c_0 + c_1 (x-1) + c_2 (x-1)^2 + c_3(x-1)^3 + c_4(x-1)^4\text{.} \end{equation*}
(a)
Determine \(f'(x)\text{,}\) \(f''(x)\text{,}\) \(f'''(x)\text{,}\) and \(f^{(4)}(x)\text{,}\) and then compute \(f'(1)\text{,}\) \(f''(1)\text{,}\) \(f'''(1)\text{,}\) and \(f^{(4)}(1)\text{.}\) Enter your results in the provided blanks below.
\begin{align*} k \amp= 0 \amp f(x) \amp= \ln(x) \amp f(1) \amp= \ln(1) = 0\\ k \amp= \fillinmath{XX} \amp f'(x) \amp= \fillinmath{XXXXX} \amp f'(1) \amp= \fillinmath{XXXXX}\\ k \amp= \fillinmath{XX} \amp f''(x) \amp= \fillinmath{XXXXX} \amp f''(1) \amp= \fillinmath{XXXXX}\\ k \amp= \fillinmath{XX} \amp f'''(x) \amp= \fillinmath{XXXXX} \amp f'''(1) \amp= \fillinmath{XXXXX}\\ k \amp= \fillinmath{XX} \amp f^{(4)}(x) \amp= \fillinmath{XXXXX} \amp f^{(4)}(1) \amp= \fillinmath{XXXXX} \end{align*}
(b)
Use your work in (a) along with the fact that the coefficients of the Taylor polynomial are determined by \(c_k = \frac{f^{(k)}(a)}{k!}\) to determine
\begin{equation*} T_4(x) = c_0 + c_1 (x-1) + c_2 (x-1)^2 + c_3(x-1)^3 + c_4(x-1)^4\text{.} \end{equation*}
(c)
Use appropriate technology to plot \(f(x) = \ln(x)\text{,}\) its tangent line, \(T_1(x) = x - 1\text{,}\) and \(T_4(x)\) in the same window shown in Figure 8.2.18.
Figure 8.2.18. The function \(f(x)=\ln(x)\) and its degree \(1\) Taylor approximation \(T_1(x) = x-1\) near the point \((1,f(1))\text{.}\)
What do you notice?
(d)
Compute \(|f(x) - T_4(x)|\) for several different \(x\) values (you might find it helpful to use a slider in Desmos in the variable \(b\) to experiment with \(|f(b) - T_4(b)|\)); for approximately what values of \(x\) is it true that \(|f(x) - T_4(x)| \lt 0.1\text{?}\)
(e)
Use the patterns you observe in your work in parts (a) and (b) to conjecture formulas for \(T_5(x)\) and \(T_6(x)\text{.}\)
For approximately what interval of \(x\)-values is it true that \(|f(x) - T_5(x)| \lt 0.1\text{?}\) What about \(|f(x) - T_6(x)| \lt 0.1\text{?}\) How is this situation different from what we observed with \(f(x) = \cos(x)\) in Activity 8.2.2?

Activity 8.2.4.
This activity builds on Activity 8.2.3, and only changes one key thing: the location where the approximation is centered. Again, we let \(f(x) = \ln(x)\text{,}\) and recall that \(f\) is only defined for \(x \gt 0\text{.}\) Here, we choose to work with an approximation centered at \(a=2\text{,}\) and find the degree \(4\) Taylor polynomial approximation
\begin{equation*} T_4(x) = c_0 + c_1 (x-2) + c_2 (x-2)^2 + c_3(x-2)^3 + c_4(x-2)^4\text{.} \end{equation*}
(a)
We recall \(f'(x)\text{,}\) \(f''(x)\text{,}\) \(f'''(x)\text{,}\) and \(f^{(4)}(x)\) from our work in Activity 8.2.3, and then compute \(f'(2)\text{,}\) \(f''(2)\text{,}\) \(f'''(2)\text{,}\) and \(f^{(4)}(2)\text{.}\) Enter the updated results in the blanks below.
\begin{align*} k \amp= 0 \amp f(x) \amp= \ln(x) \amp f(2) \amp= \fillinmath{XXXXX}\\ k \amp= 1 \amp f'(x) \amp= x^{-1} \amp f'(2) \amp= \fillinmath{XXXXX}\\ k \amp= 2 \amp f''(x) \amp= (-1)x^{-2} \amp f''(2) \amp= \fillinmath{XXXXX}\\ k \amp= 3 \amp f'''(x) \amp= (-2)(-1)x^{-3} \amp f'''(2) \amp= \fillinmath{XXXXX}\\ k \amp= 4 \amp f^{(4)}(x) \amp= (-3)(-2)(-1)x^{-4} \amp f^{(4)}(2) \amp= \fillinmath{XXXXX} \end{align*}
(b)
Use your work in (a) along with the fact that the coefficients of the Taylor polynomial are determined by \(c_k = \frac{f^{(k)}(a)}{k!}\) to determine \(T_4(x) = c_0 + c_1 (x-2) + c_2 (x-2)^2 + c_3(x-2)^3 + c_4(x-2)^4\text{.}\)
(c)
Use appropriate technology to plot \(f(x) = \ln(x)\text{,}\) its tangent line, \(T_1(x) = \ln(2) + \frac{1}{2}(x - 2)\text{,}\) and \(T_4(x)\) on the same axes in the window shown Figure 8.2.19.
Figure 8.2.19. The function \(f(x)=\ln(x)\) and its degree \(1\) Taylor approximation \(T_1(x) = \ln(2) + \frac{1}{2}(x - 2)\) near the point \((2,f(2))\text{.}\)
What do you notice?
(d)
Compute \(|f(x) - T_4(x)|\) for several different \(x\) values (you might find it helpful to use a slider in Desmos); for approximately what values of \(x\) is it true that \(|f(x) - T_4(x)| \lt 0.1\text{?}\)
(e)
Use the patterns you observe in parts (a) and (b) to conjecture formulas for \(T_5(x)\) and \(T_6(x)\text{.}\)
For about what interval of \(x\)-values is it true that \(|f(x) - T_5(x)| \lt 0.1\text{?}\) What about \(|f(x) - T_6(x)| \lt 0.1\text{?}\) How is this different from what we observed with the Taylor approximations centered at \(a = 1\) in Activity 8.2.3? How is it similar?

Subsection 8.2.4 Summary

  • Provided that a function \(f(x)\) has \(n\) derivatives at a selected input value \(x = a\text{,}\) we can find a degree \(n\) polynomial \(T_n(x)\) that approximates \(f(x)\) near \(a\) by requiring that \(T_n(a) = f(a)\text{,}\) \(T_n'(a) = f'(a)\text{,}\) \(T_n''(a) = f''(a)\text{,}\) \(\ldots\text{,}\) \(T_n^{(n)}(a) = f^{(n)}(a)\text{.}\)
  • When \(a = 0\text{,}\) the degree \(n\) polynomial approximation, \(T_n(x)\text{,}\) to a function \(f(x)\text{,}\) centered at \(a = 0\text{,}\) is a polynomial of the form
    \begin{equation*} T_n(x) = c_0 + c_1 x + c_2 x^2 + \cdots + c_n x^n \end{equation*}
    and it follows that the coefficients \(c_k\) are determined by the values of the various derivatives of \(f(x)\) evaluated at \(0\) according to the formula
    \begin{equation*} c_k = \frac{f^{(k)}(0)}{k!}. \end{equation*}
    Therefore, for \(x\) near \(a = 0\text{,}\)
    \begin{equation*} f(x) \approx T_n(x) = f(0) + f'(0) x + \frac{f''(0)}{2!} x^2 + \cdots + \frac{f^{(n)}(0)}{n!} x^n\text{.} \end{equation*}
  • Just as we can consider any function \(f\) that has \(n\) derivatives at \(a = 0\) and find approximations centered there, we can also consider any input value \(a\) at which those \(n\) derivatives exist, and find a polynomial approximation that satisfies \(T_n(a) = f(a)\text{,}\) \(T_n'(a) = f'(a)\text{,}\) \(T_n''(a) = f''(a)\text{,}\) \(\ldots\text{,}\) \(T_n^{(n)}(a) = f^{(n)}(a)\text{.}\)
    At such a value \(a\text{,}\) the degree \(n\) Taylor polynomial of \(f\) centered at \(a\) has form
    \begin{equation*} T_n(x) = c_0 + c_1 (x-a) + c_2 (x-a)^2 + \cdots + c_n (x-a)^n \end{equation*}
    and it follows that the coefficients \(c_k\) are determined by the values of the various derivatives of \(f(x)\) evaluated at \(a\) according to the formula
    \begin{equation*} c_k = \frac{f^{(k)}(a)}{k!}. \end{equation*}
    Thus, for \(x\) near \(a\text{,}\)
    \begin{equation*} f(x) \approx T_n(x) = f(a) + f'(a) (x-a) + \frac{f''(a)}{2!} (x-a)^2 + \cdots + \frac{f^{(n)}(a)}{n!} (x-a)^n\text{.} \end{equation*}

Exercises 8.2.5 Exercises

1.

Find the Taylor polynomials of degree \(n\) approximating \(\cos\mathopen{}\left(x\right)\) for \(x\) near 0:
For \(n=2\text{,}\) \(T_{2}(x) =\)
For \(n=4\text{,}\) \(T_{4}(x) =\)
For \(n=6\text{,}\) \(T_{6}(x) =\)

2.

Calculate the Taylor polynomials \(T_2(x)\) and \(T_3(x)\) centered at \(x = \frac{\pi }{2}\) for \(f(x) = \sin\mathopen{}\left(x\right)\text{.}\)

3.

Calculate the Taylor polynomials \(T_2(x)\) and \(T_3(x)\) centered at \(x = 3\) for \(f(x) = \ln\mathopen{}\left(x+1\right)\text{.}\)
\(T_2(x) =\)
\(T_3(x) = T_2(x) +\)

4.

Compute \(T_2(x)\) at \(x = 0.4\) for \(y = e^{x}\) and use a calculator to compute the error \(|e^{x} - T_2(x)|\) at \(x = 1.1\text{.}\)
\(T_2(x) =\)
\(|e^{x} - T_2(x)|\) =

5.

Find the second-degree Taylor polynomial for \(f(x)=4 x^2 - 6 x + 5\) about \(x=0\text{.}\)
\(T_2(x) =\)
What do you notice about your polynomial?

6.

Suppose \(g\) is a function which has continuous derivatives, and that \(g(6)=-4, g'(6)=-5\text{,}\) \(g''(6)=5\text{,}\) \(g'''(6)=2\text{.}\)
(a) What is the Taylor polynomial of degree 2 for \(g\) near \(6\text{?}\)
\(T_2(x) =\)
(b) What is the Taylor polynomial of degree 3 for \(g\) near \(6\text{?}\)
\(T_3(x) =\)
(c) Use the two polynomials that you found in parts (a) and (b) to approximate \(g(6.1)\text{.}\)
With \(T_2\text{,}\) \(g(6.1)\approx\)
With \(T_3\text{,}\) \(g(6.1)\approx\)

7.

Suppose we know the following information about a function \(f\text{:}\)
\begin{equation*} f(0) = 2, f'(0) = -3, f''(0) = -1, f'''(0) = 0, f^{(4)}(0) = -3\text{.} \end{equation*}
  1. Determine \(T_4(x)\text{,}\) the degree \(4\) Taylor polynomial of \(f\) that is centered at \(a = 0\text{.}\)
  2. Use \(T_4(x)\) to estimate \(f(0.5)\text{.}\)
  3. State each of the Taylor polynomials \(T_3(x)\text{,}\) \(T_2(x)\text{,}\) and \(T_1(x)\text{.}\)

8.

In Exercise 8.2.5.5, we found that the degree 2 Taylor polynomial centered at \(a = 0\) of a quadratic function is the quadratic function itself. In this exercise, we explore how changing the center of the approximation offers additional insight into the function.
Let \(f(x) = \frac{1}{2}x^2 - 2x + 5\text{,}\) and let \(a = 2\) be the center at which we will find a degree \(2\) Taylor polynomial approximation of \(f\text{.}\)
  1. By finding \(f'(x)\text{,}\) \(f''(x)\text{,}\) \(f(2)\text{,}\) \(f'(2)\text{,}\) and \(f''(2)\text{,}\) determine \(T_2(x)\text{,}\) the degree \(2\) Taylor polynomial approximation of \(f\) that is centered at \(a = 2\text{.}\)
  2. Plot both \(f(x)\) and \(T_2(x)\) on the same axes. What do you observe?
  3. What does the algebraic form of \(T_2(x)\) tell you about the original function \(f(x)\text{?}\)
  4. What is the tangent line approximation to \(f(x)\) at \(a = 2\text{?}\) What is special about the function’s behavior at this input value?

9.

Recall that we found in Preview 8.2.1 and subsequent work that \(\sin(x) \approx x - \frac{1}{3!}x^3 + \frac{1}{5!}x^5 - \frac{1}{7!}x^7\text{,}\) which is the degree \(7\) Taylor approximation centered at \(0\text{.}\) And in Activity 8.2.2, we found that the degree \(6\) Taylor approximation centered at \(a = 0\) for \(\cos(x)\) is \(\cos(x) \approx 1 - \frac{1}{2!}x^2 + \frac{1}{4!}x^4 - \frac{1}{6!}x^6\text{.}\)
In this exercise, we investigate Taylor polynomial approximations of \(f(x) = \sin(x)\) centered at \(a = \frac{\pi}{2}\text{.}\)
  1. By finding the appropriate derivatives of \(f(x) = \sin(x)\) and evaluating them at \(a = \frac{\pi}{2}\text{,}\) determine the degree \(6\) Taylor polynomial approximation of \(\sin(x)\) centered at \(a = \frac{\pi}{2}\text{.}\)
  2. How is your result in (a) similar to the degree \(6\) Taylor polynomial of \(\cos(x)\) that is centered at \(a = 0\text{?}\)
  3. Recall the trigonometric identity that states \(\sin(x) = \cos(x - \frac{\pi}{2})\text{.}\) How does this identity help explain what you found in (a) and (b)?

10.

In Example 8.2.5, we found that
\begin{equation*} f(x) = \ln(1+x) \approx T_5(x) = 1x - \frac{1}{2}x^2 + \frac{1}{3}x^3 - \frac{1}{4}x^4 + \frac{1}{5}x^5\text{,} \end{equation*}
where \(T_5\) is the degree \(5\) Taylor approximation of \(\ln(1+x)\) centered at \(a = 0\text{.}\)
In Activity 8.2.3, we found that
\begin{equation*} g(x) = \ln(x) \approx P_5(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\text{,} \end{equation*}
where \(P_5\) is the degree \(5\) Taylor approximation of \(\ln(x)\) centered at \(a = 1\text{.}\) (Here we are using “\(T_5\)” and “\(P_5\)” to distinguish between these two degree \(5\) polynomial approximations of the two different functions \(f(x) = \ln(1+x)\) and \(g(x) = \ln(x)\text{,}\) centered at two different values.)
  1. Note that \(f(0.5) = \ln(1.5)\text{.}\) Use \(T_5(x)\) appropriately to find an estimate of \(\ln(1.5)\text{.}\)
  2. Observe that \(g(1.5) = \ln(1.5)\text{.}\) Use \(P_5(x)\) to estimate \(\ln(1.5)\text{.}\)
  3. Are the estimates of \(\ln(1.5)\) generated by \(T_5(x)\) and \(P_5(x)\) the same or different? Why do you think this happens?