Skip to main content

Exploring Calculus with Maple Introductory Calculus

Section 3.17 Taylor and Maclaurin Series

Subsection 3.17.1 Recommended Tutorials

Before starting on these exercises, you should familiarize yourself with the material covered in the following tutorials:

Subsection 3.17.2 Introduction

The Taylor series of a function \(f(x)\) centred at \(a\) is the infinite series
\begin{equation*} f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!}(x-a)^n \end{equation*}
where \(n!\) is using the factorial operator, defined by
\begin{align*} n! \amp = n(n-1)(n-2)\cdots(3)(2)(1) \quad (n \geq 1) \\ 0! \amp = 1 \text{.} \end{align*}
Writing out the first \(n\) terms of a Taylor series gives the \(n\)th degree Taylor polynomial approximation of \(f(x)\text{:}\)
\begin{align} f(x) \amp \approx f(a) + \frac{f'(a)}{1!}(x-a)\tag{3.18}\\ f(x) \amp \approx f(a) + \frac{f'(a)}{1!}(x-a) + \frac{f''(a)}{2!}(x-a)^2\tag{3.19}\\ f(x) \amp \approx f(a) + \frac{f'(a)}{1!}(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \frac{f'''(a)}{3!}(x-a)^3\text{.}\tag{3.20} \end{align}
Equation (3.18) should look familiar; it is the linear approximation formula and the equation of the tangent line to \(f(x)\) at \(x=a\text{.}\) Similarly, equation (3.19) gives quadratic approximation and equation (3.20) gives cubic approximation.
Comparing the graphs of these Taylor polynomial approximations to the graph of \(f(x)\) can reveal information about the interval of convergence of the Taylor series. This is the interval for \(x\) over which the Taylor series converges to the graph of \(f(x)\text{.}\) This interval is always centred at \(x=a\text{.}\) The radius of convergence is exactly half the width of the interval of convergence and may be infinite if the Taylor series converges to \(f(x)\) over the entire real number line.
In this activity, you will calculate Taylor series of functions centred at \(a=0\text{:}\)
\begin{equation*} f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}x^n = f(0) + \frac{f'(0)}{1!}x + \frac{f''(0)}{2!}x^2 + \frac{f'''(0)}{3!}x^3 + \cdots\text{.} \end{equation*}
This specific type of Taylor series is also commonly known as a Maclaurin series. You will compute and plot Taylor polynomial approximations and compare their graphs to the function to understand how the radius of convergence works.

Exercises 3.17.3 Exercises

1.

In this exercise, you will calculate several Taylor polynomial approximations for \(f(x) = \cos(x)\) centred at \(a=0\) and consider the interval of convergence of the Taylor series.
(a)
Compute the \(3\)rd degree Taylor polynomial approximation of \(f(x)\) centred at \(a=0\) and assign it as a polynomial to poly3.
Hint.
The second degree Taylor polynomial can be obtained by using the command taylor(cos(x), x=0, 3). This can then be converted to a polynomial and assigned to the name poly2 using the command poly2 := convert(%, polynom). Both of these commands can be written on a single Maple input with a semicolon between them.
Examples of finding and plotting Taylor series can be found in SectionΒ 17.3.
(b)
Repeat part (a) for the \(5\)th, \(11\)th, and \(23\)rd degree Taylor polynomial approximations. Assign each of these polynomials to a different name.
Hint.
Note that some powers may not appear in the polynomial if the coefficient for that term is equal to zero.
(c)
Plot \(f(x)\) and all four of the Taylor polynomial approximations on a single graph.
Hint.
You may want to choose different colours for each of these five curves to keep track of which is which.
(d)
In a new paragraph, describe how the graphs of the Taylor polynomial approximations compare to \(f(x)\) as the degree increases.
(e)
If you were to increase the degree infinitely, you should expect that the approximation will converge to the function within the radius of convergence on either side of \(0\text{.}\) In a new paragraph state what you expect the radius of convergence to be.

2.

In this exercise, you will calculate several Taylor polynomial approximations for \(g(x) = \ln(1+x)\) and determine the radius of convergence for the Taylor series approximation centred at \(a=0\text{.}\)
(a)
Compute the \(2\)nd, \(5\)th, \(11\)th, and \(23\)rd degree Taylor polynomial approximations of \(g(x)\) centred at \(a=0\text{.}\) Assign each to a new name.
(b)
Plot \(g(x)\) and all four Taylor polynomial approximations on the same graph. How do the graphs of the Taylor polynomial approximations compare to \(g(x)\) as the degree increases?
(c)
In a new paragraph in your worksheet, state what you expect the radius of convergence to be for the Taylor series of \(g(x)\) centred at \(a=0\text{.}\)

3.

Because the higher derivatives of \(\cos(x)\) and \(\ln(1+x)\) both form predictable patterns when evaluated at \(a=0\text{,}\) it is possible to write the Taylor series for these functions centred at \(a=0\) in their compact forms:
\begin{align} \cos(x)\amp =\sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!}\tag{3.21}\\ \ln(1+x)\amp =\sum_{n=0}^{\infty} \frac{(-1)^{n-1} x^n}{n}\tag{3.22} \end{align}
(a)
Plot the first 51 nonzero terms of equation (3.21). Does this seem to confirm the radius of convergence you were expecting in exercise ExerciseΒ 3.17.3.1?
Hint.
The first 50 nonzero terms are given by \(\sum_{n=0}^{50} \frac{(-1)^n x^{2n}}{(2n)!}\text{.}\) You may use the Sum() command or the palettes toolbar to create this expression in your plot() command.