## Finding Taylor Polynomials

### Learning Outcomes

• Describe the procedure for finding a Taylor polynomial of a given order for a function

## Overview of Taylor/Maclaurin Series

Consider a function $f$ that has a power series representation at $x=a$. Then the series has the form

$\displaystyle\sum _{n=0}^{\infty }{c}_{n}{\left(x-a\right)}^{n}={c}_{0}+{c}_{1}\left(x-a\right)+{c}_{2}{\left(x-a\right)}^{2}+\cdots$.

What should the coefficients be? For now, we ignore issues of convergence, but instead focus on what the series should be, if one exists. We return to discuss convergence later in this section. If the series in the above equation is a representation for $f$ at $x=a$, we certainly want the series to equal $f\left(a\right)$ at $x=a$. Evaluating the series at $x=a$, we see that

$\begin{array}{cc}\hfill \displaystyle\sum _{n=0}^{\infty }{c}_{n}{\left(x-a\right)}^{n}& ={c}_{0}+{c}_{1}\left(a-a\right)+{c}_{2}{\left(a-a\right)}^{2}+\cdots \hfill \\ & ={c}_{0}.\hfill \end{array}$

Thus, the series equals $f\left(a\right)$ if the coefficient ${c}_{0}=f\left(a\right)$. In addition, we would like the first derivative of the power series to equal ${f}^{\prime }\left(a\right)$ at $x=a$. Differentiating our initial equation term-by-term, we see that

$\frac{d}{dx}\left(\displaystyle\sum _{n=0}^{\infty }{c}_{n}{\left(x-a\right)}^{n}\right)={c}_{1}+2{c}_{2}\left(x-a\right)+3{c}_{3}{\left(x-a\right)}^{2}+\cdots$.

Therefore, at $x=a$, the derivative is

$\begin{array}{}\\ \\ \hfill \frac{d}{dx}\left(\displaystyle\sum _{n=0}^{\infty }{c}_{n}{\left(x-a\right)}^{n}\right)& ={c}_{1}+2{c}_{2}\left(a-a\right)+3{c}_{3}{\left(a-a\right)}^{2}+\cdots \hfill \\ & ={c}_{1}.\hfill \end{array}$

Therefore, the derivative of the series equals ${f}^{\prime }\left(a\right)$ if the coefficient ${c}_{1}={f}^{\prime }\left(a\right)$. Continuing in this way, we look for coefficients cn such that all the derivatives of the power series will agree with all the corresponding derivatives of $f$ at $x=a$. The second and third derivatives of our initial equation are given by

$\frac{{d}^{2}}{d{x}^{2}}\left(\displaystyle\sum _{n=0}^{\infty }{c}_{n}{\left(x-a\right)}^{n}\right)=2{c}_{2}+3\cdot 2{c}_{3}\left(x-a\right)+4\cdot 3{c}_{4}{\left(x-a\right)}^{2}+\cdots$

and

$\frac{{d}^{3}}{d{x}^{3}}\left(\displaystyle\sum _{n=0}^{\infty }{c}_{n}{\left(x-a\right)}^{n}\right)=3\cdot 2{c}_{3}+4\cdot 3\cdot 2{c}_{4}\left(x-a\right)+5\cdot 4\cdot 3{c}_{5}{\left(x-a\right)}^{2}+\cdots$.

Therefore, at $x=a$, the second and third derivatives

$\begin{array}{cc}\hfill \frac{{d}^{2}}{d{x}^{2}}\left(\displaystyle\sum _{n=0}^{\infty }{c}_{n}{\left(x-a\right)}^{n}\right)& =2{c}_{2}+3\cdot 2{c}_{3}\left(a-a\right)+4\cdot 3{c}_{4}{\left(a-a\right)}^{2}+\cdots \hfill \\ & =2{c}_{2}\hfill \end{array}$

and

$\begin{array}{cc}\hfill \frac{{d}^{3}}{d{x}^{3}}\left(\displaystyle\sum _{n=0}^{\infty }{c}_{n}{\left(x-a\right)}^{n}\right)& =3\cdot 2{c}_{3}+4\cdot 3\cdot 2{c}_{4}\left(a-a\right)+5\cdot 4\cdot 3{c}_{5}{\left(a-a\right)}^{2}+\cdots \hfill \\ & =3\cdot 2{c}_{3}\hfill \end{array}$

equal $f^{\prime\prime} \left(a\right)$ and $f^{\prime\prime\prime}\left(a\right)$, respectively, if ${c}_{2}=\frac{f^{\prime\prime}\left(a\right)}{2}$ and ${c}_{3}=\frac{f^{\prime\prime\prime}\left(a\right)}{3}\cdot 2$. More generally, we see that if $f$ has a power series representation at $x=a$, then the coefficients should be given by ${c}_{n}=\frac{{f}^{\left(n\right)}\left(a\right)}{n\text{!}}$. That is, the series should be

$\displaystyle\sum _{n=0}^{\infty }\frac{{f}^{\left(n\right)}\left(a\right)}{n\text{!}}{\left(x-a\right)}^{n}=f\left(a\right)+{f}^{\prime }\left(a\right)\left(x-a\right)+\frac{f^{\prime\prime}\left(a\right)}{2\text{!}}{\left(x-a\right)}^{2}+\frac{f^{\prime\prime\prime}\left(a\right)}{3\text{!}}{\left(x-a\right)}^{3}+\cdots$.

This power series for $f$ is known as the Taylor series for $f$ at $a$. If $a=0$, then this series is known as the Maclaurin series for $f$.

### Definition

If $f$ has derivatives of all orders at $x=a$, then the Taylor series for the function $f$ at $a$ is

$\displaystyle\sum _{n=0}^{\infty }\frac{{f}^{\left(n\right)}\left(a\right)}{n\text{!}}{\left(x-a\right)}^{n}=f\left(a\right)+{f}^{\prime }\left(a\right)\left(x-a\right)+\frac{f^{\prime\prime}\left(a\right)}{2\text{!}}{\left(x-a\right)}^{2}+\cdots +\frac{{f}^{\left(n\right)}\left(a\right)}{n\text{!}}{\left(x-a\right)}^{n}+\cdots$.

The Taylor series for $f$ at 0 is known as the Maclaurin series for $f$.

Later in this section, we will show examples of finding Taylor series and discuss conditions under which the Taylor series for a function will converge to that function. Here, we state an important result. Recall from Uniqueness of Power Series that power series representations are unique. Therefore, if a function $f$ has a power series at $a$, then it must be the Taylor series for $f$ at $a$.

### theorem: Uniqueness of Taylor Series

If a function $f$ has a power series at a that converges to $f$ on some open interval containing a, then that power series is the Taylor series for $f$ at a.

The proof follows directly from Uniqueness of Power Series.

To determine if a Taylor series converges, we need to look at its sequence of partial sums. These partial sums are finite polynomials, known as Taylor polynomials.

### Interactive

Visit the MacTutor History of Mathematics archive to read a biography of Brook Taylor and a biography of Colin Maclaurin and how they developed the concepts named after them.

## Taylor Polynomials

The nth partial sum of the Taylor series for a function $f$ at $a$ is known as the nth Taylor polynomial. For example, the 0th, 1st, 2nd, and 3rd partial sums of the Taylor series are given by

$\begin{array}{c}{p}_{0}\left(x\right)=f\left(a\right),\hfill \\ {p}_{1}\left(x\right)=f\left(a\right)+{f}^{\prime }\left(a\right)\left(x-a\right),\hfill \\ {p}_{2}\left(x\right)=f\left(a\right)+{f}^{\prime }\left(a\right)\left(x-a\right)+\frac{f^{\prime\prime}\left(a\right)}{2\text{!}}{\left(x-a\right)}^{2},\hfill \\ {p}_{3}\left(x\right)=f\left(a\right)+{f}^{\prime }\left(a\right)\left(x-a\right)+\frac{f^{\prime\prime}\left(a\right)}{2\text{!}}{\left(x-a\right)}^{2}+\frac{f^{\prime\prime\prime}\left(a\right)}{3\text{!}}{\left(x-a\right)}^{3},\hfill \end{array}$

respectively. These partial sums are known as the 0th, 1st, 2nd, and 3rd Taylor polynomials of $f$ at $a$, respectively. If $a=0$, then these polynomials are known as Maclaurin polynomials for $f$. We now provide a formal definition of Taylor and Maclaurin polynomials for a function $f$.

### Definition

If $f$ has n derivatives at $x=a$, then the nth Taylor polynomial for $f$ at $a$ is

${p}_{n}\left(x\right)=f\left(a\right)+{f}^{\prime }\left(a\right)\left(x-a\right)+\frac{f^{\prime\prime}\left(a\right)}{2\text{!}}{\left(x-a\right)}^{2}+\frac{f^{\prime\prime\prime}\left(a\right)}{3\text{!}}{\left(x-a\right)}^{3}+\cdots +\frac{{f}^{\left(n\right)}\left(a\right)}{n\text{!}}{\left(x-a\right)}^{n}$.

The $n$th Taylor polynomial for $f$ at $0$ is known as the $n$th Maclaurin polynomial for $f$.

We now show how to use this definition to find several Taylor polynomials for $f\left(x\right)=\text{ln}x$ at $x=1$.

### Example: Finding Taylor Polynomials

Find the Taylor polynomials ${p}_{0},{p}_{1},{p}_{2}$ and ${p}_{3}$ for $f\left(x\right)=\text{ln}x$ at $x=1$. Use a graphing utility to compare the graph of $f$ with the graphs of ${p}_{0},{p}_{1},{p}_{2}$ and ${p}_{3}$.

Watch the following video to see the worked solution to Example: Finding Taylor Polynomials.

For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.

### try it

Find the Taylor polynomials ${p}_{0},{p}_{1},{p}_{2}$ and ${p}_{3}$ for $f\left(x\right)=\frac{1}{{x}^{2}}$ at $x=1$.

### Try It

We now show how to find Maclaurin polynomials for ex, $\sin{x}$, and $\cos{x}$. As stated above, Maclaurin polynomials are Taylor polynomials centered at zero.

### Example: Finding Maclaurin Polynomials

For each of the following functions, find formulas for the Maclaurin polynomials ${p}_{0},{p}_{1},{p}_{2}$ and ${p}_{3}$. Find a formula for the nth Maclaurin polynomial and write it using sigma notation. Use a graphing utilty to compare the graphs of ${p}_{0},{p}_{1},{p}_{2}$ and ${p}_{3}$ with $f$.

1. $f\left(x\right)={e}^{x}$
2. $f\left(x\right)=\sin{x}$
3. $f\left(x\right)=\cos{x}$

Watch the following video to see the worked solution to Example: Finding Maclaurin Polynomials.

For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.

### try it

Find formulas for the Maclaurin polynomials ${p}_{0},{p}_{1},{p}_{2}$ and ${p}_{3}$ for $f\left(x\right)=\frac{1}{1+x}$. Find a formula for the nth Maclaurin polynomial. Write your anwer using sigma notation.