Skip to main content

Section 6.8 Power Series and Polynomial Approximation

In this chapter we have a closer look at so-called power series, which arise in the study of analytic functions. A power series is basically an infinite degree polynomial that represents some function. Since we know a lot more about polynomial functions than arbitrary functions, this allows us to readily differentiate, integrate, and approximate some functions using power series.

Subsection 6.8.1 Power Series

Recall that the sum of a geometric series can be expressed using the simple formula:

\begin{equation*} \sum_{n=0}^\infty kx^n = {k\over 1-x}\text{,} \end{equation*}

if \(|x|\lt 1\text{,}\) and that the series diverges when \(|x|\ge 1\text{.}\) At the time, we thought of \(x\) as an unspecified constant, but we could just as well think of it as a variable, in which case the series

\begin{equation*} \sum_{n=0}^\infty kx^n \end{equation*}

is a function, namely, the function \(k/(1-x)\text{,}\) as long as \(|x|\lt 1\text{:}\) Looking at this from the opposite perspective, this means that the function \(k/(1-x)\) can be represented as the sum of an infinite series. Why would this be useful? While \(k/(1-x)\) is a reasonably easy function to deal with, the more complicated representation \(\sum kx^n\) does have some advantages: it appears to be an infinite version of one of the simplest function types — a polynomial. Later on we will investigate some of the ways we can take advantage of this ‘infinite polynomial’ representation, but first we should ask if other functions can even be represented this way.

The geometric series has a special feature that makes it unlike a typical polynomial—the coefficients of the powers of \(x\) are all the same, namely \(k\text{.}\) We will need to allow more general coefficients if we are to get anything other than the geometric series.

Definition 6.63. Power Series Centred Around Zero.

A power series is a series of the form

\begin{equation*} P(x) = \ds\sum_{n=0}^\infty a_nx^n\text{,} \end{equation*}

where the coefficients \(a_n\) are real numbers.

Note:

  1. As we did in the section on sequences, we can think of the \(a_n\) as being a function \(a(n)\) defined on the non-negative integers.

  2. It is important to remember that the \(a_n\) do not depend on \(x\text{.}\)

Example 6.64. Power Series Convergence.

Determine the values of \(x\) for which the power series \(\ds\sum_{n=1}^\infty {x^n\over n}\) converges.

Solution

We can investigate convergence using the Ratio Test:

\begin{equation*} \lim_{n\to\infty} {|x|^{n+1}\over n+1}{n\over |x|^n} =\lim_{n\to\infty} |x|{n\over n+1} =|x|\text{.} \end{equation*}

Thus when \(|x|\lt 1\) the series converges and when \(|x|>1\) it diverges, leaving only two values in doubt. When \(x=1\) the series is the harmonic series and diverges; when \(x=-1\) it is the alternating harmonic series (actually the negative of the usual alternating harmonic series) and converges. Thus, we may think of \(\ds\sum_{n=1}^\infty {x^n\over n}\) as a function from the interval \([-1,1)\) to the real numbers.

A bit of thought reveals that the Ratio Test applied to a power series will always have the same nice form. In general, we will compute

\begin{equation*} \lim_{n\to\infty} {|a_{n+1}||x|^{n+1}\over |a_n||x|^n} =\lim_{n\to\infty} |x|{|a_{n+1}|\over |a_n|} = |x|\lim_{n\to\infty} {|a_{n+1}|\over |a_n|} =L|x|\text{,} \end{equation*}

assuming that \(\ds \lim |a_{n+1}|/|a_n|\) exists:

  1. If \(L \in (0,\infty)\text{:}\)

    • Then the series converges if \(L|x|\lt 1\text{,}\) that is, if \(|x|\lt 1/L\text{,}\) and diverges if \(|x|>1/L\text{.}\)

    • Only the two values \(x=\pm1/L\) require further investigation.

    • The value \(1/L\) is called the radius of convergence .

    • Thus the series will always define a function on the interval \((-1/L,1/L)\text{,}\) that perhaps will extend to one or both endpoints as well.

    • This interval is referred to as the interval of convergence.

    • This interval is essentially the domain of the power series .

  2. If \(L=0\text{:}\)

    • Then no matter what value \(x\) takes the limit is \(0\text{.}\)

    • The series converges for all \(x\) and the function is defined for all real numbers.

  3. If \(L=\infty\text{:}\)

    • Then no matter what value \(x\) takes the limit is infinite.

    • The series converges only when \(x=0\text{.}\)

We can make these ideas a bit more general. Consider the series

\begin{equation*} \ds\sum_{n=0}^{\infty}\frac{(x+2)^n}{3^n} \end{equation*}

This looks a lot like a power series, but with \((x+2)^n\) instead of \(x^n\text{.}\) Let's try to determine the values of \(x\) for which it converges. This is just a geometric series, so it converges when

\begin{align*} |x+2|/3\amp \lt 1\\ |x+2|\amp \lt 3\\ -3 \lt x+2 \amp \lt 3\\ -5\lt x\amp \lt 1\text{.} \end{align*}

So the interval of convergence for this series is \((-5,1)\text{.}\) The centre of this interval is at \(-2\text{,}\) which is at distance 3 from the endpoints, so the radius of convergence is 3, and we say that the series is centred at \(-2\text{.}\)

Interestingly, if we compute the sum of the series we get

\begin{equation*} \ds\sum_{n=0}^{\infty}\left(\frac{x+2}{3}\right)^n=\frac{1}{1-\frac{x+2}{3}}=\frac{3}{1-x}\text{.} \end{equation*}

Multiplying both sides by 1/3 we obtain

\begin{equation*} \sum_{n=0}^\infty {(x+2)^n\over 3^{n+1}}={1\over 1-x}\text{,} \end{equation*}

which we recognize as being equal to

\begin{equation*} \sum_{n=0}^{\infty}x^n\text{,} \end{equation*}

so we have two series with the same sum but different intervals of convergence.

This leads to the following definition:

Definition 6.65. Power Series Centred Around \(a\).

A power series centred at \(a\) has the form

\begin{equation*} P(x) = \ds\sum_{n=0}^\infty a_n(x-a)^n\text{,} \end{equation*}

where the centre \(a\) and coefficients \(a_n\) are real numbers.

Note: The power series centred at zero given in Definition 6.63 is a special case of the above definition when \(a=0\text{.}\)

Convergence of a Power Series.

Given a power series \(\sum a_n(x-a)^n\) and its radius of convergence \(R\text{,}\) the series behaves in one of three ways:

  1. The series converges absolutely for \(x\) with \(|x-a| \lt R\text{,}\) it diverges for \(x\) with \(|x-a| > R\text{,}\) and at \(x=a-R\) and \(x=a+R\) further investigation is needed.

  2. When \(R=\infty\text{,}\) the series converges absolutely for every \(x\text{.}\)

  3. When \(R=0\text{,}\) the series converges at \(x=a\) and diverges everywhere else.

Example 6.66. Interval of Convergence.

Given the power series

\begin{equation*} \sum_{n=0}^{\infty}\frac{(-1)^nn(x-2)^n}{3^n} \end{equation*}

determine the following:

  1. radius of convergence

  2. interval of convergence

Solution

Obviously, the series converges for \(x=2\text{.}\) To determine all values of \(x\) for which the series converges, we begin by applying the Ratio Test:

\begin{equation*} \begin{split} L \amp = \lim_{n\to\infty} \left\vert \frac{a_{n+1}}{a_n} \right\vert \\ \amp =\lim_{n\to\infty} \left\vert \frac{(-1)^{n+1}(n+1)(x-2)^{n+1}}{3^{n+1}} \frac{3^n}{(-1)^nn(x-2)^n} \right\vert \\ \amp = \lim_{n\to\infty} \left\vert \frac{(n+1)(x-2)}{3n}\right\vert \\ \amp = |x-2| \lim_{n\to\infty} \frac{n+1}{3n} \\ \amp = \frac{1}{3} |x-2| \end{split} \end{equation*}
  1. By the Ratio Test, the radius of convergence is \(R=3\text{.}\)

  2. We now determine the interval of convergence. By the Ratio Test, the series converges absolutely if \(L\lt 1\text{:}\)

    \begin{equation*} \begin{split} \amp \frac{1}{3}|x-2| \lt 1 \\ \amp \implies |x-2| \lt 3 \\ \amp \implies -3 \lt x-2 \lt 3 \\ \amp \implies -1\lt x \lt 5 \end{split} \end{equation*}

    The series diverges if \(L > 1\text{,}\) i.e. \(x \lt -1\) and \(x > 5\text{.}\) Let us now look at the case when \(L=1\text{,}\) which means investigating the behaviour of the series at endpoints \(x=-1\) and \(x=5\text{:}\)

    Case \(x=-1\text{:}\) Then the series becomes

    \begin{equation*} \sum_{n=0}^{\infty} \frac{(-1)^n n(-1-2)^n}{3^n} = \sum_{n=0}^{\infty}(-1)^{2n} n = \sum_{n=0}^{\infty} n\text{.} \end{equation*}

    Since \(\lim\limits_{n\to\infty} n = \infty \neq 0\text{,}\) this series is divergent by the \(n\)-th Term Test (Divergence Test).

    Case \(x=5\text{:}\) Then the series becomes

    \begin{equation*} \sum_{n=0}^\infty \frac{(-1)^n n(5-2)^n}{3^n} = \sum_{n=0}^{\infty} (-1)^n n\text{.} \end{equation*}

    Since \(\lim\limits_{n\to\infty} (-1)^n n\) does not exist, this series is also divergent by the \(n\)-th Term Test (Divergence Test).

    Thus, the interval of convergence for the given power series is \(x \in (-1,5)\text{.}\)

Example 6.67. Interval of Convergence.

Given the power series

\begin{equation*} \sum_{n=1}^{\infty}(n+1)!(x+3)^n \end{equation*}

determine the following:

  1. radius of convergence

  2. interval of convergence

Solution

Obviously, the series converges for \(x=-3\text{.}\) To determine all values of \(x\) for which the series converges, we begin by applying the Ratio Test:

\begin{equation*} \begin{split} L \amp = \lim_{n\to\infty} \left\vert \frac{a_{n+1}}{a_n}\right\vert \\ \amp = \lim_{n\to\infty} \left\vert \frac{(n+2)!(x+3)^{n+1}}{(n+1)!(x+3)^n}\right\vert \\ \amp = |x+3| \lim_{n\to\infty}(n+1) = \infty, \end{split} \end{equation*}

provided that \(x\neq-3\text{.}\) Therefore, this series will only converge for \(x=3\text{.}\)

  1. The radius of convergence is \(R=0\text{.}\)

  2. The interval of convergence is \(x=-3\text{,}\) which is just one point.

Exercises for Section 6.8.1.

Find the radius and interval of convergence for each series. In part c), do not attempt to determine whether the endpoints are in the interval of convergence.

  1. \(\ds\sum_{n=0}^\infty n x^n\)

    Answer
    \(R=1\text{,}\) \(I=(-1,1)\)
    Solution
    Applying the Ratio Test to the power series gives
    \begin{equation*} \begin{split} L \amp= \lim_{n\to\infty} \left\vert \frac{(n+1)x^{n+1}}{nx^n}\right\vert\\ \amp= \lim_{n\to\infty} \left\vert x \frac{n+1}{n}\right\vert\\ \amp= |x| \lim_{n\to\infty} \left\vert 1+ \frac{1}{n}\right\vert\\ \amp= |x|\end{split} \end{equation*}
    Hence, The radius of convergence is \(R=1\text{.}\) We now investigate what happens when \(x=-1\text{:}\) the series
    \begin{equation*} \sum_{n=0}^{\infty} (-1)^n n \end{equation*}
    is a divergent series, and similarly for
    \begin{equation*} \sum_{n=0}^{\infty} n. \end{equation*}
    Therefore, the endpoints \(x=\pm 1\) are not included in the interval of convergence. The interval of convergence is thus \(I=(-1,1)$\text{.}\)
  2. \(\ds\sum_{n=0}^\infty {x^n\over n!}\)

    Answer
    \(R=\infty\text{,}\) \(I=(-\infty,\infty)\)
    Solution

    Applying the Ratio Test to the power series gives

    \begin{equation*} \begin{split} L \amp = \lim_{n\to\infty} \left\vert \frac{x^{n+1}}{(n+1)!} \frac{n!}{x^n}\right\vert \\ \amp = \lim_{n\to\infty} \left\vert \frac{x^{n+1}}{x^n} \frac{1}{n+1}\right\vert \\ \amp = \lim_{n\to\infty} \left\vert \frac{x}{n+1} \right\vert \\ \amp = |x| \lim_{n\to\infty} \frac{1}{n+1}= 0. \end{split} \end{equation*}

    And so the series

    \begin{equation*} \sum_{n=0}^\infty \frac{x^n}{n!} \end{equation*}

    converges for all \(x\text{,}\) i.e., the radius of convergence is \(R=\infty\) and the interval of convergence is \((-\infty,\infty)\text{.}\)

  3. \(\ds\sum_{n=1}^\infty {n!\over n^n}(x-2)^n\)

    Answer
    \(R=e\text{,}\) \(I=(2-e,2+e)\)
    Solution
    We apply the Ratio Test:
    \begin{equation*} \begin{split} L \amp= \lim_{n\to\infty} \left\vert \frac{(n+1)!n^n(x-2)^{n+1}}{n!n^n(x-2)^n}\right\vert\\ \amp= |x-2| \lim_{n\to\infty} \left\vert \frac{(n+1)n^n}{(n+1)^{n+1}}\right\vert\\ \amp= |x-2| \lim_{n\to\infty} \left\vert \frac{n^n}{(n+1)^n}\right\vert\\ \amp= |x-2|\lim_{n\to\infty} \left(\frac{1}{1+1/n}\right)^{1/n} = |x-2| \frac{1}{e}. \end{split} \end{equation*}
    Therefore, the radius of convergence is \(R= e\text{.}\) It turns out the endpoints are not included in the interval of convergence: \((2-e,2+e)\text{.}\)
  4. \(\ds\sum_{n=1}^\infty {(n!)^2\over n^n}(x-2)^n\)

    Answer
    \(R=0\text{,}\) converges only when \(x=2\)
    Solution
    We apply the Ratio Test:
    \begin{equation*} \begin{split} L \amp= |x-2| \lim_{n\to\infty} \left(\frac{(n+1)!^2}{(n+1)^{n+1}} \frac{n^n}{n!^2}\right)\\ \amp= |x-2|\lim_{n\to\infty} \left(\frac{n^n}{(n+1)^{n+1}} \frac{(n+1)!^2}{n!^2}\right)\\ \amp= |x-2|\lim_{n\to\infty} \left(\frac{n^n}{(n+1)^{n+1}} (n+1)^2\right)\\ \amp= |x-2|\lim_{n\to\infty} \left(\frac{n^n}{(n+1)^(n-1)}\right) \end{split} \end{equation*}
    Now take the logarithm of this limit:
    \begin{equation*} \log\left( \lim_{n\to\infty} \left(\frac{n^n}{(n+1)^{(n-1)}}\right)\right) = \lim_{n\to\infty} n\log n - (n-1)\log(n+1) = \infty. \end{equation*}
    Therefore, the series converges only if \(x=2\text{.}\) Therefore, the radius of convergence is \(R=0\) and the interval of convergence is \(I=2\text{.}\)
  5. \(\ds\sum_{n=1}^\infty {(x+5)^n\over n(n+1)}\)

    Answer
    \(R=1\text{,}\) \(I=[-6,-4]\)
    Solution

    We use the Ratio Test to determine the radius of convergence:

    \begin{equation*} \begin{split} L \amp = \lim_{n\to\infty} \left\vert\frac{(x+5)^{n+1}}{(n+1)(n+2)} \frac{n(n+1)}{(x+5)^n} \right\vert\\ \amp = \lim_{n\to\infty} \left\vert \frac{(x+5) n}{n+2} \right\vert \\ \amp = |x+5| \lim_{n\to\infty} \frac{n}{n+2} \\ \amp = |x+5| \lim_{n\to\infty} \frac{1}{1+2/n} = |x+5| \end{split} \end{equation*}

    So the radius of convergence is \(R=1\text{,}\) and the power series diverges for all \(x \lt -6\) and \(x > -4\text{.}\) We now determine the convergence at the endpoints. For \(x=-6\text{,}\) the series becomes

    \begin{equation*} \sum_{n=0}^{\infty} \frac{(-1)^{n+1}}{n(n+1)} \end{equation*}

    which converges by the Alternating Series Test. When \(x=-4\) the series becomes

    \begin{equation*} \sum_{n=0}^{\infty} \frac{1}{n(n+1)}\text{.} \end{equation*}

    This series converges since

    \begin{equation*} \frac{1}{n(n+1)} \lt \frac{1}{n^2}\text{.} \end{equation*}

    Therefore, the interval of convergence is \([-6,-4]\text{.}\)

  6. \(\ds\sum_{n=1}^\infty {n!\over n^n}x^n\)

    Answer
    \(R=e\text{,}\) \(I=(-e,e) \)
    Solution
    We apply the Ratio Test:
    \begin{equation*} \begin{split} L \amp= |x| \lim_{n\to\infty} \left(\frac{n^n}{(n+1)^{n+1}} \frac{(n+1)!}{n!}\right)\\ \amp= |x| \lim_{n\to\infty} \left(\frac{n^n}{(n+1)^{n+1}} (n+1)\right)\\ \amp= |x| \lim_{n\to\infty} \left(\frac{n^n}{(n+1)^n}\right)\\ \amp= |x| \lim_{n\to\infty} \frac{1}{(1+\frac{1}{n})^n} = |x| \frac{1}{e}. \end{split} \end{equation*}
    Threfore, the radius of convergence is \(R=e \text{.}\) We now test whether or not the endpoints are included in the interval of convergence. Since neither
    \begin{equation*} \sum_{n=1}^{\infty} (x-e)^n \frac{n!}{n} \end{equation*}
    nor
    \begin{equation*} \sum_{n=1}^{\infty} (x+e)^n \frac{n!}{n} \end{equation*}
    converge, the interval of convergence is \(I=(-e,e) \text{.}\)

Subsection 6.8.2 Calculus with Power Series

We now know that some functions can be expressed as power series, which look like infinite polynomials. In fact, there are many extremely useful functions that cannot be represented using the usual elementary functions, but they can be represented using a power series. For example, the Bessel functions and hypergeometric functions which are important in such fields as engineering, physics and acoustics. Since it is easy to find derivatives and integrals of polynomials, we might hope that we can take derivatives and integrals of power series in an analogous way. In fact we can, as stated in the following theorem, which we will not prove here.

Note: The process of differentiation and integration allows us to create further power series representations of functions.
Example 6.69. Power Series Representation.

Given \(f(x)=\ln|1-x|\text{:}\)

  1. Find a power series representation of \(f\text{.}\)

  2. Use the first seven terms of this series to approximate \(\ln(3/2)\text{.}\)

  3. Approximate \(\ln(9/4)\text{.}\)

Solution
  1. We recall that the derivative of \(\ln|1-x|\) is \(\frac{1}{1-x}\text{,}\) and so we start with the geometric series:

    \begin{equation*} {1\over 1-x} = \sum_{n=0}^\infty x^n \end{equation*}

    when \(|x| \lt 1\text{.}\) Next, we integrate to obtain the function \(f\text{:}\)

    \begin{equation*} \begin{split} \int{1\over 1-x}\,dx \amp = -\ln|1-x| = \sum_{n=0}^\infty {1\over n+1}x^{n+1}\\ f(x) \amp = \ln|1-x| = \sum_{n=0}^\infty -{1\over n+1}x^{n+1}, \end{split} \end{equation*}

    when \(|x|\lt 1\text{.}\) The series does not converge when \(x=1\text{,}\) since \(\sum_{n=0}^{\infty} -\frac{1}{n+1}(1)^{n+1}=-\sum_{n=1}^{\infty}\frac{1}{n}\) is the negative harmonic series. But the series does converge when \(x=-1\text{,}\) since \(\sum_{n=0}^{\infty} -\frac{1}{n+1}(-1)^{n+1}=\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n}\) is the alternating harmonic series. Therefore, the interval of convergence is \([-1,1)\text{.}\)

  2. We note that \(-1 \leq x \lt 1\) implies \(0 \lt 1-x \leq 2\text{,}\) and that \(0 \lt \frac{3}{2} \leq 2\text{,}\) so we need \(x=-\frac{1}{2}\text{.}\) Then

    \begin{equation*} \ln(3/2)=\ln\left\vert-(-1/2)\right\vert=\sum_{n=0}^{\infty} - \frac{1}{n+1}\left(-\frac{1}{2}\right)^{n+1} = \sum_{n=0}^\infty \frac{(-1)^{n+1}}{(n+1)2^{n+1}}\text{.} \end{equation*}

    Now we use the first seven terms to approximate \(\ln(3/2)\text{:}\)

    \begin{equation*} \ln(3/2)\approx {1\over 2}-{1\over 8}+{1\over 24}-{1\over 64} +{1\over 160}-{1\over 384}+{1\over 896} ={909\over 2240}\approx 0.406\text{.} \end{equation*}

    Because this is an alternating series with decreasing terms, we know that the true value is between \(909/2240\) and \(909/2240-1/2048=29053/71680\approx .4053\text{,}\) so \(0.4053\leq\ln(3/2)\leq 0.406\text{.}\)

  3. With a bit of arithmetic, we can approximate values outside of the interval of convergence, such as \(9/4 > 2\text{.}\) We can use the approximation we just computed, plus some rules for logarithms:

    \begin{equation*} \ln(9/4)=\ln((3/2)^2)=2\ln(3/2)\approx 0.812\text{,} \end{equation*}

    and using our bounds above,

    \begin{equation*} 0.8106\leq \ln(9/4)\leq 0.812\text{.} \end{equation*}
Exercises for Section 6.8.2.

Find a series representation for

  1. \(\ln 2\)

    Answer
    the alternating harmonic series
    Solution
    We know that we can write
    \begin{equation*} \ln|1-x| = \sum_{n=0}^{\infty} \frac{-1}{n+1} x^{n+1}, \end{equation*}
    for \(x \in [-1,1)\text{.}\) Therefore,
    \begin{equation*} \ln(2) = \ln|1-(-1)| = \sum_{n=0}^{\infty} \frac{-1}{n+1} (-1)^{n+1} = \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n}, \end{equation*}
    which is the alternating harmonic series.
  2. \(\ln (9/2)\)

    Answer
    \(\ds\sum_{n=1}^{\infty} \frac{1}{n} \left(\frac{7}{9}\right)^{n}\)
    Solution
    We know that we can write
    \begin{equation*} \ln|1-x| = \sum_{n=0}^{\infty} \frac{-1}{n+1} x^{n+1}, \end{equation*}
    for \(x \in [-1,1)\text{.}\) Therefore, let \(\ln(9/2) = -\ln(2/9)\text{.}\) Then
    \begin{equation*} \ln(2/9) = -\ln|1-(7/9)| = -\sum_{n=0}^{\infty} \frac{-1}{n+1} (7/9)^{n+1} = \sum_{n=1}^{\infty} \frac{1}{n} \left(\frac{7}{9}\right)^{n}. \end{equation*}

Find a power series representation for the following functions.

  1. \(\ds 1/(1-x)^2\)

    Answer
    \(\ds\sum_{n=0}^\infty (n+1)x^n\)
    Solution

    We know that

    \begin{equation*} \frac{1}{(1-x)^2} = \diff{}{x} \frac{1}{1-x}\text{,} \end{equation*}

    and that

    \begin{equation*} \frac{1}{1-x} = \sum_{n=0}^{\infty} x^n \end{equation*}

    for \(|x| \lt 1\text{.}\) Combining this information, we find the following power series representation:

    \begin{equation*} \frac{1}{(1-x)^2} = \diff{}{x} \sum_{n=0}^{\infty} x^n = \sum_{n=-1}^{\infty} nx^{n-1} = \sum_{n=0}^{\infty} (n+1)x^n\text{,} \end{equation*}

    for \(|x| \lt 1\text{.}\)

  2. \(\ds 2/(1-x)^3\)

    Answer
    \(\ds\sum_{n=0}^\infty (n+1)(n+2)x^n\)
    Solution
    We have
    \begin{equation*} \frac{2}{(1-x)^3} = \diff{}{x} \frac{1}{(1-x)^2}. \end{equation*}
    Therefore,
    \begin{equation*} \frac{2}{(1-x)^3} = \diff{}{x} \sum_{n=0}^{\infty} (n+1) x^n = \sum_{n=-1}^{\infty} n(n+1)x^{n-1} = \sum_{n=0}^{\infty} (n+1)(n+2) x^n, \end{equation*}
    for \(|x| \lt 1\text{.}\)
  3. \(\ds 1/(1-x)^3\)

  4. \(\ds\int\ln(1-x)\,dx\)

    Answer
    \(\ds C+\sum_{n=0}^\infty {-1\over (n+1)(n+2)}x^{n+2}\)
    Solution
    We know that
    \begin{equation*} \ln|1-x| = \sum_{n=1}^{\infty} \frac{-1}{n} x^n. \end{equation*}
    Therefore,
    \begin{equation*} \int \ln|1-x| \,dx = \int \sum_{n=1}^{\infty} \frac{-1}{n+1} x^{n+1}\,dx = C + \sum_{n=0}^{\infty} \frac{-1}{(n+1)(n+2)}x^{n+2}, \end{equation*}
    for \(|x| \lt 1\text{.}\)

Subsection 6.8.3 Maclaurin Series and Taylor Series

We have seen that some functions can be represented as series, which may give valuable information about the function. So far, we have seen only those examples that result from manipulation of our one fundamental example, the geometric series. We would like to start with a given function and produce a series to represent it, if possible.

Suppose that \(\ds f(x)=\sum_{n=0}^\infty a_nx^n\) on some interval of convergence centred at 0. Then we know that we can compute derivatives of \(f\) by taking derivatives of the terms of the series. Let's compute the first few derivatives and look for a pattern:

\begin{align*} f'(x)\amp =\sum_{n=1}^\infty n a_n x^{n-1}=a_1 + 2a_2x+3a_3x^2+4a_4x^3+\cdots\\ f''(x)\amp =\sum_{n=2}^\infty n(n-1) a_n x^{n-2}=2a_2+3\cdot2a_3x +4\cdot3a_4x^2+\cdots\\ f'''(x)\amp =\sum_{n=3}^\infty n(n-1)(n-2) a_n x^{n-3}=3\cdot2a_3 +4\cdot3\cdot2a_4x+\cdots \end{align*}

By examining these it's not hard to discern the general pattern. The \(k\)th derivative must be

\begin{align*} f^{(k)}(x)\amp =\sum_{n=k}^\infty n(n-1)(n-2)\cdots(n-k+1)a_nx^{n-k}\\ \amp =k(k-1)(k-2)\cdots(2)(1)a_k+(k+1)(k)\cdots(2)a_{k+1}x\\ \amp \qquad {}+(k+2)(k+1)\cdots(3)a_{k+2}x^2+\cdots \end{align*}

We can express this more clearly by using factorial notation:

\begin{equation*} f^{(k)}(x)=\sum_{n=k}^\infty {n!\over (n-k)!}a_nx^{n-k}= k!a_k+(k+1)!a_{k+1}x+{(k+2)!\over 2!}a_{k+2}x^2+\cdots \end{equation*}

We can solve for \(a_k\) by substituting \(x=0\) in the formula for \(f^{(k)}(x)\text{:}\)

\begin{equation*} f^{(k)}(0)=k!a_k+\sum_{n=k+1}^\infty {n!\over (n-k)!}a_n0^{n-k}=k!a_k\text{,} \end{equation*}
\begin{equation*} a_k={f^{(k)}(0)\over k!}\text{.} \end{equation*}

Note that the original series for \(f\) yields \(f(0)=a_0\text{.}\) So if a function \(f\) can be represented by a series, we can easily find such a series. This leads us to the definition of the so-called Maclaurin series .

Definition 6.70. Maclaurin Series.

Suppose a function \(f\) is defined at \(x=0\) and whose derivatives all exist at \(x=0\text{.}\) Then the Maclaurin series of \(f\) at \(x=0\) is given by

\begin{equation*} \begin{split} f(x) \amp = \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}x^n \\ \amp =f(0) + f'(0) + \frac{f''(0)}{2!}x^2 + \cdots + \frac{f^{(n)}(0)}{n!}x^n + \cdots \end{split} \end{equation*}

Note: A warning is in order here. Given a function \(f\) we may be able to compute the Maclaurin series, but that does not mean we have found a series representation for \(f\text{.}\) We still need to know where the series converges, and if, where it converges, it converges to \(f(x)\text{.}\) While for most commonly encountered functions the Maclaurin series does indeed converge to \(f\) on some interval, this is not true of all functions, so care is required.

Example 6.71. Maclaurin Series.

Find the Maclaurin series for \(f(x)=1/(1-x)\text{.}\)

Solution

We need to compute the derivatives of \(f\) and hope to spot a pattern.

\begin{align*} f(x)\amp =(1-x)^{-1}\\ f'(x)\amp =(1-x)^{-2}\\ f''(x)\amp =2(1-x)^{-3}\\ f'''(x)\amp =6(1-x)^{-4}\\ f^{(4)}(x)\amp =4!(1-x)^{-5}\\ \amp \vdots\\ f^{(n)}(x)\amp =n!(1-x)^{-n-1} \end{align*}

So

\begin{equation*} a_n={f^{(n)}(0)\over n!}={n!(1-0)^{-n-1}\over n!}=1 \end{equation*}

and the Maclaurin series is

\begin{equation*} \sum_{n=0}^\infty 1\cdot x^n=\sum_{n=0}^\infty x^n\text{,} \end{equation*}

the geometric series with interval of convergence \(|x| \lt 1\text{.}\)

As a practical matter, if we are interested in using a series to approximate a function, we will need some finite number of terms of the series. Even for functions with messy derivatives we can compute these using computer software like Sage. If we want to describe a series completely, we would like to be able to write down a formula for a typical term in the series. Fortunately, a few of the most important functions are very easy.

Example 6.72. Maclaurin Series.

Find the Maclaurin series for \(f(x)=\sin x\text{.}\)

Solution

Computing the first few derivatives is simple: \(f'(x)=\cos x\text{,}\) \(f''(x)=-\sin x\text{,}\) \(f'''(x)=-\cos x\text{,}\) \(\ds f^{(4)}(x)=\sin x\text{,}\) and then the pattern repeats. The values of the derivative when \(x=0\) are: 1, 0, \(-1\text{,}\) 0, 1, 0, \(-1\text{,}\) 0,…, and so the Maclaurin series is

\begin{equation*} x-{x^3\over 3!}+{x^5\over 5!}-\cdots= \sum_{n=0}^\infty (-1)^n{x^{2n+1}\over (2n+1)!}\text{.} \end{equation*}

We should always determine the radius of convergence:

\begin{equation*} \lim_{n\to\infty} {|x|^{2n+3}\over (2n+3)!}{(2n+1)!\over |x|^{2n+1}} =\lim_{n\to\infty} {|x|^2\over (2n+3)(2n+2)}=0\text{,} \end{equation*}

so the series converges for every \(x\text{.}\) Since it turns out that this series does indeed converge to \(\sin x\) everywhere, we have a series representation for \(\sin x\) for every \(x\text{.}\)

Sometimes the formula for the \(n\)-th derivative of a function \(f\) is difficult to discover, but a combination of a known Maclaurin series and some algebraic manipulation leads easily to the Maclaurin series for \(f\text{.}\)

Example 6.73. Maclaurin Series.

Find the Maclaurin series for \(f(x)= x\sin(-x)\text{.}\)

Solution

To get from \(\sin x\) to \(x\sin(-x)\) we substitute \(-x\) for \(x\) and then multiply by \(x\text{.}\) We can do the same thing to the series for \(\sin x\text{:}\)

\begin{equation*} \begin{split} x\sum_{n=0}^\infty (-1)^n{(-x)^{2n+1}\over (2n+1)!} \amp=x\sum_{n=0}^\infty (-1)^{n}(-1)^{2n+1}{x^{2n+1}\over (2n+1)!}\\ \amp =\sum_{n=0}^\infty (-1)^{n+1}{x^{2n+2}\over (2n+1)!}. \end{split} \end{equation*}

As we have seen, a power series can be centred at a point other than zero, and the method that produces the Maclaurin series can also produce such series, which are referred to as Taylor series .

Definition 6.74. Taylor Series.

Suppose a function \(f\) is defined at \(x=a\) and whose derivatives all exist at \(x=a\text{.}\) Then the Taylor series of \(f\) centred at \(x=a\) is given by

\begin{equation*} \begin{split} f(x) \amp = \sum_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!}(x-a)^n \\ \amp =f(a) + f'(a)(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \cdots + \frac{f^{(n)}(a)}{n!}(x-a)^n + \cdots \end{split} \end{equation*}
Notice that the Maclaurin series is a special case of the Taylor series when \(a=0\text{.}\)
Example 6.75. Taylor Series.

Find a Taylor series centred at \(-2\) for \(f(x)=1/(1-x)\text{.}\)

Solution

Method 1: We develop the series from scratch. Suppose \(f(x)=\ds\sum_{n=0}^{\infty}a_n(x+2)^n\text{.}\) We compute the \(k\)-th derivatives of \(f\) and the power series representation to solve for \(a_n\text{:}\)

Using our work in Example 6.71, the \(k\)-th derivative of \(f(x)=\frac{1}{1-x}\) is given by

\begin{equation*} f^{(k)}(x)=k!(1-x)^{-k-1}\text{.} \end{equation*}

Based on our work at the beginning of this section, the \(k\)-th derivative of the power series representation is given by

\begin{equation*} \sum_{n=k}^{\infty} \frac{n~}{(n-k)!}a_n(x+2)^{n-k}\text{.} \end{equation*}

Now we equate these two results to obtain the following equation:

\begin{equation*} k!(1-x)^{-k-1}=\sum_{n=k}^\infty {n!\over (n-k)!}a_n(x+2)^{n-k} \end{equation*}

and substituting \(x=-2\) we get \(\ds k!3^{-k-1}=k!a_k\) and \(\ds a_k=3^{-k-1}=1/3^{k+1}\text{,}\) so the series is

\begin{equation*} \sum_{n=0}^\infty {(x+2)^n\over 3^{n+1}}\text{.} \end{equation*}

Method 2: We use the formula for the Taylor series representation of \(f\text{:}\)

\begin{equation*} f(x)=\sum_{n=0}^{\infty} \frac{f^{(n)}(-2)}{n!}(x+2)^n\text{.} \end{equation*}

Now we compute the first few derivatives and evaluate them at \(x=-2\) to deduce a pattern:

\begin{equation*} \begin{array}{ll} f(x) = (1-x)^{-1} \amp f(-2) = \dfrac{1}{3} \\[1ex] f'(x)=(1-x)^{-2} \amp f'(-2) = \dfrac{1}{3^2} \\[1ex] f''(x) = 2!(1-x)^{-3} \amp f''(-2) = \dfrac{3!}{3^4} \\[1ex] f'''(x) = 3!(1-x)^{-4} \amp f'''(-2) = \dfrac{3!}{3^4} \end{array} \end{equation*}

Hence, the \(n\)-th derivative evaluated at \(x=-2\) is

\begin{equation*} f^{(n)}(-2) = \frac{n!}{3^{n+1}}\text{,} \end{equation*}

and so, as before, the series is

\begin{equation*} \sum_{n=0}^{\infty} \frac{f^{(n)}(-2)}{n!}(x+2)^n = \sum_{n=0}^{\infty} \frac{\frac{n!}{3^{n+1}}}{n!}(x+2)^n = \sum_{n=0}^\infty {(x+2)^n\over 3^{n+1}}\text{.} \end{equation*}
Example 6.76. Taylor Series.

Given \(f(x)=e^x\text{,}\) find the following:

  1. The Taylor series of \(f\) centred at 3.

  2. The interval of convergence for the series.

Solution
  1. We use the formula for the Taylor series representation of \(f\text{:}\)

    \begin{equation*} f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(3)}{n!}(x-3)^n \end{equation*}

    Since the derivative of \(f(x)=e^x\) is again \(e^x\text{,}\) we have that the \(n\)-th derivative evaluated at \(x=-3\) is

    \begin{equation*} f^{(n)}(3)=e^3\text{,} \end{equation*}

    and so the series is

    \begin{equation*} \sum_{n=0}^{\infty}\frac{f^{(n)}(3)}{n~}(x-3)^n = \sum_{n=0}^{\infty}\frac{e^3}{n!}(x-3)^n\text{.} \end{equation*}
  2. We use the Ratio Test to determine the radius of convergence:

    \begin{equation*} \begin{split} L \amp =\lim_{n\to\infty} \left\vert \frac{a_{n+1}}{a_n}\right\vert\\ \amp =\lim_{n\to\infty} \left\vert\frac{e^3(x-3)^{n+1}}{(n+1)!}\frac{n!}{e^3(x-3)^n}\right\vert\\ \amp =\lim_{n\to\infty} \left\vert\frac{x-3}{n+1}\right\vert \\ \amp = |x-3|\lim_{n\to\infty}\frac{1}{n+1} \\ \amp = 0 \end{split} \end{equation*}

    Hence, the radius of convergence is infinity, and so the series converges absolutely for every \(x\text{,}\) i.e. the interval of convergence is \((-\infty,\infty)\text{.}\)

Table 6.5 is a list of the five most common Maclaurin series and their interval of convergence.

\begin{equation*} \begin{array}{clc} \text{ Function } \amp \text{ Maclaurin series } \amp \text{ Interval of convergence } \\ \hline \frac{1}{1-x} \amp \ds\sum_{n=0}^{\infty} x^n \amp (-1,1) \\[2.5ex] e^x \amp \ds\sum_{n=0}^{\infty} \frac{1}{n!}x^n \amp (-\infty,\infty) \\[2.5ex] \ln(1+x) \amp \ds\sum_{n=1}^{\infty} (-1)^{n-1}\frac{x^n}{n} \amp (-1,1] \\[2.5ex] \sin(x) \amp \ds\sum_{n=0}^{\infty}(-1)^n \frac{x^{2n+1}}{(2n+1)!} \amp (-\infty,\infty) \\[2.5ex] \cos(x) \amp \ds\sum_{n=0}^{\infty} (-1)^n \frac{x^{2n}}{(2n)!} \amp (-\infty,\infty) \end{array} \end{equation*}
Table 6.5. Common Maclaurin series.
Exercises for Section 6.8.3.

For each function, find the Maclaurin series and the radius of convergence.

  1. \(f(x)=\cos x\)

    Answer
    \(\sum_{n=0}^{\infty} (-1)^n \frac{x^{2n}}{(2n)!}\text{,}\) \(R=\infty\text{.}\)
    Solution
    We compute:
    \begin{equation*} \begin{split} f(0) \amp= \cos (0) = 1\\ f'(0) \amp= -\sin(0) = 0\\ f''(0) \amp= -\cos(0) = -1 \\ f'''(0) \amp= \sin(0) = 0\\ f^{(iv)}(0) \amp= \cos(0) = 1 \vdots \end{split} \end{equation*}
    Therefore, our Maclaurin series expansion is
    \begin{equation*} \cos(x) = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^5}{5!} + \dots = \sum_{n=0}^{\infty} (-1)^n \frac{x^{2n}}{(2n)!}. \end{equation*}
    We now compute the radius of convegence using the Ratio Test:
    \begin{equation*} L = |x|^2 \lim_{n\to\infty} \left\vert \frac{1}{(2n+1)(2n+2)}\right\vert = 0. \end{equation*}
    Hence, \(R=\infty.\)
  2. \(f(x)=\ds e^x\)

    Answer
    \(\ds\sum_{n=0}^{\infty} \frac{x^n}{n!}\text{,}\) \(R=\infty.\)
    Solution
    We compute:
    \begin{equation*} \begin{split} f(0) \amp= e^{(0)} = 1\\ f'(0) \amp= e^{(0)} = 1\\ f''(0) \amp= e^{(0)} = 1 \\ \vdots \end{split} \end{equation*}
    Therefore, our Maclaurin series expansion is
    \begin{equation*} e^{x} = 1 + x+ \frac{x^2}{2!} + \frac{x^43}{3!} + \dots = \sum_{n=0}^{\infty} \frac{x^n}{n!}. \end{equation*}
    We now compute the radius of convegence using the Ratio Test:
    \begin{equation*} L = |x| \lim_{n\to\infty} \left\vert \frac{1}{n+1}\right\vert = 0. \end{equation*}
    Hence, \(R=\infty.\)
  3. \(f(x)=\dfrac{1}{1+x}\)

    Answer
    \begin{equation*} \sum_{n=0}^{\infty} (-1)^nx^n \text{ for } |x| \lt 1 \end{equation*}
    Solution

    The simplest method for determining the Maclaurin series for \(f(x) = \dfrac{1}{1+x}\) is to use a known series expansion. For example, we know that

    \begin{equation*} \frac{1}{1-x} = \sum_{n=0}^{\infty} x^n \text{ for } |x| \lt 1\text{,} \end{equation*}

    and so if we make the substitution \(x=-x\text{,}\) we find

    \begin{equation*} \frac{1}{1+x} = \sum_{n=0}^{\infty} (-1)^nx^n \text{ for } |x| \lt 1\text{.} \end{equation*}

    We could similarly use the fact that

    \begin{equation*} \frac{1}{1+x} = \diff{}{x} \ln(1+x) = \diff{}{x}\left(\sum_{n=1}^{\infty} (-1)^{n-1}\frac{x^n}{n}\right)\text{,} \end{equation*}

    or we could develop the desired Maclaurin series from scratch: The Maclaurin series expansion of a function \(f\) is given by

    \begin{equation*} f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}x^n\text{,} \end{equation*}

    and so we calculate

    \begin{equation*} \begin{split} f(x) \amp = \frac{1}{1+x} \\ f'(x) \amp = -\frac{1}{(1+x)^2} \\ f''(x) \amp = \frac{2}{(1+x)^3} \\ f'''(x) \amp = -\frac{6}{(1+x)^4} \\ \amp \vdots \\ f^{(n)}(x) \amp = \frac{(-1)^{n-1}n!}{(1+x)^{n+1}} \end{split} \end{equation*}

    Thus,

    \begin{equation*} f(x) = \sum_{n=0}^{\infty} \frac{(-1)^n n!}{(1+0)^{n+1} n!}x^n =\sum_{n=0}^{\infty} (-1)^n x^n\text{.} \end{equation*}

    We compute the radius of convergence using the Ratio Test:

    \begin{equation*} \begin{split} L \amp = \lim_{n\to\infty} \left\vert \frac{(-1)^{n+1}x^{n+1}}{(-1)^n x^n} \right\vert \\ \amp = \lim_{n\to\infty} \left\vert -x \right\vert = x, \end{split} \end{equation*}

    and so \(R=1\) as we found above.

  4. \(f(x)=\sin(2x)\)

    Answer
    \(\ds \sum_{n=0}^{\infty} (-1)^n \frac{2^{2n+1} x^{2n+1}}{(2n+1)!}\text{,}\) \(R=\infty.\)
    Solution
    We use the fact that
    \begin{equation*} \sin(x) = \sum_{n=0}^{\infty} (-1)^n \frac{x^{2n+1}}{(2n+1)!}, \end{equation*}
    with \(R=\infty\text{.}\) Now let \(x=2y\text{.}\) Then,
    \begin{equation*} \sin(2y) = \sum_{n=0}^{\infty} (-1)^n \frac{2^{2n+1} y^{2n+1}}{(2n+1)!}, \end{equation*}
    with \(R=\infty\text{.}\)

For each function, find the Taylor series centred at \(a\) and the radius of convergence.

  1. \(f(x) = \dfrac{1}{x}\text{,}\) \(a=5\)

    Answer
    \(\ds\sum_{n=0}^\infty (-1)^n{(x-5)^n\over 5^{n+1}}\text{,}\) \(R=5\)
    Solution

    Use the formula for the Taylor Series expansion of \(f\) about \(a=5\text{:}\)

    \begin{equation*} f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(5)}{n!}(x-5)^n \end{equation*}

    Therefore, we compute

    \begin{equation*} \begin{array}{ll} f(x) = \dfrac{1}{x} \amp f(5) = \dfrac{1}{5} \\[1.5ex] f'(x) = -\dfrac{1}{x^2} \amp f'(5) = -\dfrac{1}{25}\\[1.5ex] f''(x) = \dfrac{2}{x^3} \amp f''(5) = \dfrac{2}{125} \\[1.5ex] f'''(x) = -\dfrac{6}{x^4} \amp f'''(5) = -\dfrac{6}{625} \end{array} \end{equation*}

    and so

    \begin{equation*} f^{(n)}(5) = \dfrac{(-1)^{n}n!}{5^{n+1}} \text{ for } n \geq 0\text{.} \end{equation*}

    Thus, the Taylor Series expansion for \(f(x)=\dfrac{1}{x}\) about \(a=5\) is

    \begin{equation*} \frac{1}{x} = \sum_{n=0}^{\infty} \frac{(-1)^n}{5^{n+1}}(x-5)^n\text{.} \end{equation*}

    To determine the radius of convergence, we use the Ratio Test:

    \begin{equation*} \begin{split} L \amp = \lim_{n\to\infty} \left\vert \frac{(-1)^{n+1}(x-5)^{n+1}}{5^{n+2}} \frac{5^{n+1}}{(-1)^n (x-5)^n} \right\vert \\ \amp = \lim_{n\to\infty} \left\vert \frac{-(x-5)}{5} \right\vert \\ \amp = \frac{1}{5} (x-5) \end{split} \end{equation*}

    Therefore, \(R=5\text{.}\)

  2. \(f(x)=\ln x\text{,}\) \(a=1\)

    Answer
    \(\ds\sum_{n=1}^\infty (-1)^{n-1}{(x-1)^n\over n}\text{,}\) \(R=1\)
    Solution

    Use the formula for the Taylor Series expansion of \(f\) about \(a=1\text{,}\)

    \begin{equation*} f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(1)}{n!}(x-1)^n \end{equation*}

    Notice that \(f(1) = \ln(1) = 0\text{,}\) and so we have

    \begin{equation*} f(x) = 0 + \sum_{n=1}^{\infty} \frac{f^{(n)}(1)}{n!}(x-1)^n\text{.} \end{equation*}

    We compute the first few derivatives evaluated at \(1\) to discern a pattern:

    \begin{equation*} \begin{array}{ll} f'(x) = \dfrac{1}{x} \amp f'(1) = 1\\[1.5ex] f''(x) = -\dfrac{1}{x^2} \amp f''(1) = -1 \\[1.5ex] f'''(x) = \dfrac{2}{x^3} \amp f'''(1) = 2 \end{array} \end{equation*}

    and so

    \begin{equation*} f^{(n)}(1) = (-1)^{n-1}(n-1)! \text{ for } n \geq 1\text{.} \end{equation*}

    Therefore, about \(a=1\) we have

    \begin{equation*} \ln x = \sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{n} (x-1)^n \end{equation*}

    with radius of convergence \(R=1\text{.}\)

  3. \(f(x)=\ln x\text{,}\) \(a=2\)

    Answer
    \(\ds\ln(2)+\sum_{n=1}^\infty (-1)^{n-1}{(x-2)^n\over n 2^n}\text{,}\) \(R=2\)
    Solution
    Use the formula for the Taylor Series expansion of \(f\) about \(a=2\text{,}\)
    \begin{equation*} f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(2)}{n!}(x-2)^n. \end{equation*}
    We compute:
    \begin{equation*} \begin{array}{ll} f'(x) = \dfrac{1}{x} \amp f'(2) = \frac{1}{2}\\[1.5ex] f''(x) = -\dfrac{1}{x^2} \amp f''(2) = -\frac{1}{4} \\[1.5ex] f'''(x) = \dfrac{2}{x^3} \amp f'''(2) = \frac{1}{4}\\[1.5ex] f^{(iv)}(x) = \frac{-6}{x^4} \amp f^{(iv)}(2) = \frac{-3}{8} \end{array} \end{equation*}
    Therefore, we have
    \begin{equation*} f(x) = \ln(2) + \frac{x-2}{2} - \frac{1}{8} (x-2)^2 + \frac{1}{24} (x-2)^3 - \frac{1}{64} (x-2)^4 + \dots \end{equation*}
    Hence,
    \begin{equation*} \ln(x) = \ln(2) + \sum_{n=1}^{\infty} (-1)^{n-1} \frac{(x-2)^n}{n2^n} \end{equation*}
    with radius of convergence \(R=2\text{.}\)
  4. \(f(x)=\ds \dfrac{1}{x^2}\text{,}\) \(a=1\)

    Answer
    \(\ds\sum_{n=0}^\infty (-1)^n(n+1)(x-1)^n\text{,}\) \(R=1\)
    Solution
    Use the formula for the Taylor Series expansion of \(f\) about \(a=1\text{,}\)
    \begin{equation*} f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(1)}{n!}(x-1)^n. \end{equation*}
    We compute:
    \begin{equation*} \begin{array}{ll} f'(x) = \dfrac{-2}{x^3} \amp f'(1) = -2\\[1.5ex] f''(x) = -\dfrac{6}{x^4} \amp f''(1) = 6 \\[1.5ex] f'''(x) = \dfrac{-24}{x^5} \amp f'''(1) = -24 \end{array} \end{equation*}
    Therefore, we have
    \begin{equation*} f(x) = 1-2(x-1)+3(x-1)^2-4(x-1)^3 + \dots \end{equation*}
    Hence,
    \begin{equation*} \frac{1}{x^2} = \sum_{n=0}^{\infty} (-1)^{n}(n-1) (x-1)^n \end{equation*}
    with radius of convergence \(R=1\text{.}\)

Find the first four terms of the Maclaurin series for the following functions:

  1. \(f(x) = \tan x\)

    Answer
    \begin{equation*} \tan(x) = x + \frac{x^3}{3} +\frac{2 x^5}{15} + \frac{17 x^7}{215} + \dots \end{equation*}
    Solution
    We differentiate until we get gour nonzero terms:
    \begin{equation*} \begin{array}{ll} f(x) = \tan(x) \amp f(0) = 0 \\[1.5ex] f'(x) = \sec^2(x) \amp f'(0) = 1\\[1.5ex] f''(x) = 2\tan(x)\sec^2(x) \amp f''(0) =0\\[1.5ex] f'''(x) = 2\sec^2(x) \bigl(2\tan^2(x) + \sec^2(x)\bigr) \amp f'''(0) = 2\\[1.5ex] f^{(iv)}(x) = 8\tan(x)\sec^2(x)\bigl(\tan^2(x) + 2\sec^2(x)\bigr) \amp f^{(iv)}(0) = 0 \\[1.5ex] f^{(v)}(x) = 8\sec^2(x)\bigl(2\tan^4(x) + 2\sec^4(x) + 11\tan^2(x)\sec^2(x)\bigr) \amp f^{(v)}(0) = 16\\[1.5ex] f^{(vi)}(x) = \dots \amp f^{(vi)}(0) = 0 \\[1.5ex] f^{(vii)}(x) =\dots \amp f^{(vii)}(0) = 272 \end{array} \end{equation*}
    Hence, the first four terms in the Maclaurin series are
    \begin{equation*} \begin{split} \tan(x)\amp = \frac{x}{1!} + 2\frac{x^3}{3!} + 16 \frac{x^5}{5!} + 272 \frac{x^7}{7!} + \dots\\ \amp = x + \frac{x^3}{3} +\frac{2 x^5}{15} + \frac{17 x^7}{215} + \dots \end{split} \end{equation*}
  2. \(\ds f(x)=x\cos (x^2)\)

    Answer
    \begin{equation*} x\cos(x^2) = x - \frac{x^5}{2} + \frac{x^9}{24} - \frac{x^13}{720} + \dots \end{equation*}
    Solution
    We differentiate until we get gour nonzero terms:
    \begin{equation*} \begin{array}{ll} f(x) = x\cos(x^2) \amp f(0) = 0\\[1.5ex] f'(x) = \cos(x^2) - 2 x^2 \sin(x^2) \amp f'(0) = 1\\[1.5ex] f''(x) = -6 x \sin(x^2) - 4 x^3 \cos(x^2) \amp f''(0) = 0 \\[1.5ex] f'''(x) = 2 (4 x^4 - 3) \sin(x^2) - 24 x^2 \cos(x^2)\amp f'''(0) = 0 \\[1.5ex] f^{(iv)}(x) = 4 (4 x^4 - 15) x \cos(x^2) + 80 x^3 \sin(x^2) \amp f^{(iv)}(0) = 0 \\[1.5ex] f^{(v)}(x) = 8 (45 - 4 x^4) x^2 \sin(x^2) + 60 (4 x^4 - 1) \cos(x^2) \amp f^{(v)}(0) = -60 \\[1.5ex] \end{array} \end{equation*}
    Eventually, we find that
    \begin{equation*} x\cos(x^2) = x - \frac{x^5}{2} + \frac{x^9}{24} - \frac{x^13}{720} + \dots \end{equation*}
  3. \(\ds f(x) = xe^{-x}\)

    Answer
    \begin{equation*} \begin{split} xe^{-x} \amp= x - x^2 + \frac{x^3}{2} - \frac{x^4}{6} + \dots \end{split} \end{equation*}
    Solution
    We differentiate until we get gour nonzero terms:
    \begin{equation*} \begin{array}{ll} f(x) = xe^{-x} \amp f(0) = 0 \\[1.5ex] f'(x) = e^{-x} (1 - x) \amp f'(0) = 1 \\[1.5ex] f''(x) = e^{-x} (x - 2) \amp f''(0) = -2\\[1.5ex] f'''(x) = -e^{-x} (x - 3)\amp f'''(0) = 3\\[1.5ex] f^{(iv)}(x) = e^{-x} (x - 4) \amp f^{(iv)}(0) = -4 \end{array} \end{equation*}
    Therefore, we have
    \begin{equation*} \begin{split} xe^{-x} \amp= \frac{x}{1!} - \frac{2x^2}{2!} + \frac{3x^3}{3!} - \frac{4x^4}{4!} + \dots\\ \amp= x - x^2 + \frac{x^3}{2} - \frac{x^4}{6} + \dots \end{split} \end{equation*}

Subsection 6.8.4 Taylor Polynomials

While the Taylor series can be thought of as an infinite degree polynomial, its partial sum \(s_n\) is a polynomial of degree \(n\) and referred to as Taylor polynomial.

Interactive Demonstration. Investigate the Taylor Polynomial \(T_n \) of \(f \) centred at \(x = 0\text{.}\) What happens as \(n \) increases?

Definition 6.77. Taylor Polynomial.

Suppose a function \(f\) is defined at \(x=a\text{.}\) Then the Taylor polynomial of \(f\) centred at \(x=a\) with degree \(n\) is given by

\begin{equation*} T_n(x) = f(a)+f'(a)(x-a)+\frac{f''(a)}{2!}(x-a)^2 + \cdots + \frac{f^{(n)}(a)}{n!}(x-a)^n\text{.} \end{equation*}
Note: Notice that the first degree Taylor polynomial is the familiar linearization of \(f\) at \(x=a\text{:}\)
\begin{equation*} T_1(x) = f(a)+f'(a)(x-a) = L(x)\text{.} \end{equation*}

In fact, Taylor polynomials can be thought of as approximations of the function \(f\text{.}\) Let us explore this concept visually. In Example 6.72, we developed the Taylor series of \(f(x)=sin(x)\) centred at zero

\begin{equation*} \sum_{n=0}^{\infty} (-1)^n \frac{x^{2n+1}}{(2n+1)!} \end{equation*}

with interval of convergence \((-\infty,\infty)\text{.}\) A linear approximation of sine is given by

\begin{equation*} T_1(x)= f(0) + f'(0)(x-0) = cos(0)x = x \end{equation*}

and shown below. Only at values close around zero is this linear approximation good enough to represent sine values.

When we calculate \(T_2\text{,}\)

\begin{equation*} T_2(x) = T_1(x) + \frac{-\sin(0)}{2!} = T_1(x)\text{,} \end{equation*}

we notice that this is again \(T_1\text{,}\) since \(-\sin(0) = 0\text{.}\) In fact, \(T_{2n} = T_{2n-1}\) for \(n \geq 1\text{,}\) since all even derivatives of the sine function will be positive or negative sine, and sine evaluated at zero is zero. This means that there is no quadratic Taylor polynomial approximation for sine using this series.

Let us compute \(T_3\text{:}\)

\begin{equation*} T_3(x) = T_1(x) + \frac{-\cos(0)}{3!}x^3 = x-\frac{x^3}{6}\text{,} \end{equation*}

which yields a cubic approximation for sine as shown below. Notice that this cubic is already a better fit to sine than the linear one.

We compute one last Taylor polynomial, \(T_5\text{:}\)

\begin{equation*} T_5(x) = T_3(x) + \frac{\cos(0)}{5!}x^5 = x-\frac{x^3}{6} + \frac{x^5}{120}\text{.} \end{equation*}

The graph below shows this approximation, and we can readily believe that continuing this process, we get an even better fit to sine, and thus a better and better approximation of sine.

One question that naturally arises is, How accurately do the Taylor polynomials approximate the function? This question will be responded to in the next section.

Here is an example.

Example 6.78. Approximate e using Taylor Polynomials.

Approximate \(e^x\) using Taylor polynomials at \(a=0\text{,}\) and use this to approximate \(e\text{.}\)

Solution

In this case we use the function \(f(x)=e^x\) at \(a=0\text{,}\) and therefore

\begin{equation*} T_n(x)=a_0+a_1x+a_xx^2+a_3x^3+\ldots +a_nx^n \end{equation*}

Since all derivatives \(f^{(k)}(x)=e^x\text{,}\) we get:

\begin{equation*} \begin{array}{l} a_0=f(0)=1 \\ a_1=\frac{f'(0)}{1!}=1 \\ a_2=\frac{f''(0)}{2!}=\frac{1}{2!} \\ a_3=\frac{f'''(0)}{3!}=\frac{1}{3!} \\ \cdots \\ a_k=\frac{f^{(k)}(0)}{k!}=\frac{1}{k!} \\ \cdots \\ a_n=\frac{f^{(n)}(0)}{n!}=\frac{1}{n!} \end{array} \end{equation*}

Thus

\begin{equation*} \begin{array}{l} T_1(x)=1+x=L(x) \\ T_2(x)=1+x+\frac{x^2}{2!} \\ T_3(x)=1+x+\frac{x^2}{2!}+\frac{x^3}{3!} \end{array} \end{equation*}

and in general

\begin{equation*} T_n(x)=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots +\frac{x^n}{n!}\text{.} \end{equation*}

Finally, we can approximate \(e=f(1)\) by simply calculating \(T_n(1)\text{.}\) A few values are:

\begin{equation*} \begin{array}{l} T_1(1)=1+1=2 \\ T_2(1)=1+1+\frac{1^2}{2!}=2.5 \\ T_4(1)=1+1+\frac{1^2}{2!}+\frac{1^3}{3!}=2.\overline{6} \\ T_8(1)=2.71825396825 \\ T_{20}(1)=2.71828182845 \end{array} \end{equation*}

We can continue this way for larger values of \(n\text{,}\) but \(T_{20}(1)\) is already a pretty good approximation of \(e\text{,}\) and we took only 20 terms!

Exercises for Section 6.8.4.

Find the 5th degree Taylor polynomial for \(f(x)=\sin x\) around \(a=0\text{.}\)

  1. Use this Taylor polynomial to approximate \(\sin (0.1)\text{.}\) Answer
    \(T_5(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!}\text{,}\) so \(\sin (0.1)\approx T_5(0.1)\approx 0.10016675\)
  2. Use a calculator to find \(\sin (0.1)\text{.}\) How does this compare to our approximation in part (a)? Answer
    \(T_5(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!}\text{,}\) so \(\sin (0.1)=0.0998334\ldots\) using a calculator. Our approximation is accurate to \(0.10016675-0.0998334\ldots =0.000\bar{3}\text{.}\)

Find the 3rd degree Taylor polynomial for \(f(x)=\frac{1}{1-x}-1\) around \(a=0\text{.}\) Explain why this approximation would not be useful for calculating \(f(5)\text{.}\) Answer

We find that
\begin{equation*} T_3(x) = x + x + x^3. \end{equation*}
This series has a radius of convergence of \(R=1\text{,}\) and so is not a valid approximation for \(f(5)\text{.}\)

Consider \(f(x)=\ln x\) around \(a=1\text{.}\)

  1. Find a general formula for \(f^{(n)}(x)\) for \(n\geq 1\text{.}\)

    Answer
    \(f^{(n)}(x)=\frac{(-1)^{(n-1)}(n-1)!}{x^n}\)
    Solution

    We compute the first few derivatives to discern a pattern:

    \begin{equation*} \begin{split} f'(x) = \dfrac{1}{x}\\ f''(x) = -\dfrac{1}{x^2} \\ f'''(x) = \dfrac{2}{x^3} \end{split} \end{equation*}

    and so

    \begin{equation*} f^{(n)}(x) = \frac{(-1)^{n-1}(n-1)!}{x^{n}} \text{ for } n \geq 1\text{.} \end{equation*}
  2. Find a general formula for the Taylor Polynomial, \(T_n(x)\text{.}\)

    Answer
    \(T_n(x)=\ln (1)+\displaystyle\sum_{i=1}^{n} \frac{\big(\frac{(-1)^{(i-1)}(i-1)!}{1^n}\big)}{i!}(x-1)^i=\displaystyle\sum_{i=1}^{n} \bigg(\frac{(-1)^{(i-1)}(i-1)!}{i!}\bigg)(x-1)^i\) since \(\ln (1)=0\) and \(1^n=1\text{.}\)
    Solution

    The general Taylor polynomial of \(f(x) = \ln x\) centred at \(a=1\) is

    \begin{equation*} T_n(x) = f(1) + f'(1)(x-1) + \frac{f''(1)}{2!}(x-1)^2+\cdots + \frac{f^{(n)}(1)}{n!}(x-1)^n\text{.} \end{equation*}

    From part (a), we know that

    \begin{equation*} f^{(n)}(1) = (-1)^{n-1}(n-1)! \end{equation*}

    and so

    \begin{equation*} T_n(x) = \sum_{i=1}^n \frac{f^{(i)}(1)}{i!}(x-1)^i = \frac{(-1)^{i-1}(i-1)!}{i!}(x-1)^i\text{.} \end{equation*}

Approximate \(\ln(1.3)\) to accuracy of at least 0.0001. Answer

0.2623
Solution
We first recongize that
\begin{equation*} \ln(1.3) = \ln(13/10) = -\ln(10/13). \end{equation*}
Since \(10/13 \lt 1\text{,}\) we can use the Taylor Series expansion of \(\ln(1+x)\) about \(x=0\text{:}\)
\begin{equation*} T_5(x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \frac{x^5}{5}. \end{equation*}
Therefore,
\begin{equation*} \ln(1-3/13) \approx \left(-\frac{3}{13}\right) - \left(-\frac{3}{13}\right) ^2 \frac{1}{2} + \left(-\frac{3}{13}\right) ^3 \frac{1}{3} - \left(-\frac{3}{13}\right) ^4 \frac{1}{4} + \left(-\frac{3}{13}\right) ^5 \frac{1}{5} = -0.26233 \dots \end{equation*}
Therefore,
\begin{equation*} \ln(13/10) \approx 0.2623. \end{equation*}
The exact value is about 0.2623... and so this is a good approximation.

Subsection 6.8.5 Taylor's Theorem

One of the most important uses of infinite series is using an initial portion of the series for \(f\) to approximate \(f\text{.}\) We have seen, for example, that when we add up the first \(n\) terms of an alternating series with decreasing terms that the difference between this and the true value is at most the size of the next term. A similar result is true of many Taylor series, which is captured in Taylor's Theorem. This theorem is essentially a generalized version of the mean value theorem. It comes in a few different forms and we only state one form that is useful for this course.

The proof requires some cleverness to set up, but then the details are quite elementary. We define a function \(F(t)\) as follows:

\begin{equation*} F(t)=\sum_{n=0}^N{f^{(n)}(t)\over n!}\,(x-t)^n + B(x-t)^{N+1}\text{.} \end{equation*}

Here we have replaced \(a\) by \(t\) in the first \(N+1\) terms of the Taylor series, and added a carefully chosen term on the end, with \(B\) to be determined. Note that we are temporarily keeping \(x\) fixed, so the only variable in this equation is \(t\text{,}\) and we will be interested only in \(t\) between \(a\) and \(x\text{.}\) Now substitute \(t=a\text{:}\)

\begin{equation*} F(a)=\sum_{n=0}^N{f^{(n)}(a)\over n!}\,(x-a)^n + B(x-a)^{N+1}\text{.} \end{equation*}

Set this equal to \(f(x)\text{:}\)

\begin{equation*} f(x)=\sum_{n=0}^N{f^{(n)}(a)\over n!}\,(x-a)^n + B(x-a)^{N+1}\text{.} \end{equation*}

Since \(x\not=a\text{,}\) we can solve this for \(B\text{,}\) which is a “constant” —it depends on \(x\) and \(a\) but those are temporarily fixed. Now we have defined a function \(F(t)\) with the property that \(F(a)=f(x)\text{.}\) Also, all terms with a positive power of \((x-t)\) become zero when we substitute \(x\) for \(t\text{,}\) so \(\ds F(x)=f^{(0)}(x)/0!=f(x)\text{.}\) So \(F(a)=F(x)\text{.}\) By Rolle's Theorem (from Differential Calculus), we know that there is a value \(z\in(a,x)\) such that \(F'(z)=0\text{.}\) But what is \(F'\text{?}\) Each term in \(F(t)\text{,}\) except the first term and the extra term involving \(B\text{,}\) is a product, so to take the derivative we use the Product Rule on each of these terms.

\begin{align*} F(t)=f(t)\amp +{f^{(1)}(t)\over 1!}(x-t)^1+{f^{(2)}(t)\over 2!}(x-t)^2+{f^{(3)}(t)\over 3!}(x-t)^3+\cdots\\ \amp +{f^{(N)}(t)\over N!}(x-t)^N+B(x-t)^{N+1}\text{.} \end{align*}

So the derivative is

\begin{align*} F'(t) = f'(t) \amp +\left({f^{(1)}(t)\over 1!}(x-t)^0(-1)+{f^{(2)}(t)\over 1!}(x-t)^1\right)\\ \amp +\left({f^{(2)}(t)\over 1!}(x-t)^1(-1)+{f^{(3)}(t)\over 2!}(x-t)^2\right)\\ \amp +\left({f^{(3)}(t)\over 2!}(x-t)^2(-1)+{f^{(4)}(t)\over 3!}(x-t)^3\right)+\dots\\ \amp +\left({f^{(N)}(t)\over (N-1)!}(x-t)^{N-1}(-1)+{f^{(N+1)}(t)\over N!}(x-t)^N\right)\\ \amp +B(N+1)(x-t)^N(-1)\text{.} \end{align*}

The second term in each parenthesis cancel with the first term in the next one, leaving just

\begin{equation*} F'(t) = {f^{(N+1)}(t)\over N!}(x-t)^N+B(N+1)(x-t)^N(-1)\text{.} \end{equation*}

At some \(z\text{,}\) \(F'(z)=0\) so

\begin{align*} 0\amp ={f^{(N+1)}(z)\over N!}(x-z)^N+B(N+1)(x-z)^N(-1)\\ B(N+1)(x-z)^N\amp ={f^{(N+1)}(z)\over N!}(x-z)^N\\ B\amp ={f^{(N+1)}(z)\over (N+1)!}\text{.} \end{align*}

Now we can write

\begin{equation*} F(t)=\sum_{n=0}^N{f^{(n)}(t)\over n!}\,(x-t)^n + {f^{(N+1)}(z)\over (N+1)!}(x-t)^{N+1}\text{.} \end{equation*}

Recalling that \(F(a)=f(x)\) we get

\begin{equation*} f(x)=F(a)=\sum_{n=0}^N{f^{(n)}(a)\over n!}\,(x-a)^n + {f^{(N+1)}(z)\over (N+1)!}(x-a)^{N+1}\text{,} \end{equation*}

which is what we wanted to show.

Note:

  1. In essence, Taylor's Theorem says that

    \begin{equation*} f(x) = T_n(x) + R_n(x)\text{,} \end{equation*}

    where \(T_n\) is the \(n\)-th degree Taylor polynomial and \(R_n\) is the so-called remainder term.

  2. We often estimate the remainder

    \begin{equation*} R_n(x) = \frac{f^{(n+1)}(z)(x-a)^{n+1}}{(n+1)!} \end{equation*}

    without knowing the value of \(z\) as will be seen in Example 6.80.

  3. An important consequence of Taylor's Theorem is that if \(\lim\limits_{n\to\infty} R_n(x)=0\) for all \(x\) in the open interval \(I\text{,}\) then

    \begin{equation*} f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!}(x-a)^n\text{,} \end{equation*}

    i.e. the Taylor series centred at \(a\) of \(f\) converges to \(f\) on \(I\text{.}\)

Example 6.80. Approximating Sine.

Find a polynomial approximation for \(\sin x\) accurate to \(\pm 0.005\) for values of \(x\) in \([-\pi/2,\pi/2]\text{.}\)

Solution

From Taylor's Theorem with \(a=0\text{:}\)

\begin{equation*} \sin x= \sum_{n=0}^N{f^{(n)}(0)\over n!}\,x^n + {f^{(N+1)}(z)\over (N+1)!}x^{N+1}\text{.} \end{equation*}

What can we say about the size of the term

\begin{equation*} {f^{(N+1)}(z)\over (N+1)!}x^{N+1}? \end{equation*}

Every derivative of \(\sin x\) is \(\pm\sin x\) or \(\pm\cos x\text{,}\) so \(\ds |f^{(N+1)}(z)|\le 1\text{.}\)

So we need to pick \(N\) so that

\begin{equation*} \left|{x^{N+1}\over (N+1)!}\right|\lt 0.005\text{.} \end{equation*}

Since we have limited \(x\) to \([-\pi/2,\pi/2]\text{,}\)

\begin{equation*} \left|{x^{N+1}\over (N+1)!}\right|\lt \left(\frac{\pi}{2}\right)^N + \frac{1}{N+1}! \lt {2^{N+1}\over (N+1)!}\text{.} \end{equation*}

The quantity on the right decreases with increasing \(N\text{,}\) so all we need to do is find an \(N\) so that

\begin{equation*} {2^{N+1}\over (N+1)!}\lt 0.005\text{.} \end{equation*}

A little trial and error shows that \(N=8\) works, and in fact \(\ds 2^{9}/9!\lt 0.0015\text{,}\) so

\begin{align*} \sin x \amp =\sum_{n=0}^8{f^{(n)}(0)\over n!}\,x^n \pm 0.0015\\ \amp =x-{x^3\over 6}+{x^5\over 120}-{x^7\over 5040}\pm 0.0015\text{.} \end{align*}

The graphs of \(\sin x\) and and the approximation are shown below. As \(x\) gets larger, the approximation heads to negative infinity very quickly, since it is essentially acting like \(\ds -x^7\text{.}\)

Note: We can now approximate the value of \(\sin(x)\) to within 0.005 by using simple trigonometric identities to translate \(x\) into the interval \([-\pi/2,\pi/2]\text{.}\)

We can extract a bit more information from this example.

Example 6.81. Convergence of Power Series Representation of Sine.

Show that

\begin{equation*} \sin x = \sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!} x^n \end{equation*}

by showing that \(\lim\limits_{n\to\infty}R_n(x) = 0\text{.}\)

Solution

If we do not limit the value of \(x\text{,}\) we still have

\begin{equation*} \left|{f^{(N+1)}(z)\over (N+1)!}x^{N+1}\right|\le \left|{x^{N+1}\over (N+1)!}\right| \end{equation*}

so that \(\sin x\) is represented by

\begin{equation*} \sum_{n=0}^N{f^{(n)}(0)\over n!}\,x^n \pm \left|{x^{N+1}\over (N+1)!}\right|\text{.} \end{equation*}

If we can show that

\begin{equation*} \lim_{N\to\infty} \left|{x^{N+1}\over (N+1)!}\right|=0 \end{equation*}

for each \(x\) then

\begin{equation*} \sin x=\sum_{n=0}^\infty{f^{(n)}(0)\over n!}\,x^n = \sum_{n=0}^\infty (-1)^n{x^{2n+1}\over (2n+1)!}\text{,} \end{equation*}

that is, the sine function is actually equal to its Maclaurin series for all \(x\text{.}\) How can we prove that the limit is zero? Suppose that \(N\) is larger than \(|x|\text{,}\) and let \(M\) be the largest integer less than \(|x|\) (if \(M=0\) the following is even easier). Then

\begin{align*} {|x^{N+1}|\over (N+1)!} \amp = {|x|\over N+1}{|x|\over N}{|x|\over N-1}\cdots{|x|\over M+1}{|x|\over M}{|x|\over M-1}\cdots {|x|\over 2}{|x|\over 1}\\ \amp \le {|x|\over N+1}\cdot 1\cdot 1\cdots 1\cdot{|x|\over M}{|x|\over M-1}\cdots {|x|\over 2}{|x|\over 1}\\ \amp ={|x|\over N+1}{|x|^M\over M!}\text{.} \end{align*}

The quantity \(|x|^M/ M!\) is a constant, so

\begin{equation*} \lim_{N\to\infty} {|x|\over N+1}{|x|^M\over M!} = 0 \end{equation*}

and by the Squeeze Theorem 6.7

\begin{equation*} \lim_{N\to\infty} \left|{x^{N+1}\over (N+1)!}\right|=0 \end{equation*}

as desired.

Essentially the same argument works for \(\cos x\) and \(\ds e^x\text{.}\) Unfortunately, it is more difficult to show that most functions are equal to their Maclaurin series.

Example 6.82. Approximating \(e\).

Find a polynomial approximation for \(\ds e^x\) near \(x=2\) accurate to \(\pm 0.005\text{.}\)

Solution

From Taylor's Theorem:

\begin{equation*} e^x= \sum_{n=0}^N{e^2\over n!}\,(x-2)^n + {e^z\over (N+1)!}(x-2)^{N+1}\text{,} \end{equation*}

since \(\ds f^{(n)}(x)=e^x\) for all \(n\text{.}\) We are interested in \(x\) near 2, and we need to keep \(\ds |(x-2)^{N+1}|\) in check, so we may as well specify that \(|x-2|\le 1\text{,}\) so \(x\in[1,3]\text{.}\) Also

\begin{equation*} \left|{e^z\over (N+1)!}\right|\le {e^3\over (N+1)!}\text{,} \end{equation*}

so we need to find an \(N\) that makes \(\ds e^3/(N+1)!\le 0.005\text{.}\) This time \(N=6\) makes \(\ds e^3/(N+1)!\lt 0.004\text{,}\) so the approximating polynomial is

\begin{equation*} e^x=e^2+e^2(x-2)+{e^2\over2}(x-2)^2+{e^2\over6}(x-2)^3+ {e^2\over24}(x-2)^4+{e^2\over120}(x-2)^5 \pm 0.004\text{.} \end{equation*}

Note that our approximation requires that we already have a very accurate approximation of the value \(e^2\text{,}\) which we shouldn't assume we have in the context of trying to approximate \(e^x\text{.}\) For this reason we typically try to centre our series on values for which the derivative of the function is easy to evaluate (e.g. \(a=0\)).

Note well that in these examples we found polynomials of a certain accuracy only on a small interval, even though the series for \(\sin x\) and \(\ds e^x\) converge for all \(x\text{.}\) This is typical. To get the same accuracy on a larger interval would require more terms.

Exercises for Section 6.8.5.

Find a polynomial approximation for each of the functions on the given interval within the stated error.

  1. \(f(x) = \cos x\text{,}\) \([0,\pi]\text{,}\) \(\ds \pm 10^{-3}\)

    Solution

    We wish to approximate \(f(x) = \cos x\) on the interval \(I=[0,\pi]\text{.}\) By Taylor's Theorem,

    \begin{equation*} \cos x = \sum_{n=0}^N \frac{f^{n}(\pi/2)}{n!}(x-\pi/2)^n + \frac{f^{N+1}(z)}{(N+1)!}(x-\pi/2)^{N+1}\text{,} \end{equation*}

    where we took \(a=\pi/2\text{.}\) We need to determine the number of terms \(N\) required. By Taylor's Theorem, the remainder term is of the form

    \begin{equation*} R_n = \frac{f^{(N+1)}(z)}{(N+1)!} (x-\pi/2)^{N+1} \end{equation*}

    for some \(z\) between \(x\) and \(\pi/2\text{.}\) Therefore, we require

    \begin{equation*} |R_n| = \left\vert \frac{f^{(N+1)}(z)}{(N+1)!} \left(x-\frac{\pi}{2}\right)^{N+1}\right\vert \leq 0.01 \end{equation*}

    We know that \(|f^{(N+1)}(z)| \leq 1\) for all \(z\text{,}\) and that for all \(x \in I\) we have that \(|(x-\pi/2)^{N+1}| \leq (\pi/2)^{N+1}\text{.}\) Thus, we have

    \begin{equation*} |R_n| \leq \left\vert \frac{(\pi/2)^{N+1}}{(N+1)!} \right\vert \leq 0.01\text{.} \end{equation*}

    We find that \(R_6 \approx 0.005 \lt 0.01\text{,}\) and so

    \begin{equation*} \begin{split} \cos x \amp= \sum_{n=0}^{6} \frac{f^{(n)}(\pi/2)}{n!} \left(x-\frac{\pi}{2}\right)^n \pm 0.01\\ \amp= -\left(x-\frac{\pi}{2}\right)+\frac{\left(x-\frac{\pi}{2}\right)^3}{3!}-\frac{\left(x-\frac{\pi}{2}\right)^5}{5!} \pm 0.01. \end{split} \end{equation*}

    We verify the result with the graph below.

  2. \(f(x) = \ln x\text{,}\) \([1/2,3/2]\text{,}\) \(\ds 10^{-3}\) Answer

    We need 1000 terms.
    Solution
    We wish to approximate \(f(x) = \ln x\) on the interval \(I=[1/2,3/2]\text{.}\) By Taylor's Theorem,
    \begin{equation*} \ln x = \sum_{n=0}^N \frac{f^{n}(1)}{n!}(x-1)^n + \frac{f^{N+1}(z)}{(N+1)!}(x-1)^{N+1}, \end{equation*}
    where we took \(a=1\) (the midpoint of \(I\)). We know that the derivatives of \(\ln(x)\) evaluated at 1 take the form
    \begin{equation*} \left\vert f^{(N)}(x) \right\vert = \left\vert \frac{(N-1)!}{x^N}\right\vert \implies \left\vert f^{(N+1)}(z) \right\vert \leq 2^{N+1} N! \end{equation*}
    for all \(z \in I\text{.}\)Therefore,
    \begin{equation*} \begin{split} |R_N| \amp \leq \left\vert \frac{2^{N+1} N!}{(N+1)!} (x-1)^{N+1} \right\vert\\ \amp = \frac{2^{N+1}}{N+1} \left\vert(x-1)^{N+1}\right\vert \\ \amp \leq \frac{2^{N+1}}{N+1} \left(\frac{1}{2^{N+1}}\right)\\ \amp = \frac{1}{N+1} \end{split} \end{equation*}
    for all \(x \in I \text{.}\) Hence,
    \begin{equation*} |R_N| \leq \frac{1}{N+1}. \end{equation*}
    Thus, if we need an accuracy of at least \(10^{-3}\text{,}\) this means we need at least 1000 terms in the Taylor Series approximation.

  3. \(f(x) = \ln x\text{,}\) \([1,3/2]\text{,}\) \(\ds 10^{-3}\) Answer

    We need at least 8 terms.
    Solution
    We wish to approximate \(f(x) = \ln x\) on the interval \(I=[1,3/2]\text{.}\) By Taylor's theorem,
    \begin{equation*} \ln x = \sum_{n=0}^N \frac{f^{n}(1)}{n!}(x-1)^n + \frac{f^{N+1}(z)}{(N+1)!}(x-1)^{N+1}, \end{equation*}
    where we took \(a=1\text{.}\) We know that the derivatives of \(\ln(x)\) evaluated at 1 take the form
    \begin{equation*} \left\vert f^{(N)}(x) \right\vert = \left\vert \frac{(N-1)!}{x^N}\right\vert \implies \left\vert f^{(N+1)}(z) \right\vert \leq N! \end{equation*}
    for all \(z \in I\text{.}\) Therefore,
    \begin{equation*} \begin{split} |R_N| \amp \leq \left\vert \frac{N!}{(N+1)!} (x-1)^{N+1}\right\vert\\ \amp= \frac{1}{N+1} \left\vert(x-1)^{N+1}\right\vert \\ \amp \leq \frac{2^{N+1}}{N+1} \left(\frac{1}{2^{N+1}}\right)\\ \amp = \frac{1}{(N+1) 2^{N+1}} \end{split} \end{equation*}
    for all \(x \in I\text{.}\) Thus, if we need an accuracy of at least \(10^{-3}\text{,}\) this means we need at least 8 terms in the Taylor Series approximation.

Show that each function is equal to its Taylor series for all \(x\) by showing that \(\lim\limits_{n\to\infty}R_n(x) = 0\text{.}\)

  1. \(f(x) = \cos x\) Solution

    We compute
    \begin{equation*} |R_N| = \left\vert \frac{f^{(N+1)}(z)}{(N+1)!} (x-a)^N\right\vert. \end{equation*}
    Now, since
    \begin{equation*} \left\vert f^{(N+1)}(z) \right\vert \leq 1 \end{equation*}
    for all \(z\text{,}\) we must have
    \begin{equation*} 0 \leq |R_N| \leq \left\vert \frac{(x-a)^N}{(N+1)!}\right\vert. \end{equation*}
    Now, since
    \begin{equation*} \lim_{N\to\infty} \left\vert\frac{(x-a)^N}{(N+1)!}\right\vert = 0, \end{equation*}
    by the Squeeze Theorem, we must have that
    \begin{equation*} \lim_{N\to\infty} |R_N| = 0. \end{equation*}

  2. \(f(x) = e^x\) Solution

    We compute
    \begin{equation*} |R_N| = \left\vert \frac{f^{(N+1)}(z)}{(N+1)!} (x-a)^N\right\vert = \left\vert \frac{e^z}{(N+1)!} (x-a)^N\right\vert . \end{equation*}
    Therefore,
    \begin{equation*} \lim_{N\to\infty} |R_N| = e^z \lim_{N\to\infty} \frac{(x-a)^N}{(N+1)!} = 0. \end{equation*}