# 9.9 Taylor Polynomials

Consider a function $y=f(x)$ and a point $\bigl{(}c,f(c)\bigr{)}$. The derivative, $f\,^{\prime}(c)$, gives the instantaneous rate of change of $f$ at $x=c$. Of all lines that pass through the point $\bigl{(}c,f(c)\bigr{)}$, the line that best approximates $f$ at this point is the tangent line; that is, the line whose slope (rate of change) is $f\,^{\prime}(c)$.

margin: $\displaystyle f(0)$ $\displaystyle=2$ $\displaystyle f\,^{\prime\prime\prime}(0)$ $\displaystyle=-1$ $\displaystyle f\,^{\prime}(0)$ $\displaystyle=1$ $\displaystyle f\,^{(4)}(0)$ $\displaystyle=-12$ $\displaystyle f\,^{\prime\prime}(0)$ $\displaystyle=2$ $\displaystyle f\,^{(5)}(0)$ $\displaystyle=-19\vspace{-.5\baselineskip}$ Figure 9.9.1: Plotting $y=f(x)$ and a table of derivatives of $f$ evaluated at 0. Λ

In Figure 9.9.1, we see a function $y=f(x)$ graphed. The table below the graph shows that $f(0)=2$ and $f\,^{\prime}(0)=1$; therefore, the tangent line to $f$ at $x=0$ is $p_{1}(x)=1(x-0)+2=x+2$. The tangent line is also given in the figure. Note that “near” $x=0$, $p_{1}(x)\approx f(x)$; that is, the tangent line approximates $f$ well.

One shortcoming of this approximation is that the tangent line only matches the slope of $f$; it does not, for instance, match the concavity of $f$. We can find a polynomial, $p_{2}(x)$, that does match the concavity without much difficulty, though. The table in Figure 9.9.1 gives the following information:

 $f(0)=2\qquad f\,^{\prime}(0)=1\qquad f\,^{\prime\prime}(0)=2.$

Therefore, we want our polynomial $p_{2}(x)$ to have these same properties. That is, we need

 $p_{2}(0)=2\qquad p_{2}^{\prime}(0)=1\qquad p_{2}^{\prime\prime}(0)=2.$

This is simply an initial-value problem. We can solve this using the techniques first described in Section 5.1. To keep $p_{2}(x)$ as simple as possible, we’ll assume that not only $p_{2}^{\prime\prime}(0)=2$, but that $p_{2}^{\prime\prime}(x)=2$. That is, the second derivative of $p_{2}$ is constant.

margin: Figure 9.9.2: Plotting $f$, $p_{2}$, and $p_{4}$. Λ

If $p_{2}^{\prime\prime}(x)=2$, then $p_{2}^{\prime}(x)=2x+C$ for some constant $C$. Since we have determined that $p_{2}^{\prime}(0)=1$, we find that $C=1$ and so $p_{2}^{\prime}(x)=2x+1$. Finally, we can compute $p_{2}(x)=x^{2}+x+C$. Using our initial values, we know $p_{2}(0)=2$ so $C=2.$ We conclude that $p_{2}(x)=x^{2}+x+2.$ This function is plotted with $f$ in Figure 9.9.2.

We can repeat this approximation process by creating polynomials of higher degree that match more of the derivatives of $f$ at $x=0$. In general, a polynomial of degree $n$ can be created to match the first $n$ derivatives of $f$. Figure 9.9.2 also shows $p_{4}(x)=-x^{4}/2-x^{3}/6+x^{2}+x+2$, whose first four derivatives at 0 match those of $f$. (Using the table in Figure 9.9.1, start with $p_{4}^{(4)}(x)=-12$ and solve the related initial-value problem.)

margin: Figure 9.9.3: Plotting $f$ and $p_{13}$. Λ

As we use more and more derivatives, our polynomial approximation to $f$ gets better and better. In this example, the interval on which the approximation is “good” gets bigger and bigger. Figure 9.9.3 shows $p_{13}(x)$; we can visually affirm that this polynomial approximates $f$ very well on $[-2,3]$. The polynomial $p_{13}(x)$ is fairly complicated:

 $\scriptstyle\frac{16901x^{13}}{6227020800}+\frac{13x^{12}}{1209600}-\frac{1321% x^{11}}{39916800}-\frac{779x^{10}}{1814400}-\frac{359x^{9}}{362880}+\frac{x^{8% }}{240}+\frac{139x^{7}}{5040}+\frac{11x^{6}}{360}-\frac{19x^{5}}{120}-\frac{x^% {4}}{2}-\frac{x^{3}}{6}+x^{2}+x+2.$

The polynomials we have created are examples of Taylor polynomials, named after the British mathematician Brook Taylor who made important discoveries about such functions. While we created the above Taylor polynomials by solving initial-value problems, it can be shown that Taylor polynomials follow a general pattern that make their formation much more direct. This is described in the following definition.

###### Definition 9.9.1 Taylor Polynomial, Maclaurin Polynomial

Let $f$ be a function whose first $n$ derivatives exist at $x=c$.

1. (a)

The Taylor polynomial of degree $n$ of $f$ at $x=c$ is

 $\displaystyle p_{n}(x)$ $\displaystyle=f(c)+f\,^{\prime}(c)(x-c)+\frac{f\,^{\prime\prime}(c)}{2!}(x-c)^% {2}+\frac{f\,^{\prime\prime\prime}(c)}{3!}(x-c)^{3}+\dotsb+\frac{f\,^{(n)}(c)}% {n!}(x-c)^{n}$ $\displaystyle=\sum_{k=0}^{n}\frac{f\,^{(k)}(c)}{k!}(x-c)^{k}.$
2. (b)

A special case of the Taylor polynomial is the Maclaurin polynomial, where $c=0$. That is, the Maclaurin polynomial of degree $n$ of $f$ is

 $\displaystyle p_{n}(x)$ $\displaystyle=f(0)+f\,^{\prime}(0)x+\frac{f\,^{\prime\prime}(0)}{2!}x^{2}+% \frac{f\,^{\prime\prime\prime}(0)}{3!}x^{3}+\dotsb+\frac{f\,^{(n)}(0)}{n!}x^{n}$ $\displaystyle=\sum_{k=0}^{n}\frac{f\,^{(k)}(0)}{k!}x^{k}.$
margin: Note: The summations in this definition use the convention that $x^{0}=1$ even when $x=0$ and that $f^{(0)}=f$. They also use the definition that $0!=1$. Λ

Generally, we order the terms of a polynomial to have decreasing degrees, and that is how we began this section. This definition, and the rest of this chapter, reverses this order to reflect the greater importance of the lower degree terms in the polynomials that we will be finding.

We will practice creating Taylor and Maclaurin polynomials in the following examples.

###### Example 9.9.1 Finding and using Maclaurin polynomials

(a) Find the $n^{\text{th}}$ Maclaurin polynomial for $f(x)=e^{x}$. (b) Use $p_{5}(x)$ to approximate the value of $e$.

Solutionmargin: $\displaystyle f(x)$ $\displaystyle=e^{x}$ $\displaystyle\Rightarrow$ $\displaystyle f(0)$ $\displaystyle=1$ $\displaystyle f\,^{\prime}(x)$ $\displaystyle=e^{x}$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{\prime}(0)$ $\displaystyle=1$ $\displaystyle f\,^{\prime\prime}(x)$ $\displaystyle=e^{x}$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{\prime\prime}(0)$ $\displaystyle=1$ $\displaystyle\vdots$ $\displaystyle\vdots$ $\displaystyle f\,^{(n)}(x)$ $\displaystyle=e^{x}$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{(n)}(0)$ $\displaystyle=1$ Figure 9.9.4: The derivatives of $f(x)=e^{x}$ evaluated at $x=0$. Λ

1. (a)

We start with creating a table of the derivatives of $e^{x}$ evaluated at $x=0$. In this particular case, this is relatively simple, as shown in Figure 9.9.4. By the definition of the Maclaurin polynomial, we have

 $p_{n}(x)=\sum_{k=0}^{n}\frac{f\,^{(k)}(0)}{k!}x^{k}=\sum_{k=0}^{n}\frac{1}{k!}% x^{k}.$
2. (b)

Using our answer from part 1, we have

 $p_{5}(x)=1+x+\frac{1}{2}x^{2}+\frac{1}{6}x^{3}+\frac{1}{24}x^{4}+\frac{1}{120}% x^{5}.$

To approximate the value of $e$, note that $e=e^{1}=f(1)\approx p_{5}(1).$ It is very straightforward to evaluate $p_{5}(1)$: margin: Figure 9.9.5: A plot of $f(x)=e^{x}$ and its 5${}^{\text{th}}$ degree Maclaurin polynomial $p_{5}(x)$. Λ

 $p_{5}(1)=1+1+\frac{1}{2}+\frac{1}{6}+\frac{1}{24}+\frac{1}{120}=\frac{163}{60}% \approx 2.71667.$

This is an error of about $0.0016$, or $0.06\%$ of the true value.

A plot of $f(x)=e^{x}$ and $p_{5}(x)$ is given in Figure 9.9.5.

###### Example 9.9.2 Finding and using Taylor polynomials

(a) Find the $n^{\text{th}}$ Taylor polynomial of $y=\ln x$ at $x=1$. (b) Use $p_{6}(x)$ to approximate the value of $\ln 1.5$. (c) Use $p_{6}(x)$ to approximate the value of $\ln 2$.

Solution

1. (a)

We begin by creating a table of derivatives of $\ln x$ evaluated at $x=1$. While this is not as straightforward as it was in the previous example, a pattern does emerge, as shown in Figure 9.9.6. margin: $\displaystyle f(x)$ $\displaystyle=\ln x$ $\displaystyle\Rightarrow$ $\displaystyle f(1)$ $\displaystyle=\phantom{-}0$ $\displaystyle f\,^{\prime}(x)$ $\displaystyle=\phantom{-}1/x$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{\prime}(1)$ $\displaystyle=\phantom{-}1$ $\displaystyle f\,^{\prime\prime}(x)$ $\displaystyle=-1/x^{2}$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{\prime\prime}(1)$ $\displaystyle=-1$ $\displaystyle f\,^{\prime\prime\prime}(x)$ $\displaystyle=\phantom{-}2/x^{3}$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{\prime\prime\prime}(1)$ $\displaystyle=\phantom{-}2$ $\displaystyle f\,^{(4)}(x)$ $\displaystyle=-6/x^{4}$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{(4)}(1)$ $\displaystyle=-6$ $\displaystyle\vdots$ $\displaystyle\vdots$ $\displaystyle f\,^{(n)}(x)$ $\displaystyle=$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{(n)}(1)$ $\displaystyle=\vskip 3.0pt plus 1.0pt minus 1.0pt$ $\dfrac{(-1)^{n+1}(n-1)!}{x^{n}}$ $(-1)^{n+1}(n-1)!$ Figure 9.9.6: Derivatives of $\ln x$ evaluated at $x=1$. Λ

Using Definition 9.9.1, we have

 $p_{n}(x)=\sum_{k=0}^{n}\frac{f\,^{(k)}(c)}{k!}(x-c)^{k}=\sum_{k=1}^{n}\frac{(-% 1)^{k+1}}{k}(x-1)^{k}.$
2. (b)

We can compute $p_{6}(x)$ using our work above:

 $p_{6}(x)=(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}-\frac{1}{6}(x-1)^{6}.$

Since $p_{6}(x)$ approximates $\ln x$ well near $x=1$, we approximate $\ln 1.5\approx p_{6}(1.5)$:

 $\displaystyle p_{6}(1.5)$ $\displaystyle=(1.5-1)-\frac{1}{2}(1.5-1)^{2}+\frac{1}{3}(1.5-1)^{3}$ $\displaystyle\qquad\qquad{}-\frac{1}{4}(1.5-1)^{4}+\frac{1}{5}(1.5-1)^{5}-% \frac{1}{6}(1.5-1)^{6}$ $\displaystyle=\frac{259}{640}$ $\displaystyle\approx 0.404688.$
margin: Figure 9.9.7: A plot of $y=\ln x$ and its 6${}^{\text{th}}$ degree Taylor polynomial at $x=1$. Λ

This is a good approximation as a calculator shows that $\ln 1.5\approx 0.4055.$ Figure 9.9.7 plots $y=\ln x$ with $y=p_{6}(x)$. We can see that $\ln 1.5\approx p_{6}(1.5)$.

3. (c)

We approximate $\ln 2$ with $p_{6}(2)$:

 $\displaystyle p_{6}(2)$ $\displaystyle=(2-1)-\frac{1}{2}(2-1)^{2}+\frac{1}{3}(2-1)^{3}$ $\displaystyle\qquad\qquad{}-\frac{1}{4}(2-1)^{4}+\frac{1}{5}(2-1)^{5}-\frac{1}% {6}(2-1)^{6}$ $\displaystyle=1-\frac{1}{2}+\frac{1}{3}-\frac{1}{4}+\frac{1}{5}-\frac{1}{6}$ $\displaystyle=\frac{37}{60}$ $\displaystyle\approx 0.616667.$

This approximation is not terribly impressive: a hand held calculator shows that $\ln 2\approx 0.693147.$ The graph in Figure 9.9.7 shows that $p_{6}(x)$ provides less accurate approximations of $\ln x$ as $x$ gets close to 0 or 2.

margin: Figure 9.9.8: A plot of $y=\ln x$ and its 20${}^{\text{th}}$ degree Taylor polynomial at $x=1$. Λ

Surprisingly enough, even the 20${}^{\text{th}}$ degree Taylor polynomial fails to approximate $\ln x$ for $x>2$, as shown in Figure 9.9.8. We’ll soon discuss why this is.

Taylor polynomials are used to approximate functions $f(x)$ in mainly two situations:

1. (a)

When $f(x)$ is known, but perhaps “hard” to compute directly. For instance, we can define $y=\cos x$ as either the ratio of sides of a right triangle (“adjacent over hypotenuse”) or with the unit circle. However, neither of these provides a convenient way of computing $\cos 2$. A Taylor polynomial of sufficiently high degree can provide a reasonable method of computing such values using only operations usually hard-wired into a computer ($+$, $-$, $\times$ and $\div$).

2. (b)

When $f(x)$ is not known, but information about its derivatives is known. This occurs more often than one might think, especially in the study of differential equations.

margin: Note: Even though Taylor polynomials could be used in calculators and computers to calculate values of trigonometric functions, in practice they generally aren’t. Other more efficient and accurate methods have been developed, such as the CORDIC algorithm. Λ

In both situations, a critical piece of information to have is “How good is my approximation?” If we use a Taylor polynomial to compute $\cos 2$, how do we know how accurate the approximation is?

We had the same problem with Numerical Integration. Theorem 8.7.1 provided bounds on the error when using, say, Simpson’s Rule to approximate a definite integral. These bounds allowed us to determine that, for example, using $10$ subintervals provided an approximation within $\pm.01$ of the exact value. The following theorem gives similar bounds for Taylor (and hence Maclaurin) polynomials.

###### Theorem 9.9.1 Taylor’s Theorem

1. (a)

Let $f$ be a function whose $(n+1)^{\text{th}}$ derivative exists on an open interval $I$ and let $c$ be in $I$. Then, for each $x$ in $I$, there exists $z_{x}$ between $x$ and $c$ such that

 $f(x)=\sum_{k=0}^{n}\frac{f\,^{(k)}(c)}{k!}(x-c)^{k}+R_{n}(x),$

where $\displaystyle R_{n}(x)=\frac{f\,^{(n+1)}(z_{x})}{(n+1)!}(x-c)^{n+1}.$

2. (b)

$\left\lvert R_{n}(x)\right\rvert\leq\dfrac{\max_{z}\left\lvert\,f\,^{(n+1)}(z)% \right\rvert}{(n+1)!}\left\lvert x-c\right\rvert^{n+1}$, where $z$ is between $x$ and $c$.

The first part of Taylor’s Theorem states that $f(x)=p_{n}(x)+R_{n}(x)$, where $p_{n}(x)$ is the $n^{\text{th}}$ order Taylor polynomial and $R_{n}(x)$ is the remainder, or error, in the Taylor approximation. The second part gives bounds on how big that error can be. If the $(n+1)^{\text{th}}$ derivative is large, the error may be large; if $x$ is far from $c$, the error may also be large. However, the $(n+1)!$ term in the denominator tends to ensure that the error gets smaller as $n$ increases.

The following example computes error estimates for the approximations of $\ln 1.5$ and $\ln 2$ made in Example 9.9.2.

###### Example 9.9.3 Finding error bounds of a Taylor polynomial

Use Theorem 9.9.1 to find error bounds when approximating $\ln 1.5$ and $\ln 2$ with $p_{6}(x)$, the Taylor polynomial of degree 6 of $f(x)=\ln x$ at $x=1$, as calculated in Example 9.9.2.

Solution

1. (a)

We start with the approximation of $\ln 1.5$ with $p_{6}(1.5)$. Taylor’s Theorem references $\max\left\lvert f\,^{(n+1)}(z)\right\rvert$. In our situation, this is asking “How big can the $7^{\text{th}}$ derivative of $y=\ln x$ be on the interval $[1,1.5]$?” The seventh derivative is $y=-6!/x^{7}$. The largest absolute value it attains on $I$ is 720. Thus we can bound the error as:

 $\displaystyle\left\lvert R_{6}(1.5)\right\rvert$ $\displaystyle\leq\frac{\max\left\lvert f\,^{(7)}(z)\right\rvert}{7!}\left% \lvert 1.5-1\right\rvert^{7}$ $\displaystyle\leq\frac{720}{5040}\cdot\frac{1}{2^{7}}$ $\displaystyle\approx 0.001.$

We computed $p_{6}(1.5)=0.404688$; using a calculator, we find $\ln 1.5\approx 0.405465$, so the actual error is about $0.000778$ (or $0.2\%$), which is less than our bound of $0.001$. This affirms Taylor’s Theorem; the theorem states that our approximation would be within about one thousandth of the actual value, whereas the approximation was actually closer.

2. (b)

The maximum value of the seventh derivative of $f$ on $[1,2]$ again 720 (as the largest values come at $x=1$). Thus

 $\displaystyle\left\lvert R_{6}(2)\right\rvert$ $\displaystyle\leq\frac{\max\left\lvert f\,^{(7)}(z)\right\rvert}{7!}\left% \lvert 2-1\right\rvert^{7}$ $\displaystyle\leq\frac{720}{5040}\cdot 1^{7}$ $\displaystyle\approx 0.28.$

This bound is not as nearly as good as before. Using the degree 6 Taylor polynomial at $x=1$ will bring us within 0.3 of the correct answer. As $p_{6}(2)\approx 0.61667$, our error estimate guarantees that the actual value of $\ln 2$ is somewhere between $0.33667$ and $0.89667$. These bounds are not particularly useful.

In reality, our approximation was only off by about $0.07$ (or $11\%$). However, we are approximating ostensibly because we do not know the real answer. In order to be assured that we have a good approximation, we would have to resort to using a polynomial of higher degree.

We practice again. This time, we use Taylor’s theorem to find $n$ that guarantees our approximation is within a certain amount.

###### Example 9.9.4 Finding sufficiently accurate Taylor polynomials

Find $n$ such that the $n^{\text{th}}$ Taylor polynomial of $f(x)=\cos x$ at $x=0$ approximates $\cos 2$ to within $0.001$ of the actual answer. What is $p_{n}(2)$?

SolutionFollowing Taylor’s theorem, we need bounds on the size of the derivatives of $f(x)=\cos x$. In the case of this trigonometric function, this is easy. All derivatives of cosine are $\pm\sin x$ or $\pm\cos x$. In all cases, these functions are never greater than 1 in absolute value. We want the error to be less than $0.001$. To find the appropriate $n$, consider the following inequalities:

 $\displaystyle\frac{\max\left\lvert f\,^{(n+1)}(z)\right\rvert}{(n+1)!}\left% \lvert 2-0\right\rvert^{n+1}$ $\displaystyle\leq 0.001$ $\displaystyle\frac{1}{(n+1)!}\cdot 2^{n+1}$ $\displaystyle\leq 0.001$

We find an $n$ that satisfies this last inequality with trial-and-error. When $n=8$, we have $\displaystyle\frac{2^{8+1}}{(8+1)!}\approx 0.0014$; when $n=9$, we have $\displaystyle\frac{2^{9+1}}{(9+1)!}\approx 0.000282<0.001$. Thus we want to approximate $\cos 2$ with $p_{9}(2)$.

margin: $\displaystyle f(x)$ $\displaystyle=\phantom{-}\cos x$ $\displaystyle\Rightarrow$ $\displaystyle f(0)$ $\displaystyle=\phantom{-}1$ $\displaystyle f\,^{\prime}(x)$ $\displaystyle=-\sin x$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{\prime}(0)$ $\displaystyle=\phantom{-}0$ $\displaystyle f\,^{\prime\prime}(x)$ $\displaystyle=-\cos x$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{\prime\prime}(0)$ $\displaystyle=-1$ $\displaystyle f\,^{\prime\prime\prime}(x)$ $\displaystyle=\phantom{-}\sin x$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{\prime\prime\prime}(0)$ $\displaystyle=\phantom{-}0$ $\displaystyle f\,^{(4)}(x)$ $\displaystyle=\phantom{-}\cos x$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{(4)}(0)$ $\displaystyle=\phantom{-}1$ $\displaystyle f\,^{(5)}(x)$ $\displaystyle=-\sin x$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{(5)}(0)$ $\displaystyle=\phantom{-}0$ $\displaystyle f\,^{(6)}(x)$ $\displaystyle=-\cos x$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{(6)}(0)$ $\displaystyle=-1$ $\displaystyle f\,^{(7)}(x)$ $\displaystyle=\phantom{-}\sin x$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{(7)}(0)$ $\displaystyle=\phantom{-}0$ $\displaystyle f\,^{(8)}(x)$ $\displaystyle=\phantom{-}\cos x$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{(8)}(0)$ $\displaystyle=\phantom{-}1$ $\displaystyle f\,^{(9)}(x)$ $\displaystyle=-\sin x$ $\displaystyle\Rightarrow$ $\displaystyle f\,^{(9)}(0)$ $\displaystyle=\phantom{-}0$ Figure 9.9.9: A table of the derivatives of $f(x)=\cos x$ evaluated at $x=0$. Λ

We now set out to compute $p_{9}(x)$. We again need a table of the derivatives of $f(x)=\cos x$ evaluated at $x=0$. A table of these values is given in Figure 9.9.9. Notice how the derivatives, evaluated at $x=0$, follow a certain pattern. All the odd powers of $x$ in the Taylor polynomial will disappear as their coefficient is 0. While our error bounds state that we need $p_{9}(x)$, our work shows that this will be the same as $p_{8}(x)$.

Since we are forming our polynomial at $x=0$, we are creating a Maclaurin polynomial, and:

 $p_{8}(x)=\sum_{k=0}^{8}\frac{f\,^{(k)}(0)}{k!}x^{k}=1-\frac{1}{2!}x^{2}+\frac{% 1}{4!}x^{4}-\frac{1}{6!}x^{6}+\frac{1}{8!}x^{8}$

We finally approximate $\cos 2$:

 $\cos 2\approx p_{8}(2)=-\frac{131}{315}\approx-0.41587.$
margin: Figure 9.9.10: A graph of $f(x)=\cos x$ and its degree 8 Maclaurin polynomial. Λ

Our error bound guarantee that this approximation is within $0.001$ of the correct answer. Technology shows us that our approximation is actually within about $0.0003$ (or $0.07\%$) of the correct answer.

Figure 9.9.10 shows a graph of $y=p_{8}(x)$ and $y=\cos x$. Note how well the two functions agree on about $(-\pi,\pi)$.

###### Example 9.9.5 Finding and using Taylor polynomials

(a) Find the degree 4 Taylor polynomial, $p_{4}(x)$, for $f(x)=\sqrt{x}$ at $x=4.$ (b) Use $p_{4}(x)$ to approximate $\sqrt{3}$. (c) Find bounds on the error when approximating $\sqrt{3}$ with $p_{4}(3)$.

Solution

1. (a)

We begin by evaluating the derivatives of $f$ at $x=4$. This is done in Figure 9.9.11. These values allow us to form the Taylor polynomial $p_{4}(x)$: margin: $\displaystyle f(x)$ $\displaystyle=\sqrt{x}$ $\displaystyle\Rightarrow$ $\displaystyle f(4)$ $\displaystyle=2$ $\displaystyle\displaystyle f\,^{\prime}(x)$ $\displaystyle=\frac{1}{2\sqrt{x}}$ $\displaystyle\Rightarrow$ $\displaystyle\displaystyle f\,^{\prime}(4)$ $\displaystyle=\frac{1}{4}$ $\displaystyle\displaystyle f\,^{\prime\prime}(x)$ $\displaystyle=\frac{-1}{4x^{3/2}}$ $\displaystyle\Rightarrow$ $\displaystyle\displaystyle f\,^{\prime\prime}(4)$ $\displaystyle=\frac{-1}{32}$ $\displaystyle\displaystyle f\,^{\prime\prime\prime}(x)$ $\displaystyle=\frac{3}{8x^{5/2}}$ $\displaystyle\Rightarrow$ $\displaystyle\displaystyle f\,^{\prime\prime\prime}(4)$ $\displaystyle=\frac{3}{256}$ $\displaystyle\displaystyle f\,^{(4)}(x)$ $\displaystyle=\frac{-15}{16x^{7/2}}$ $\displaystyle\Rightarrow$ $\displaystyle\displaystyle f\,^{(4)}(4)$ $\displaystyle=\frac{-15}{2048}\vspace{-.5\baselineskip}$ Figure 9.9.11: A table of the derivatives of $f(x)=\sqrt{x}$ evaluated at $x=4$. Λ

 $p_{4}(x)=\\ 2+\frac{1}{4}(x-4)+\frac{-1/32}{2!}(x-4)^{2}+\frac{3/256}{3!}(x-4)^{3}+\frac{-% 15/2048}{4!}(x-4)^{4}.$
2. (b)

As $p_{4}(x)\approx\sqrt{x}$ near $x=4$, we approximate $\sqrt{3}$ with $p_{4}(3)=1.73212$.

3. (c)

The largest value the fifth derivative of $f(x)=\sqrt{x}$ takes on $[3,4]$ is when $x=3$, at about $0.0234$. Thus

 $\left\lvert R_{4}(3)\right\rvert\leq\frac{0.0234}{5!}\left\lvert 3-4\right% \rvert^{5}\approx 0.00019.$
margin: Figure 9.9.12: A graph of $f(x)=\sqrt{x}$ and its degree 4 Taylor polynomial at $x=4$. Λ

This shows our approximation is accurate to at least the first 2 places after the decimal. It turns out that our approximation has an error of $0.00007$, or $0.004\%$. A graph of $f(x)=\sqrt{x}$ and $p_{4}(x)$ is given in Figure 9.9.12. Note how the two functions are nearly indistinguishable on $(2,7)$.

Most of this chapter has been devoted to the study of infinite series. This section has stepped aside from this study, focusing instead on finite summation of terms. In the next section, we will combine power series and Taylor polynomials into Taylor Series, where we represent a function with an infinite series.

## Exercises 9.9

### Terms and Concepts

1. 1.

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

2. 2.

T/F: In general, $p_{n}(x)$ approximates $f(x)$ better and better as $n$ gets larger.

3. 3.

For some function $f(x)$, the Maclaurin polynomial of degree 4 is $p_{4}(x)=6+3x-4x^{2}+5x^{3}-7x^{4}$. What is $p_{2}(x)$?

4. 4.

For some function $f(x)$, the Maclaurin polynomial of degree 4 is $p_{4}(x)=6+3x-4x^{2}+5x^{3}-7x^{4}$. What is $f\,^{\prime\prime\prime}(0)$?

### Problems

In Exercises 5–12., find the Maclaurin polynomial of degree $n$ for the given function.

1. 5.

$f(x)=e^{-x},\quad n=3$

2. 6.

$f(x)=\sin x,\quad n=8$

3. 7.

$f(x)=x\cdot e^{x},\quad n=5$

4. 8.

$f(x)=\tan x,\quad n=6$

5. 9.

$f(x)=e^{2x},\quad n=4$

6. 10.

$\displaystyle f(x)=\frac{1}{1-x},\quad n=4$

7. 11.

$\displaystyle f(x)=\frac{1}{1+x},\quad n=4$

8. 12.

$\displaystyle f(x)=\frac{1}{1+x},\quad n=7$

In Exercises 13–20., find the Taylor polynomial of degree $n$, at $x=c$, for the given function.

1. 13.

$\displaystyle f(x)=\sqrt{x},\quad n=4,\quad c=1$

2. 14.

$\displaystyle f(x)=\ln(x+1),\quad n=4,\quad c=1$

3. 15.

$\displaystyle f(x)=\cos x,\quad n=6,\quad c=\pi/4$

4. 16.

$\displaystyle f(x)=\sin x,\quad n=5,\quad c=\pi/6$

5. 17.

$\displaystyle f(x)=\frac{1}{x},\quad n=5,\quad c=2$

6. 18.

$\displaystyle f(x)=\frac{1}{x^{2}},\quad n=8,\quad c=1$

7. 19.

$\displaystyle f(x)=\frac{1}{x^{2}+1},\quad n=3,\quad c=-1$

8. 20.

$\displaystyle f(x)=x^{2}\cos x,\quad n=2,\quad c=\pi$

In Exercises 21–24., approximate the function value with the indicated Taylor polynomial and give approximate bounds on the error.

1. 21.

Approximate $\sin 0.1$ with the Maclaurin polynomial of degree 3.

2. 22.

Approximate $\cos 1$ with the Maclaurin polynomial of degree 4.

3. 23.

Approximate $\sqrt{10}$ with the Taylor polynomial of degree 2 centered at $x=9$.

4. 24.

Approximate $\ln 1.5$ with the Taylor polynomial of degree 3 centered at $x=1$.

Exercises 25–28. ask for an $n$ to be found such that $p_{n}(x)$ approximates $f(x)$ within a certain bound of accuracy.

1. 25.

Find $n$ such that the Maclaurin polynomial of degree $n$ of $f(x)=e^{x}$ approximates $e$ within $0.0001$ of the actual value.

2. 26.

Find $n$ such that the Taylor polynomial of degree $n$ of $f(x)=\sqrt{x}$, centered at $x=4$, approximates $\sqrt{3}$ within $0.0001$ of the actual value.

3. 27.

Find $n$ such that the Maclaurin polynomial of degree $n$ of $f(x)=\cos x$ approximates $\cos\pi/3$ within $0.0001$ of the actual value.

4. 28.

Find $n$ such that the Maclaurin polynomial of degree $n$ of $f(x)=\sin x$ approximates $\cos\pi$ within $0.0001$ of the actual value.

In Exercises 29–34., find the $x^{n}$ term of the indicated Taylor polynomial.

1. 29.

Find a formula for the $x^{n}$ term of the Maclaurin polynomial for $f(x)=e^{x}$.

2. 30.

Find a formula for the $x^{n}$ term of the Maclaurin polynomial for $f(x)=\cos x$.

3. 31.

Find a formula for the $x^{n}$ term of the Maclaurin polynomial for $f(x)=\sin x$.

4. 32.

Find a formula for the $x^{n}$ term of the Maclaurin polynomial for $\displaystyle f(x)=\frac{1}{1-x}$.

5. 33.

Find a formula for the $x^{n}$ term of the Maclaurin polynomial for $\displaystyle f(x)=\frac{1}{1+x}$.

6. 34.

Find a formula for the $x^{n}$ term of the Taylor polynomial for $\displaystyle f(x)=\ln x$ centered at $c=1$.

In Exercises 35–36., approximate the solution to the given differential equation with a degree 4 Maclaurin polynomial.

1. 35.

$y^{\prime}=y$,   $y(0)=1$

2. 36.

$\displaystyle y^{\prime}=\frac{2}{y}$,  $y(0)=1$