Skip to main content
\(\require{cancel}\newcommand{\highlight}[1]{{\color{blue}{#1}}} \newcommand{\apex}{A\kern -1pt \lower -2pt\mbox{P}\kern -4pt \lower .7ex\mbox{E}\kern -1pt X} \newcommand{\colorlinecolor}{blue!95!black!30} \newcommand{\bwlinecolor}{black!30} \newcommand{\thelinecolor}{\colorlinecolor} \newcommand{\colornamesuffix}{} \newcommand{\linestyle}{[thick, \thelinecolor]} \newcommand{\bmx}[1]{\left[\hskip -3pt\begin{array}{#1} } \newcommand{\emx}{\end{array}\hskip -3pt\right]} \newcommand{\ds}{\displaystyle} \newcommand{\fp}{f'} \newcommand{\fpp}{f''} \newcommand{\lz}[2]{\frac{d#1}{d#2}} \newcommand{\lzn}[3]{\frac{d^{#1}#2}{d#3^{#1}}} \newcommand{\lzo}[1]{\frac{d}{d#1}} \newcommand{\lzoo}[2]{{\frac{d}{d#1}}{\left(#2\right)}} \newcommand{\lzon}[2]{\frac{d^{#1}}{d#2^{#1}}} \newcommand{\lzoa}[3]{\left.{\frac{d#1}{d#2}}\right|_{#3}} \newcommand{\plz}[2]{\frac{\partial#1}{\partial#2}} \newcommand{\plzoa}[3]{\left.{\frac{\partial#1}{\partial#2}}\right|_{#3}} \newcommand{\inflim}[1][n]{\lim\limits_{#1 \to \infty}} \newcommand{\infser}[1][1]{\sum_{n=#1}^\infty} \newcommand{\Fp}{F\primeskip'} \newcommand{\Fpp}{F\primeskip''} \newcommand{\yp}{y\primeskip'} \newcommand{\gp}{g\primeskip'} \newcommand{\dx}{\Delta x} \newcommand{\dy}{\Delta y} \newcommand{\ddz}{\Delta z} \newcommand{\thet}{\theta} \newcommand{\norm}[1]{\left\lVert#1\right\rVert} \newcommand{\vnorm}[1]{\left\lVert\vec #1\right\rVert} \newcommand{\snorm}[1]{\left|\left|\ #1\ \right|\right|} \newcommand{\la}{\left\langle} \newcommand{\ra}{\right\rangle} \newcommand{\dotp}[2]{\vec #1 \cdot \vec #2} \newcommand{\proj}[2]{\text{proj}_{\,\vec #2}{\,\vec #1}} \newcommand{\crossp}[2]{\vec #1 \times \vec #2} \newcommand{\veci}{\vec i} \newcommand{\vecj}{\vec j} \newcommand{\veck}{\vec k} \newcommand{\vecu}{\vec u} \newcommand{\vecv}{\vec v} \newcommand{\vecw}{\vec w} \newcommand{\vecx}{\vec x} \newcommand{\vecy}{\vec y} \newcommand{\vrp}{\vec r\, '} \newcommand{\vsp}{\vec s\, '} \newcommand{\vrt}{\vec r(t)} \newcommand{\vst}{\vec s(t)} \newcommand{\vvt}{\vec v(t)} \newcommand{\vat}{\vec a(t)} \newcommand{\px}{\partial x} \newcommand{\py}{\partial y} \newcommand{\pz}{\partial z} \newcommand{\pf}{\partial f} \newcommand{\mathN}{\mathbb{N}} \newcommand{\zerooverzero}{\ds \raisebox{8pt}{\text{``\ }}\frac{0}{0}\raisebox{8pt}{\textit{ ''}}} \newcommand{\deriv}[2]{\myds\frac{d}{dx}\left(#1\right)=#2} \newcommand{\myint}[2]{\myds\int #1\ dx= {\ds #2}} \DeclareMathOperator{\sech}{sech} \DeclareMathOperator{\csch}{csch} \newcommand{\primeskip}{\hskip.75pt} \newcommand{\plotlinecolor}{blue} \newcommand{\colorone}{blue} \newcommand{\colortwo}{red} \newcommand{\coloronefill}{blue!15!white} \newcommand{\colortwofill}{red!15!white} \newcommand{\abs}[1]{\left\lvert #1\right\rvert} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section8.7Taylor Polynomials

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

In <<Unresolved xref, reference "fig_taypolyintroa_1"; check spelling or use "provisional" attribute>>, we see a function \(y=f(x)\) graphed. The table in Figure 8.7.1.(b) that \(f(0)=2\) and \(\fp(0) = 1\text{;}\) therefore, the tangent line to \(f\) at \(x=0\) is \(p_1(x) = 1(x-0)+2 = x+2\text{.}\) The tangent line is also given in the figure. Note that “near” \(x=0\text{,}\) \(p_1(x) \approx f(x)\text{;}\) that is, the tangent line approximates \(f\) well.

<<SVG image is unavailable, or your browser cannot render it>>

\(f(0) = 2\) \(\fp''(0) = -1\)
\(\fp(0) = 1\) \(f^{(4)}(0)=-12\)
\(\fpp(0) = 2\) \(f^{(5)}(0)=-19\)
(a)A graph of \(f(x)\) and its tangent line at \(0\text{.}\)
(b)Derivatives of \(f\) evaluated at \(0\text{.}\)

One shortcoming of this approximation is that the tangent line only matches the slope of \(f\text{;}\) it does not, for instance, match the concavity of \(f\text{.}\) We can find a polynomial, \(p_2(x)\text{,}\) that does match the concavity near \(0\) without much difficulty, though. The table in Figure 8.7.1 gives the following information: \begin{equation*} f(0) = 2 \qquad \fp(0) = 1\qquad \fp'(0) = 2. \end{equation*}

Therefore, we want our polynomial \(p_2(x)\) to have these same properties. That is, we need \begin{equation*} p_2(0) = 2 \qquad p_2'(0) = 1 \qquad p_2''(0) = 2. \end{equation*}

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''(0)=2\text{,}\) but that \(p_2''(x)=2\text{.}\) That is, the second derivative of \(p_2\) is constant, meaning \(p_2\) is a quadratic function.

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

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

<<SVG image is unavailable, or your browser cannot render it>>

Figure8.7.2Plotting \(f\text{,}\) \(p_2\) and \(p_4\text{.}\)

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 8.7.3 shows \(p_{13}(x)\text{;}\) we can visually affirm that this polynomial approximates \(f\) very well on \([-2,3]\text{.}\) (The polynomial \(p_{13}(x)\) is not particularly “nice”. It is \begin{align*} \amp p_{13}=(x)\frac{16901x^{13}}{6227020800}+\frac{13x^{12}}{1209600}-\frac{1321x^{11}}{39916800}-\frac{779x^{10}}{1814400} -\frac{359x^9}{362880}\\ \amp +\frac{x^8}{240}+\frac{139x^7}{5040}+\frac{11 x^6}{360}-\frac{19x^5}{120}-\frac{x^4}{2}-\frac{x^3}{6}+x^2+x+2 \end{align*}

<<SVG image is unavailable, or your browser cannot render it>>

Figure8.7.3Plotting \(f\) and \(p_{13}\text{.}\)

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.

Definition8.7.4Taylor Polynomial, Maclaurin Polynomial

Let \(f\) be a function whose first \(n\) derivatives exist at \(x=c\text{.}\)

  1. The Taylor polynomial of degree \(n\) of \(f\) at \(x=c\) is \begin{equation*} p_n(x) = f(c) + \fp(c)(x-c) + \frac{\fpp(c)}{2!}(x-c)^2+\frac{\fp''(c)}{3!}(x-c)^3+\cdots+\frac{f^{(n)}(c)}{n!}(x-c)^n. \end{equation*}

  2. A special case of the Taylor polynomial is the Maclaurin polynomial, where \(c=0\text{.}\) That is, the Maclaurin polynomial of degree \(n\) of \(f\) is \begin{equation*} p_n(x) = f(0) + \fp(0)x + \frac{\fpp(0)}{2!}x^2+\frac{\fp''(0)}{3!}x^3+\cdots+\frac{f^{(n)}(0)}{n!}x^n. \end{equation*}

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

Example8.7.5Finding and using Maclaurin polynomials
  1. Find the \(n^\text{ th }\) Maclaurin polynomial for \(f(x) = e^x\text{.}\)

  2. Use \(p_5(x)\) to approximate the value of \(e\text{.}\)

Example8.7.8Finding and using Taylor polynomials
  1. Find the \(n^\text{ th }\) Taylor polynomial of \(y=\ln(x)\) at \(x=1\text{.}\)

  2. Use \(p_6(x)\) to approximate the value of \(\ln(1.5)\text{.}\)

  3. Use \(p_6(x)\) to approximate the value of \(\ln(2)\text{.}\)


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

  1. 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 as the horizontal coordinate where the terminal ray of an angle intersects the unit circle. However, neither of these provides a convenient way of computing \(\cos(2)\) (as with all calculus, we default to using radian measure, so this is an angle of \(2\) radians). 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 (\(+\text{,}\) \(-\text{,}\) × and \(\div\)).

  2. 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.

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. However, understanding how Taylor polynomials could be used is important to developing an understanding of various approximating techniques.

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)\text{,}\) how do we know how accurate the approximation is?

We had the same problem when studying Numerical Integration. Theorem 5.5.24 provided bounds on the error when using, say, Simpson's Rule to approximate a definite integral. These bounds allowed us to determine that, for instance, 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.

The first part of Taylor's Theorem states that \(f(x) = p_n(x) + R_n(x)\text{,}\) 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\text{,}\) 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 8.7.8.

Example8.7.13Finding error bounds of a Taylor polynomial

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


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

Example8.7.14Finding 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)\text{?}\)

Example8.7.17Finding and using Taylor polynomials
  1. Find the degree 4 Taylor polynomial, \(p_4(x)\text{,}\) for \(f(x)=\sqrt{x}\) at \(x=4\text{.}\)

  2. Use \(p_4(x)\) to approximate \(\sqrt{3}\text{.}\)

  3. Find bounds on the error when approximating \(\sqrt{3}\) with \(p_4(3)\text{.}\)


Our final example gives a brief introduction to using Taylor polynomials to solve differential equations.

Example8.7.20Approximating an unknown function

A function \(y=f(x)\) is unknown save for the following two facts.

  1. \(y(0) = f(0) = 1\text{,}\) and

  2. \(y'= y^2\)

(This second fact says that amazingly, the derivative of the function is actually the function squared!)

Find the degree 3 Maclaurin polynomial \(p_3(x)\) of \(y=f(x)\text{.}\)


It is beyond the scope of this text to pursue error analysis when using Taylor polynomials to approximate solutions to differential equations. This topic is often broached in introductory Differential Equations courses and usually covered in depth in Numerical Analysis courses. Such an analysis is very important; one needs to know how good their approximation is. We explored this example simply to demonstrate the usefulness of Taylor polynomials.

Most of this chapter has been devoted to the study of infinite series. This section has taken a step back from this study, focusing instead on finite summation of terms. In the next section, we explore Taylor Series, where we represent a function with an infinite series.