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 [latex]n[/latex]th Taylor polynomial for a function [latex]f[/latex] at [latex]a[/latex] is the [latex]n[/latex]th partial sum of the Taylor series for [latex]f[/latex] at [latex]a[/latex]. Therefore, to determine if the Taylor series converges, we need to determine whether the sequence of Taylor polynomials [latex]\left\{{p}_{n}\right\}[/latex] converges. However, not only do we want to know if the sequence of Taylor polynomials converges, we want to know if it converges to [latex]f[/latex]. To answer this question, we define the remainder [latex]{R}_{n}\left(x\right)[/latex] as

[latex]{R}_{n}\left(x\right)=f\left(x\right)-{p}_{n}\left(x\right)[/latex].

 

For the sequence of Taylor polynomials to converge to [latex]f[/latex], we need the remainder [latex]R_{n}[/latex] to converge to zero. To determine if [latex]R_{n}[/latex] 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 [latex]n[/latex]th Taylor polynomial approximates the function.

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

[latex]\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}[/latex]

 

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

[latex]{R}_{0}\left(x\right)={f}^{\prime }\left(c\right)\left(x-a\right)[/latex].

 

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

[latex]{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}[/latex]

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

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

 

for all [latex]x[/latex] in the interval [latex]I[/latex].

We now state Taylor’s theorem, which provides the formal relationship between a function [latex]f[/latex] and its [latex]n[/latex]th degree Taylor polynomial [latex]{p}_{n}\left(x\right)[/latex]. 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 [latex]f[/latex] converges to [latex]f[/latex].

theorem: Taylor’s Theorem with Remainder


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

[latex]{R}_{n}\left(x\right)=f\left(x\right)-{p}_{n}\left(x\right)[/latex]

 

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

[latex]{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}[/latex].

 

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

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

 

for all [latex]x[/latex] in [latex]I[/latex].

Proof

Fix a point [latex]x\in I[/latex] and introduce the function g such that

[latex]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}}[/latex].

 

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 [latex]t=a[/latex] and [latex]t=x[/latex] because

[latex]\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}[/latex]

 

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

[latex]\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}[/latex].

 

Consequently,

[latex]\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}[/latex]

 

Notice that there is a telescoping effect. Therefore,

[latex]{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}}[/latex].

 

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

[latex]{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}}[/latex]

 

we conclude that

[latex]-\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[/latex].

 

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

[latex]{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}[/latex]

 

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

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

 

[latex]_\blacksquare[/latex]

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 [latex]f\left(x\right)=\sqrt[3]{x}[/latex] at [latex]x=8[/latex] and determine how accurate these approximations are at estimating [latex]\sqrt[3]{11}[/latex].

Example: Using Linear and Quadratic Approximations to Estimate Function Values

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

  1. Find the first and second Taylor polynomials for [latex]f[/latex] at [latex]x=8[/latex]. Use a graphing utility to compare these polynomials with [latex]f[/latex] near [latex]x=8[/latex].
  2. Use these two polynomials to estimate [latex]\sqrt[3]{11}[/latex].
  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.

You can view the transcript for this segmented clip of “6.3 Taylor and Maclaurin Series” here (opens in new window).

try it

Find the first and second Taylor polynomials for [latex]f\left(x\right)=\sqrt{x}[/latex] at [latex]x=4[/latex]. Use these polynomials to estimate [latex]\sqrt{6}[/latex]. Use Taylor’s theorem to bound the error.

Example: Approximating sinx using maclaurin polynomials

From the Example: Finding Maclaurin Polynomials, the Maclaurin polynomials for [latex]\sin{x}[/latex] are given by

[latex]\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}[/latex]

 

for [latex]m=0,1,2,\dots[/latex].

  1. Use the fifth Maclaurin polynomial for [latex]\sin{x}[/latex] to approximate [latex]\sin\left(\frac{\pi }{18}\right)[/latex] and bound the error.
  2. For what values of [latex]x[/latex] does the fifth Maclaurin polynomial approximate [latex]\sin{x}[/latex] 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.

You can view the transcript for this segmented clip of “6.3 Taylor and Maclaurin Series” here (opens in new window).

try it

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

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

Try It

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 [latex]f\left(x\right)=\frac{1}{x}[/latex] at [latex]x=1[/latex]. 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.

You can view the transcript for this segmented clip of “6.3 Taylor and Maclaurin Series” here (opens in new window).

try it

Find the Taylor series for [latex]f\left(x\right)=\frac{1}{2x}[/latex] at [latex]x=2[/latex] and determine its interval of convergence.

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

[latex]f\left(x\right)=\frac{1}{x}=\frac{1}{1-\left(1-x\right)}[/latex].

 

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

We now consider the more general question: if a Taylor series for a function [latex]f[/latex] converges on some interval, how can we determine if it actually converges to [latex]f?[/latex] 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 [latex]f[/latex] at a, the nth partial sum is given by the nth Taylor polynomial pn. Therefore, to determine if the Taylor series converges to [latex]f[/latex], we need to determine whether

[latex]\underset{n\to \infty }{\text{lim}}{p}_{n}\left(x\right)=f\left(x\right)[/latex].

 

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

[latex]\underset{n\to \infty }{\text{lim}}{R}_{n}\left(x\right)=0[/latex].

 

We now state this theorem formally.

Theorem: Convergence of Taylor Series


Suppose that [latex]f[/latex] has derivatives of all orders on an interval [latex]I[/latex] containing [latex]a[/latex]. Then the Taylor series

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

 

converges to [latex]f\left(x\right)[/latex] for all [latex]x[/latex] in [latex]I[/latex] if and only if

[latex]\underset{n\to\infty}\lim {R}_{n}\left(x\right)=0[/latex]

 

for all [latex]x[/latex] in [latex]I[/latex].

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

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

 

from Taylor’s theorem with remainder.

In the next example, we find the Maclaurin series for ex and [latex]\sin{x}[/latex] and show that these series converge to the corresponding functions for all real numbers by proving that the remainders [latex]{R}_{n}\left(x\right)\to 0[/latex] 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 [latex]f[/latex] converges to [latex]f[/latex] on that interval.

  1. [latex]e^{x}[/latex]
  2. [latex]\sin{x}[/latex]

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.

You can view the transcript for this segmented clip of “6.3 Taylor and Maclaurin Series” here (opens in new window).

try it

Find the Maclaurin series for [latex]f\left(x\right)=\cos{x}[/latex]. Use the ratio test to show that the interval of convergence is [latex]\left(-\infty ,\infty \right)[/latex]. Show that the Maclaurin series converges to [latex]\cos{x}[/latex] for all real numbers [latex]x[/latex].

Activity: Proving that [latex]e[/latex] is Irrational

In this project, we use the Maclaurin polynomials for [latex]e^{x}[/latex] 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 [latex]e=\frac{r}{s}[/latex] for some integers [latex]r[/latex] and [latex]s[/latex] where [latex]s\ne 0[/latex].

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