Taylor’s Theorem with Remainder and Convergence

Learning Outcomes

• Explain the meaning and significance of Taylor’s theorem with remainder
• Estimate the remainder for a Taylor series approximation of a given function

Taylor’s Theorem with Remainder

Recall that the $n$th Taylor polynomial for a function $f$ at $a$ is the $n$th partial sum of the Taylor series for $f$ at $a$. Therefore, to determine if the Taylor series converges, we need to determine whether the sequence of Taylor polynomials $\left\{{p}_{n}\right\}$ converges. However, not only do we want to know if the sequence of Taylor polynomials converges, we want to know if it converges to $f$. To answer this question, we define the remainder ${R}_{n}\left(x\right)$ as

${R}_{n}\left(x\right)=f\left(x\right)-{p}_{n}\left(x\right)$.

For the sequence of Taylor polynomials to converge to $f$, we need the remainder $R_{n}$ to converge to zero. To determine if $R_{n}$ converges to zero, we introduce Taylor’s theorem with remainder. Not only is this theorem useful in proving that a Taylor series converges to its related function, but it will also allow us to quantify how well the $n$th Taylor polynomial approximates the function.

Here we look for a bound on $|{R}_{n}|$. Consider the simplest case: $n=0$. Let $p_{0}$ be the 0th Taylor polynomial at $a$ for a function $f$. The remainder $R_{0}$ satisfies

$\begin{array}{cc}\hfill {R}_{0}\left(x\right)& =f\left(x\right)-{p}_{0}\left(x\right)\hfill \\ & =f\left(x\right)-f\left(a\right).\hfill \end{array}$

If $f$ is differentiable on an interval $I$ containing $a$ and $x$, then by the Mean Value Theorem there exists a real number $c$ between $a$ and $x$ such that $f\left(x\right)-f\left(a\right)={f}^{\prime }\left(c\right)\left(x-a\right)$. Therefore,

${R}_{0}\left(x\right)={f}^{\prime }\left(c\right)\left(x-a\right)$.

Using the Mean Value Theorem in a similar argument, we can show that if $f$ is $n$ times differentiable on an interval $I$ containing $a$ and $x$, then the $n$th remainder ${R}_{n}$ satisfies

${R}_{n}\left(x\right)=\frac{{f}^{\left(n+1\right)}\left(c\right)}{\left(n+1\right)\text{!}}{\left(x-a\right)}^{n+1}$

for some real number $c$ between $a$ and $x$. It is important to note that the value $c$ in the numerator above is not the center $a$, but rather an unknown value $c$ between $a$ and $x$. This formula allows us to get a bound on the remainder ${R}_{n}$. If we happen to know that $|{f}^{\left(n+1\right)}\left(x\right)|$ is bounded by some real number $M$ on this interval $I$, then

$|{R}_{n}\left(x\right)|\le \frac{M}{\left(n+1\right)\text{!}}{|x-a|}^{n+1}$

for all $x$ in the interval $I$.

We now state Taylor’s theorem, which provides the formal relationship between a function $f$ and its $n$th degree Taylor polynomial ${p}_{n}\left(x\right)$. This theorem allows us to bound the error when using a Taylor polynomial to approximate a function value, and will be important in proving that a Taylor series for $f$ converges to $f$.

theorem: Taylor’s Theorem with Remainder

Let $f$ be a function that can be differentiated $n+1$ times on an interval $I$ containing the real number $a$. Let $p_{n}$ be the $n$th Taylor polynomial of $f$ at $a$ and let

${R}_{n}\left(x\right)=f\left(x\right)-{p}_{n}\left(x\right)$

be the $n$th remainder. Then for each $x$ in the interval $I$, there exists a real number $c$ between $a$ and $x$ such that

${R}_{n}\left(x\right)=\frac{{f}^{\left(n+1\right)}\left(c\right)}{\left(n+1\right)\text{!}}{\left(x-a\right)}^{n+1}$.

If there exists a real number $M$ such that $|{f}^{\left(n+1\right)}\left(x\right)|\le M$ for all $x\in I$, then

$|{R}_{n}\left(x\right)|\le \frac{M}{\left(n+1\right)\text{!}}{|x-a|}^{n+1}$

for all $x$ in $I$.

Proof

Fix a point $x\in I$ and introduce the function g such that

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

We claim that g satisfies the criteria of Rolle’s theorem. Since g is a polynomial function (in t), it is a differentiable function. Also, g is zero at $t=a$ and $t=x$ because

$\begin{array}{ccc}\hfill g\left(a\right)& =\hfill & f\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}+\cdots +\frac{{f}^{\left(n\right)}\left(a\right)}{n\text{!}}{\left(x-a\right)}^{n}-{R}_{n}\left(x\right)\hfill \\ & =\hfill & f\left(x\right)-{p}_{n}\left(x\right)-{R}_{n}\left(x\right)\hfill \\ & =\hfill & 0,\hfill \\ g\left(x\right)\hfill & =\hfill & f\left(x\right)-f\left(x\right)-0-\cdots -0\hfill \\ & =\hfill & 0.\hfill \end{array}$

Therefore, g satisfies Rolle’s theorem, and consequently, there exists c between a and x such that ${g}^{\prime }\left(c\right)=0$. We now calculate ${g}^{\prime }$. Using the product rule, we note that

$\frac{d}{dt}\left[\frac{{f}^{\left(n\right)}\left(t\right)}{n\text{!}}{\left(x-t\right)}^{n}\right]=\frac{-{f}^{\left(n\right)}\left(t\right)}{\left(n - 1\right)\text{!}}{\left(x-t\right)}^{n - 1}+\frac{{f}^{\left(n+1\right)}\left(t\right)}{n\text{!}}{\left(x-t\right)}^{n}$.

Consequently,

$\begin{array}{cc}{g}^{\prime }\left(t\right)\hfill & = -{f}^{\prime }\left(t\right)+\left[{f}^{\prime }\left(t\right)-f^{\prime\prime}\left(t\right)\left(x-t\right)\right]+\left[f^{\prime\prime}\left(t\right)\left(x-t\right)-\frac{f^{\prime\prime\prime}\left(t\right)}{2\text{!}}{\left(x-t\right)}^{2}\right]+\cdots \hfill \\ & +\left[\frac{{f}^{\left(n\right)}\left(t\right)}{\left(n - 1\right)\text{!}}{\left(x-t\right)}^{n - 1}-\frac{{f}^{\left(n+1\right)}\left(t\right)}{n\text{!}}{\left(x-t\right)}^{n}\right]+\left(n+1\right){R}_{n}\left(x\right)\frac{{\left(x-t\right)}^{n}}{{\left(x-a\right)}^{n+1}}.\hfill \end{array}$

Notice that there is a telescoping effect. Therefore,

${g}^{\prime }\left(t\right)=-\frac{{f}^{\left(n+1\right)}\left(t\right)}{n\text{!}}{\left(x-t\right)}^{n}+\left(n+1\right){R}_{n}\left(x\right)\frac{{\left(x-t\right)}^{n}}{{\left(x-a\right)}^{n+1}}$.

By Rolle’s theorem, we conclude that there exists a number c between a and x such that ${g}^{\prime }\left(c\right)=0$. Since

${g}^{\prime }\left(c\right)=-\frac{{f}^{\left(n+1\right)}\left(c\right)}{n\text{!}}{\left(x-c\right)}^{n}+\left(n+1\right){R}_{n}\left(x\right)\frac{{\left(x-c\right)}^{n}}{{\left(x-a\right)}^{n+1}}$

we conclude that

$-\frac{{f}^{\left(n+1\right)}\left(c\right)}{n\text{!}}{\left(x-c\right)}^{n}+\left(n+1\right){R}_{n}\left(x\right)\frac{{\left(x-c\right)}^{n}}{{\left(x-a\right)}^{n+1}}=0$.

Adding the first term on the left-hand side to both sides of the equation and dividing both sides of the equation by $n+1$, we conclude that

${R}_{n}\left(x\right)=\frac{{f}^{\left(n+1\right)}\left(c\right)}{\left(n+1\right)\text{!}}{\left(x-a\right)}^{n+1}$

as desired. From this fact, it follows that if there exists M such that $|{f}^{\left(n+1\right)}\left(x\right)|\le M$ for all x in I, then

$|{R}_{n}\left(x\right)|\le \frac{M}{\left(n+1\right)\text{!}}{|x-a|}^{n+1}$.

$_\blacksquare$

Not only does Taylor’s theorem allow us to prove that a Taylor series converges to a function, but it also allows us to estimate the accuracy of Taylor polynomials in approximating function values. We begin by looking at linear and quadratic approximations of $f\left(x\right)=\sqrt[3]{x}$ at $x=8$ and determine how accurate these approximations are at estimating $\sqrt[3]{11}$.

Example: Using Linear and Quadratic Approximations to Estimate Function Values

Consider the function $f\left(x\right)=\sqrt[3]{x}$.

1. Find the first and second Taylor polynomials for $f$ at $x=8$. Use a graphing utility to compare these polynomials with $f$ near $x=8$.
2. Use these two polynomials to estimate $\sqrt[3]{11}$.
3. Use Taylor’s theorem to bound the error.

Watch the following video to see the worked solution to Example: Using Linear and Quadratic Approximations to Estimate Function Values.

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 first and second Taylor polynomials for $f\left(x\right)=\sqrt{x}$ at $x=4$. Use these polynomials to estimate $\sqrt{6}$. Use Taylor’s theorem to bound the error.

Example: Approximating sinx using maclaurin polynomials

From the Example: Finding Maclaurin Polynomials, the Maclaurin polynomials for $\sin{x}$ are given by

$\begin{array}{cc}\hfill {p}_{2m+1}\left(x\right)& ={p}_{2m+2}\left(x\right)\hfill \\ & =x-\frac{{x}^{3}}{3\text{!}}+\frac{{x}^{5}}{5\text{!}}-\frac{{x}^{7}}{7\text{!}}+\cdots +{\left(-1\right)}^{m}\frac{{x}^{2m+1}}{\left(2m+1\right)\text{!}}\hfill \end{array}$

for $m=0,1,2,\dots$.

1. Use the fifth Maclaurin polynomial for $\sin{x}$ to approximate $\sin\left(\frac{\pi }{18}\right)$ and bound the error.
2. For what values of $x$ does the fifth Maclaurin polynomial approximate $\sin{x}$ to within 0.0001?

Watch the following video to see the worked solution to Example: Approximating sin x Using 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

Use the fourth Maclaurin polynomial for $\cos{x}$ to approximate $\cos\left(\frac{\pi }{12}\right)$.

Now that we are able to bound the remainder ${R}_{n}\left(x\right)$, we can use this bound to prove that a Taylor series for $f$ at $a$ converges to $f$.

Representing Functions with Taylor and Maclaurin Series

We now discuss issues of convergence for Taylor series. We begin by showing how to find a Taylor series for a function, and how to find its interval of convergence.

Example: Finding a Taylor Series

Find the Taylor series for $f\left(x\right)=\frac{1}{x}$ at $x=1$. Determine the interval of convergence.

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

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 series for $f\left(x\right)=\frac{1}{2x}$ at $x=2$ and determine its interval of convergence.

We know that the Taylor series found in this example converges on the interval $\left(0,2\right)$, but how do we know it actually converges to $f?$ We consider this question in more generality in a moment, but for this example, we can answer this question by writing

$f\left(x\right)=\frac{1}{x}=\frac{1}{1-\left(1-x\right)}$.

That is, $f$ can be represented by the geometric series $\displaystyle\sum _{n=0}^{\infty }{\left(1-x\right)}^{n}$. Since this is a geometric series, it converges to $\frac{1}{x}$ as long as $|1-x|<1$. Therefore, the Taylor series found in the previous example does converge to $f\left(x\right)=\frac{1}{x}$ on $\left(0,2\right)$.

We now consider the more general question: if a Taylor series for a function $f$ converges on some interval, how can we determine if it actually converges to $f?$ To answer this question, recall that a series converges to a particular value if and only if its sequence of partial sums converges to that value. Given a Taylor series for $f$ at a, the nth partial sum is given by the nth Taylor polynomial pn. Therefore, to determine if the Taylor series converges to $f$, we need to determine whether

$\underset{n\to \infty }{\text{lim}}{p}_{n}\left(x\right)=f\left(x\right)$.

Since the remainder ${R}_{n}\left(x\right)=f\left(x\right)-{p}_{n}\left(x\right)$, the Taylor series converges to $f$ if and only if

$\underset{n\to \infty }{\text{lim}}{R}_{n}\left(x\right)=0$.

We now state this theorem formally.

Theorem: Convergence of Taylor Series

Suppose that $f$ has derivatives of all orders on an interval $I$ containing $a$. Then the Taylor series

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

converges to $f\left(x\right)$ for all $x$ in $I$ if and only if

$\underset{n\to\infty}\lim {R}_{n}\left(x\right)=0$

for all $x$ in $I$.

With this theorem, we can prove that a Taylor series for $f$ at a converges to $f$ if we can prove that the remainder ${R}_{n}\left(x\right)\to 0$. To prove that ${R}_{n}\left(x\right)\to 0$, we typically use the bound

$|{R}_{n}\left(x\right)|\le \frac{M}{\left(n+1\right)\text{!}}{|x-a|}^{n+1}$

from Taylor’s theorem with remainder.

In the next example, we find the Maclaurin series for ex and $\sin{x}$ and show that these series converge to the corresponding functions for all real numbers by proving that the remainders ${R}_{n}\left(x\right)\to 0$ for all real numbers x.

Example: Finding Maclaurin Series

For each of the following functions, find the Maclaurin series and its interval of convergence. Use Taylor’s Theorem with Remainder to prove that the Maclaurin series for $f$ converges to $f$ on that interval.

1. $e^{x}$
2. $\sin{x}$

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

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 Maclaurin series for $f\left(x\right)=\cos{x}$. Use the ratio test to show that the interval of convergence is $\left(-\infty ,\infty \right)$. Show that the Maclaurin series converges to $\cos{x}$ for all real numbers $x$.

Activity: Proving that $e$ is Irrational

In this project, we use the Maclaurin polynomials for $e^{x}$ to prove that e is irrational. The proof relies on supposing that e is rational and arriving at a contradiction. Therefore, in the following steps, we suppose $e=\frac{r}{s}$ for some integers $r$ and $s$ where $s\ne 0$.

1. Write the Maclaurin polynomials ${p}_{0}\left(x\right),{p}_{1}\left(x\right),{p}_{2}\left(x\right),{p}_{3}\left(x\right),{p}_{4}\left(x\right)$ for ex. Evaluate ${p}_{0}\left(1\right),{p}_{1}\left(1\right),{p}_{2}\left(1\right),{p}_{3}\left(1\right),{p}_{4}\left(1\right)$ to estimate e.
2. Let ${R}_{n}\left(x\right)$ denote the remainder when using ${p}_{n}\left(x\right)$ to estimate $e^{x}$. Therefore, ${R}_{n}\left(x\right)={e}^{x}-{p}_{n}\left(x\right)$, and ${R}_{n}\left(1\right)=e-{p}_{n}\left(1\right)$. Assuming that $e=\frac{r}{s}$ for integers r and s, evaluate ${R}_{0}\left(1\right),{R}_{1}\left(1\right),{R}_{2}\left(1\right),{R}_{3}\left(1\right),{R}_{4}\left(1\right)$.
3. Using the results from part 2, show that for each remainder ${R}_{0}\left(1\right),{R}_{1}\left(1\right),{R}_{2}\left(1\right),{R}_{3}\left(1\right),{R}_{4}\left(1\right)$, we can find an integer $n$ such that $k{R}_{n}\left(1\right)$ is an integer for $n=0,1,2,3,4$.
4. Write down the formula for the nth Maclaurin polynomial ${p}_{n}\left(x\right)$ for $e^{x}$ and the corresponding remainder ${R}_{n}\left(x\right)$. Show that $sn\text{!}{R}_{n}\left(1\right)$ is an integer.
5. Use Taylor’s theorem to write down an explicit formula for ${R}_{n}\left(1\right)$. Conclude that ${R}_{n}\left(1\right)\ne 0$, and therefore, $sn\text{!}{R}_{n}\left(1\right)\ne 0$.
6. Use Taylor’s theorem to find an estimate on ${R}_{n}\left(1\right)$. Use this estimate combined with the result from part 5 to show that $|sn\text{!}{R}_{n}\left(1\right)|<\frac{se}{n+1}$. Conclude that if $n$ is large enough, then $|sn\text{!}{R}_{n}\left(1\right)|<1$. Therefore, $sn\text{!}{R}_{n}\left(1\right)$ is an integer with magnitude less than 1. Thus, $sn\text{!}{R}_{n}\left(1\right)=0$. But from part 5, we know that $sn\text{!}{R}_{n}\left(1\right)\ne 0$. We have arrived at a contradiction, and consequently, the original supposition that e is rational must be false.