Skip to main content

Section 9.8 Taylor Series

In Section 9.6, we showed how certain functions can be represented by a power series function. In 9.7, we showed how we can approximate functions with polynomials, given that enough derivative information is available. In this section we combine these concepts: if a function \(f(x)\) is infinitely differentiable, we show how to represent it with a power series function.

Definition 9.8.1. Taylor and Maclaurin Series.

Let \(f(x)\) have derivatives of all orders at \(x=c\text{.}\)

  1. The Taylor Series of \(f(x)\text{,}\) centered at \(c\) is

    \begin{equation*} \infser[0] \frac{f^{(n)}(c)}{n!}(x-c)^n. \end{equation*}
  2. Setting \(c=0\) gives the Maclaurin Series of \(f(x)\):

    \begin{equation*} \infser[0] \frac{f^{(n)}(0)}{n!}x^n. \end{equation*}

The difference between a Taylor polynomial and a Taylor series is the former is a polynomial, containing only a finite number of terms, whereas the latter is a series, a summation of an infinite set of terms. When creating the Taylor polynomial of degree \(n\) for a function \(f(x)\) at \(x=c\text{,}\) we needed to evaluate \(f\text{,}\) and the first \(n\) derivatives of \(f\text{,}\) at \(x=c\text{.}\) When creating the Taylor series of \(f\text{,}\) it helps to find a pattern that describes the \(n^\text{ th }\) derivative of \(f\) at \(x=c\text{.}\) We demonstrate this in the next two examples.

Example 9.8.2. The Maclaurin series of \(f(x) = \cos(x)\).

Find the Maclaurin series of \(f(x)=\cos(x)\text{.}\)

Solution.

In Example 9.7.14 we found the \(8^\text{ th }\) degree Maclaurin polynomial of \(\cos(x)\text{.}\) In doing so, we created the table shown in Figure 9.8.3.

Table 9.8.3. A table of the derivatives of \(f(x)=\cos(x)\) evaluated at \(x=0\text{.}\)
\(f(x) = \cos(x)\) \(\Rightarrow\) \(f(0) = 1\)
\(\fp(x) = -\sin(x)\) \(\Rightarrow\) \(\fp(0) = 0\)
\(\fp'(x) = -\cos(x)\) \(\Rightarrow\) \(\fp'(0) = -1\)
\(\fp''(x) = \sin(x)\) \(\Rightarrow\) \(\fp''(0) = 0\)
\(f^{(4)}(x) = \cos(x)\) \(\Rightarrow\) \(f^{(4)}(0) = 1\)
\(f^{(5)}(x) = -\sin(x)\) \(\Rightarrow\) \(f^{(5)}(0) = 0\)
\(f^{(6)}(x) = -\cos(x)\) \(\Rightarrow\) \(f^{(6)}(0) = -1\)
\(f^{(7)}(x) = \sin(x)\) \(\Rightarrow\) \(f^{(7)}(0) = 0\)
\(f^{(8)}(x) = \cos(x)\) \(\Rightarrow\) \(f^{(8)}(0) = 1\)
\(f^{(9)}(x) = -\sin(x)\) \(\Rightarrow\) \(f^{(9)}(0) = 0\)

Notice how \(f^{(n)}(0)=0\) when \(n\) is odd, \(f^{(n)}(0)=1\) when \(n\) is divisible by \(4\text{,}\) and \(f^{(n)}(0)=-1\) when \(n\) is even but not divisible by 4. Thus the Maclaurin series of \(\cos(x)\) is

\begin{equation*} 1-\frac{x^2}2+\frac{x^4}{4!}-\frac{x^6}{6!}+\frac{x^8}{8!} - \cdots \end{equation*}

We can go further and write this as a summation. Since we only need the terms where the power of \(x\) is even, we write the power series in terms of \(x^{2n}\text{:}\)

\begin{equation*} \infser[0] (-1)^{n}\frac{x^{2n}}{(2n)!}. \end{equation*}

Example 9.8.4. The Taylor series of \(f(x)=\ln(x)\) at \(x=1\).

Find the Taylor series of \(f(x) = \ln(x)\) centered at \(x=1\text{.}\)

Solution.

Figure 9.8.5 shows the \(n^\text{ th }\) derivative of \(\ln(x)\) evaluated at \(x=1\) for \(n=0,\ldots,5\text{,}\) along with an expression for the \(n^\text{ th }\) term:

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

Remember that this is what distinguishes Taylor series from Taylor polynomials; we are very interested in finding a pattern for the \(n^\text{ th }\) term, not just finding a finite set of coefficients for a polynomial.

Table 9.8.5. Derivatives of \(\ln(x)\) evaluated at \(x=1\text{.}\)
\(f(x) = \ln(x)\) \(\Rightarrow\) \(f(1) = 0\)
\(\fp(x) = 1/x\) \(\Rightarrow\) \(\fp(1) = 1\)
\(\fp'(x) = -1/x^2\) \(\Rightarrow\) \(\fp'(1) = -1\)
\(\fp''(x) = 2/x^3\) \(\Rightarrow\) \(\fp''(1) = 2\)
\(f^{(4)}(x) = -6/x^4\) \(\Rightarrow\) \(f^{(4)}(1) = -6\)
\(f^{(5)}(x) = 24/x^5\) \(\Rightarrow\) \(f^{(5)}(1) = 24\)
\(\ \vdots\) \(\ \vdots\)
\(f^{(n)}(x) =\) \(\Rightarrow\) \(f^{(n)}(1) =\)
\(\ds \frac{(-1)^{n+1}(n-1)!}{x^n}\) \((-1)^{n+1}(n-1)!\)

Since \(f(1) = \ln(1) = 0\text{,}\) we skip the first term and start the summation with \(n=1\text{,}\) giving the Taylor series for \(\ln(x)\text{,}\) centered at \(x=1\text{,}\) as

\begin{equation*} \infser (-1)^{n+1}(n-1)!\frac{1}{n!}(x-1)^n = \infser (-1)^{n+1}\frac{(x-1)^n}{n}. \end{equation*}

It is important to note that Definition 9.8.1 defines a Taylor series given a function \(f(x)\text{;}\) however, we cannot yet state that \(f(x)\) is equal to its Taylor series. We will find that “most of the time” they are equal, but we need to consider the conditions that allow us to conclude this.

Theorem 9.7.12 states that the error between a function \(f(x)\) and its \(n^\text{ th }\) –degree Taylor polynomial \(p_n(x)\) is \(R_n(x)\text{,}\) where

\begin{equation*} \abs{R_n(x)} \leq \frac{\max\abs{\,f^{(n+1)}(z)}}{(n+1)!}\abs{(x-c)^{(n+1)}}. \end{equation*}

If \(R_n(x)\) goes to 0 for each \(x\) in an interval \(I\) as \(n\) approaches infinity, we conclude that the function is equal to its Taylor series expansion.

We demonstrate the use of this theorem in an example.

Example 9.8.7. Establishing equality of a function and its Taylor series.

Show that \(f(x) = \cos(x)\) is equal to its Maclaurin series, as found in Example 9.8.2, for all \(x\text{.}\)

Solution.

Given a value \(x\text{,}\) the magnitude of the error term \(R_n(x)\) is bounded by

\begin{equation*} \abs{R_n(x)} \leq \frac{\max\abs{\,f^{(n+1)}(z)}}{(n+1)!}\abs{x^{n+1}}. \end{equation*}

Since all derivatives of \(\cos(x)\) are \(\pm \sin(x)\) or \(\pm\cos(x)\text{,}\) whose magnitudes are bounded by \(1\text{,}\) we can state

\begin{equation*} \abs{R_n(x)} \leq \frac{1}{(n+1)!}\abs{x^{n+1}} \end{equation*}

which implies

\begin{equation} -\frac{\abs{x^{n+1}}}{(n+1)!} \leq R_n(x) \leq\frac{\abs{x^{n+1}}}{(n+1)!}.\tag{9.8.1} \end{equation}

For any \(x\text{,}\) \(\lim\limits_{n\to\infty} \frac{x^{n+1}}{(n+1)!} = 0\text{.}\) Applying the Squeeze Theorem to Equation (9.8.1), we conclude that \(\lim\limits_{n\to\infty} R_n(x) = 0\) for all \(x\text{,}\) and hence

\begin{equation*} \cos(x) = \infser[0] (-1)^{n}\frac{x^{2n}}{(2n)!} \text{ for all \(x\) } . \end{equation*}

It is natural to assume that a function is equal to its Taylor series on the series' interval of convergence, but this is not the case. In order to properly establish equality, one must use Theorem 9.8.6. This is a bit disappointing, as we developed beautiful techniques for determining the interval of convergence of a power series, and proving that \(R_n(x)\to 0\) can be cumbersome as it deals with high order derivatives of the function.

There is good news. A function \(f(x)\) that is equal to its Taylor series, centered at any point the domain of \(f(x)\text{,}\) is said to be an analytic function, and most, if not all, functions that we encounter within this course are analytic functions. Generally speaking, any function that one creates with elementary functions (polynomials, exponentials, trigonometric functions, etc.) that is not piecewise defined is probably analytic. For most functions, we assume the function is equal to its Taylor series on the series' interval of convergence and only use Theorem 9.8.6 when we suspect something may not work as expected.

We develop the Taylor series for one more important function, then give a table of the Taylor series for a number of common functions.

Example 9.8.8. The Binomial Series.

Find the Maclaurin series of \(f(x) = (1+x)^k\text{,}\) \(k\neq 0\text{.}\)

Solution.

When \(k\) is a positive integer, the Maclaurin series is finite. For instance, when \(k=4\text{,}\) we have

\begin{equation*} f(x) = (1+x)^4 = 1+4x+6x^2+4x^3+x^4. \end{equation*}

The coefficients of \(x\) when \(k\) is a positive integer are known as the binomial coefficients, giving the series we are developing its name.

When \(k=1/2\text{,}\) we have \(f(x) = \sqrt{1+x}\text{.}\) Knowing a series representation of this function would give a useful way of approximating \(\sqrt{1.3}\text{,}\) for instance.

To develop the Maclaurin series for \(f(x) = (1+x)^k\) for any value of \(k\neq0\text{,}\) we consider the derivatives of \(f\) evaluated at \(x=0\text{:}\)

\begin{align*} f(x) \amp = (1+x)^k \amp f(0) \amp = 1\\ \fp(x) \amp = k(1+x)^{k-1} \amp \fp(0) \amp =k\\ \fp'(x) \amp = k(k-1)(1+x)^{k-2} \amp \fp'(0) \amp =k(k-1)\\ \fp''(x) \amp = k(k-1)(k-2)(1+x)^{k-3} \amp \fp''(0) \amp =k(k-1)(k-2)\\ \amp \vdots \amp \amp \vdots\\ f^{(n)}(x) \amp = k(k-1)\cdots \amp f^{(n)}(0) \amp =k(k-1)\cdots\big(k-(n-1)\big)\\ \amp \big(k-(n-1)\big)(1+x)^{k-n} \end{align*}

Thus the Maclaurin series for \(f(x) = (1+x)^k\) is

\begin{equation*} 1+ k + \frac{k(k-1)}{2!} + \frac{k(k-1)(k-2)}{3!} + \ldots + \frac{k(k-1)\cdots\big(k-(n-1)\big)}{n!}+\ldots \end{equation*}

It is important to determine the interval of convergence of this series. With

\begin{equation*} a_n = \frac{k(k-1)\cdots\big(k-(n-1)\big)}{n!}x^n, \end{equation*}

we apply the Ratio Test:

\begin{align*} \lim_{n\to\infty}\frac{\abs{a_{n+1}}}{\abs{a_n}}\amp =\lim_{n\to\infty} \frac{\abs{\frac{k(k-1)\cdots(k-n)}{(n+1)!}x^{n+1}}}{\abs{\frac{k(k-1)\cdots\big(k-(n-1)\big)}{n!}x^n}}\\ \amp =\lim_{n\to\infty} \abs{\frac{k-n}{n}x}\\ \amp = \abs{x}. \end{align*}

The series converges absolutely when the limit of the Ratio Test is less than 1; therefore, we have absolute convergence when \(\abs{x}\lt 1\text{.}\)

While outside the scope of this text, the interval of convergence depends on the value of \(k\text{.}\) When \(k>0\text{,}\) the interval of convergence is \([-1,1]\text{.}\) When \(-1\lt k\lt 0\text{,}\) the interval of convergence is \([-1,1)\text{.}\) If \(k\leq -1\text{,}\) the interval of convergence is \((-1,1)\text{.}\)

We learned that Taylor polynomials offer a way of approximating a “difficult to compute” function with a polynomial. Taylor series offer a way of exactly representing a function with a series. One probably can see the use of a good approximation; is there any use of representing a function exactly as a series?

While we should not overlook the mathematical beauty of Taylor series (which is reason enough to study them), there are practical uses as well. They provide a valuable tool for solving a variety of problems, including problems relating to integration and differential equations.

In Key Idea 9.8.9 (on the following page) we give a table of the Taylor series of a number of common functions. We then give a theorem about the “algebra of power series,” that is, how we can combine power series to create power series of new functions. This allows us to find the Taylor series of functions like \(f(x) = e^x\cos(x)\) by knowing the Taylor series of \(e^x\) and \(\cos(x)\text{.}\)

Before we investigate combining functions, consider the Taylor series for the arctangent function (see Key Idea 9.8.9). Knowing that \(\tan^{-1}(1) = \pi/4\text{,}\) we can use this series to approximate the value of \(\pi\text{:}\)

\begin{align*} \frac{\pi}4 \amp = \tan^{-1}(1) = 1-\frac13+\frac15-\frac17+\frac19-\cdots\\ \pi \amp = 4\left(1-\frac13+\frac15-\frac17+\frac19-\cdots\right) \end{align*}

Unfortunately, this particular expansion of \(\pi\) converges very slowly. The first 100 terms approximate \(\pi\) as \(3.13159\text{,}\) which is not particularly good.

Key Idea 9.8.9. Important Taylor Series Expansions.

Function and Series First Few Terms Interval of
Convergence
\(\ds e^x = \infser[0] \frac{x^n}{n!}\) \(\ds 1+ x+\frac{x^2}{2!} + \frac{x^3}{3!}+\cdots\) \((-\infty,\infty)\)
\(\ds \sin(x) = \infser[0] (-1)^n\frac{x^{2n+1}}{(2n+1)!}\) \(\ds x-\frac{x^3}{3!}+\frac{x^5}{5!} - \frac{x^7}{7!}+\cdots\) \((-\infty,\infty)\)
\(\ds \cos(x) = \infser[0] (-1)^n\frac{x^{2n}}{(2n)!}\) \(\ds 1-\frac{x^2}{2!}+\frac{x^4}{4!} - \frac{x^6}{6!} +\cdots\) \((-\infty,\infty)\)
\(\ds \ln(x) = \infser(-1)^{n+1}\frac{(x-1)^n}{n}\) \(\ds (x-1)- \frac{(x-1)^2}{2} +\frac{(x-1)^3}{3}-\cdots\) \((0,2]\)
\(\ds \frac{1}{1-x} = \infser[0] x^n\) \(\ds 1+x+x^2+x^3+\cdots\) \((-1,1)\)
\(\ds (1+x)^k=\infser[0] \frac{k(k-1)\cdots\big(k-(n-1)\big)}{n!}x^n\) \(\ds 1+kx+\frac{k(k-1)}{2!}x^2 + \cdots\) \((-1,1)\)  1 
\(\ds \tan^{-1}(x) = \infser[0] (-1)^n\frac{x^{2n+1}}{2n+1}\) \(\ds x-\frac{x^3}{3}+\frac{x^5}{5}-\frac{x^7}{7}+\cdots\) \([-1,1]\)

Example 9.8.11. Combining Taylor series.

Write out the first 3 terms of the Taylor Series for \(f(x) = e^x\cos(x)\) using Key Idea 9.8.9 and Theorem 9.8.10.

Solution.

Key Idea 9.8.9 informs us that

\begin{equation*} e^x = 1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots \text{ and } \cos(x) = 1-\frac{x^2}{2!}+\frac{x^4}{4!}+\cdots. \end{equation*}

Applying Theorem 9.8.10, we find that

\begin{align*} e^x\cos(x) \amp = \left(1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots\right)\left(1-\frac{x^2}{2!}+\frac{x^4}{4!}+\cdots\right).\\ \end{align*}

Distribute the right hand expression across the left:

\begin{align*} \amp = 1\left(1-\frac{x^2}{2!}+\frac{x^4}{4!}+\cdots\right)+x\left(1-\frac{x^2}{2!}+\frac{x^4}{4!}+\cdots\right)\\ \amp +\frac{x^2}{2!}\left(1-\frac{x^2}{2!}+\frac{x^4}{4!}+\cdots\right)+\frac{x^3}{3!}\left(1-\frac{x^2}{2!}+\frac{x^4}{4!}+\cdots\right) +\cdots\\ \end{align*}

Distribute again and collect like terms.

\begin{align*} \amp = 1 + x -\frac{x^3}{3}-\frac{x^4}{6} - \frac{x^5}{30}+\frac{x^7}{630}+\cdots \end{align*}

While this process is a bit tedious, it is much faster than evaluating all the necessary derivatives of \(e^x\cos(x)\) and computing the Taylor series directly.

Because the series for \(e^x\) and \(\cos(x)\) both converge on \((-\infty,\infty)\text{,}\) so does the series expansion for \(e^x\cos(x)\text{.}\)

Example 9.8.12. Creating new Taylor series.

Use Theorem 9.8.10 to create series for \(y=\sin(x^2)\) and \(y=\ln(\sqrt{x})\text{.}\)

Solution.

Given that

\begin{equation*} \sin(x) = \infser[0] (-1)^n\frac{x^{2n+1}}{(2n+1)!} = x-\frac{x^3}{3!}+\frac{x^5}{5!} -\frac{x^7}{7!}+\cdots, \end{equation*}

we simply substitute \(x^2\) for \(x\) in the series, giving

\begin{equation*} \sin(x^2) = \infser[0] (-1)^n\frac{(x^2)^{2n+1}}{(2n+1)!} = x^2-\frac{x^6}{3!}+\frac{x^{10}}{5!} -\frac{x^{14}}{7!}\cdots. \end{equation*}

Since the Taylor series for \(\sin(x)\) has an infinite radius of convergence, so does the Taylor series for \(\sin(x^2)\text{.}\)

The Taylor expansion for \(\ln(x)\) given in Key Idea 9.8.9 is centered at \(x=1\text{,}\) so we will center the series for \(\ln(\sqrt{x})\) at \(x=1\) as well. With

\begin{equation*} \ln(x) = \infser(-1)^{n+1}\frac{(x-1)^n}{n} = (x-1)- \frac{(x-1)^2}{2} +\frac{(x-1)^3}{3}-\cdots, \end{equation*}

we substitute \(\sqrt{x}\) for \(x\) to obtain

\begin{align*} \ln(\sqrt{x}) \amp= \infser(-1)^{n+1}\frac{(\sqrt{x}-1)^n}{n}\\ \amp= (\sqrt{x}-1)- \frac{(\sqrt{x}-1)^2}{2} +\frac{(\sqrt{x}-1)^3}{3}-\cdots. \end{align*}

While this is not strictly a power series, it is a series that allows us to study the function \(\ln(\sqrt{x})\text{.}\) Since the interval of convergence of \(\ln(x)\) is \((0,2]\text{,}\) and the range of \(\sqrt{x}\) on \((0,4]\) is \((0,2]\text{,}\) the interval of convergence of this series expansion of \(\ln(\sqrt{x})\) is \((0,4]\text{.}\)

Example 9.8.13. Using Taylor series to evaluate definite integrals.

Use the Taylor series of \(e^{-x^2}\) to evaluate \(\ds \int_0^1e^{-x^2}\ dx\text{.}\)

Solution.

We learned, when studying Numerical Integration, that \(e^{-x^2}\) does not have an antiderivative expressible in terms of elementary functions. This means any definite integral of this function must have its value approximated, and not computed exactly.

We can quickly write out the Taylor series for \(e^{-x^2}\) using the Taylor series of \(e^x\text{:}\)

\begin{align*} e^x \amp = \infser[0] \frac{x^n}{n!} = 1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots\\ \end{align*}

and so

\begin{align*} e^{-x^2} \amp = \infser[0] \frac{(-x^2)^n}{n!}\\ \amp = \infser[0] (-1)^n\frac{x^{2n}}{n!}\\ \amp = 1-x^2+\frac{x^4}{2!}-\frac{x^6}{3!}+\cdots. \end{align*}

We use Theorem 9.6.7 to integrate:

\begin{equation*} \int e^{-x^2}\ dx = C + x - \frac{x^3}{3}+\frac{x^5}{5\cdot2!}-\frac{x^7}{7\cdot3!}+\cdots +(-1)^n\frac{x^{2n+1}}{(2n+1)n!}+\cdots \end{equation*}

This is the antiderivative of \(e^{-x^2}\text{;}\) while we can write it out as a series, we cannot write it out in terms of elementary functions. We can evaluate the definite integral \(\ds \int_0^1e^{-x^2}\ dx\) using this antiderivative; substituting 1 and 0 for \(x\) and subtracting gives

\begin{equation*} \int_0^1e^{-x^2}\ dx = 1-\frac{1}{3}+\frac{1}{5\cdot 2!}-\frac{1}{7\cdot3!} + \frac{1}{9\cdot4!}\cdots. \end{equation*}

Summing the 5 terms shown above give the approximation of \(0.74749\text{.}\) Since this is an alternating series, we can use the Alternating Series Approximation Theorem, (Theorem 9.5.6), to determine how accurate this approximation is. The next term of the series is \(1/(11\cdot5!) \approx 0.00075758\text{.}\) Thus we know our approximation is within \(0.00075758\) of the actual value of the integral. This is arguably much less work than using Simpson's Rule to approximate the value of the integral.

Example 9.8.14. Using Taylor series to solve differential equations.

Solve the differential equation \(y'=2y\) in terms of a power series, and use the theory of Taylor series to recognize the solution in terms of an elementary function.

Solution.

We found the first 5 terms of the power series solution to this differential equation in Example 9.6.10 in Section 9.6. These are:

\begin{equation*} a_0=1, a_1 = 2, a_2 = \frac42=2, a_3=\frac{8}{2\cdot3}=\frac43, a_4=\frac{16}{2\cdot3\cdot4} = \frac23. \end{equation*}

We include the “unsimplified” expressions for the coefficients found in Example 9.6.10 as we are looking for a pattern. It can be shown that \(a_n = 2^n/n!\text{.}\) Thus the solution, written as a power series, is

\begin{equation*} y = \infser[0] \frac{2^n}{n!}x^n = \infser[0] \frac{(2x)^n}{n!}. \end{equation*}

Using Key Idea 9.8.9 and Theorem 9.8.10, we recognize \(f(x) = e^{2x}\text{:}\)

\begin{equation*} e^x = \infser[0] \frac{x^n}{n!} \qquad \Rightarrow \qquad e^{2x} = \infser[0] \frac{(2x)^n}{n!}. \end{equation*}

Finding a pattern in the coefficients that match the series expansion of a known function, such as those shown in Key Idea 9.8.9, can be difficult. What if the coefficients in the previous example were given in their reduced form; how could we still recover the function \(y=e^{2x}\text{?}\)

Suppose that all we know is that

\begin{equation*} a_0=1, a_1=2, a_2=2, a_3=\frac43, a_4=\frac23. \end{equation*}

Definition 9.8.1 states that each term of the Taylor expansion of a function includes an \(n!\text{.}\) This allows us to say that

\begin{equation*} a_2=2=\frac{b_2}{2!}, a_3 = \frac43=\frac{b_3}{3!}, \text{ and } a_4 = \frac23=\frac{b_4}{4!} \end{equation*}

for some values \(b_2\text{,}\) \(b_3\) and \(b_4\text{.}\) Solving for these values, we see that \(b_2=4\text{,}\) \(b_3 = 8\) and \(b_4=16\text{.}\) That is, we are recovering the pattern we had previously seen, allowing us to write

\begin{align*} f(x) = \infser[0] a_nx^n \amp = \infser[0] \frac{b_n}{n!}x^n\\ \amp = 1+2x+ \frac{4}{2!}x^2 + \frac{8}{3!}x^3+\frac{16}{4!}x^4 + \cdots \end{align*}

From here it is easier to recognize that the series is describing an exponential function.

There are simpler, more direct ways of solving the differential equation \(y' = 2y\text{.}\) We applied power series techniques to this equation to demonstrate its utility, and went on to show how sometimes we are able to recover the solution in terms of elementary functions using the theory of Taylor series. Most differential equations faced in real scientific and engineering situations are much more complicated than this one, but power series can offer a valuable tool in finding, or at least approximating, the solution.

This chapter introduced sequences, which are ordered lists of numbers, followed by series, wherein we add up the terms of a sequence. We quickly saw that such sums do not always add up to “infinity,” but rather converge. We studied tests for convergence, then ended the chapter with a formal way of defining functions based on series. Such “series–defined functions” are a valuable tool in solving a number of different problems throughout science and engineering.

Coming in the next chapters are new ways of defining curves in the plane apart from using functions of the form \(y=f(x)\text{.}\) Curves created by these new methods can be beautiful, useful, and important.

Exercises Exercises

1.

What is the difference between a Taylor polynomial and a Taylor series?

Answer.

A Taylor polynomial is a polynomial, containing a finite number of terms. A Taylor series is a series, the summation of an infinite number of terms.

2.

What theorem must we use to show that a function is equal to its Taylor series?

Exercise Group.

Key Idea 9.8.9 gives the \(n^\text{th}\) term of the Taylor series of common functions. In Exercises 3–6, verify the formula given in the Key Idea by finding the first few terms of the Taylor series of the given function and identifying a pattern.

3.

\(f(x) = e^x\text{;}\) \(c=0\)

Answer.

All derivatives of \(e^x\) are \(e^x\) which evaluate to 1 at \(x=0\text{.}\)

The Taylor series starts \(1+x+\frac{1}{2}x^2+\frac{1}{3!}x^3+\frac{1}{4!}x^4+\cdots \text{;}\)

the Taylor series is \(\displaystyle \sum _{n=0}^\infty \frac{x^n}{n!}\)

4.

\(f(x) = \sin x\text{;}\) \(c=0\)

Answer.

All derivatives of \(\sin x\) are either \(\pm \cos x\) or \(\pm \sin x\text{,}\) which evaluate to \(\pm 1\) or \(0\) at \(x=0\text{.}\) The Taylor series starts \(0+x+0x^2-\frac{1}{6}x^3+0x^4+\frac{1}{120}x^5\text{;}\)

the Taylor series is \(\displaystyle \sum _{n=0}^\infty (-1)^n\frac{x^{2n+1}}{(2n+1)!}\)

5.

\(f(x) = 1/(1-x)\text{;}\) \(c=0\)

Answer.

The \(n^\text{th}\) derivative of \(1/(1-x)\) is \(f\,^{(n)}(x) = (n)!/(1-x)^{n+1}\text{,}\) which evaluates to \(n!\) at \(x=0\text{.}\)

The Taylor series starts \(1+x+x^2+x^3+\cdots \text{;}\)

the Taylor series is \(\displaystyle \sum _{n=0}^\infty x^n\)

6.

\(f(x) = \tan ^{-1}x\text{;}\) \(c=0\)

Answer.

The derivative of \(\tan ^{-1}x\) is \(1/(1+x^2)\text{.}\) Taking successive derivatives using the Quotient Rule, the derivatives of \(\tan ^{-1}x\) fall into two categories in terms of their evaluation at \(x=0\text{.}\)

When \(n\) is even, \(\displaystyle f\,^{(n)}(x) = (-1)^{(n-1)/2}\frac{p(x)}{(1+x^2)^n}\text{,}\) where \(p(x)\) is a polynomial such that \(p(0) = 0\text{.}\) Hence \(f\,^{(n)}(0) = 0\) when \(n\) is even.

When \(n\) is odd, \(\displaystyle f\,^{(n)}(x) = (-1)^{(n-1)/2}\frac{p(x)}{(1+x^2)^n}\text{,}\) where \(p(x)\) is a polynomial such that \(p(0) = (n-1)!\text{.}\) Hence \(f\,^{(n)}(0) = (-1)^{(n-1)/2}(n-1)!\) when \(n\) is odd. (The unusual power of \((-1)\) is such that every other odd term is negative.)

The Taylor series starts \(x-\frac{1}{3}x^3+\frac{1}{5}x^5+\cdots \text{;}\) by reindexing to only obtain odd powers of \(x\text{,}\) we get

the Taylor series is \(\displaystyle \sum _{n=0}^\infty (-1)^n\frac{x^{2n+1}}{2n+1}\text{.}\)

Exercise Group.

In Exercises 7–12, find a formula for the \(n^\text{th}\) term of the Taylor series of \(f(x)\text{,}\) centered at \(c\text{,}\) by finding the coefficients of the first few powers of \(x\) and looking for a pattern. (The formulas for several of these are found in Key Idea 9.8.9; show work verifying these formula.)

7.

\(f(x) = \cos x\text{;}\) \(c=\pi /2\)

Answer.

The Taylor series starts \(0-(x-\pi /2)+0x^2+\frac{1}{6}(x-\pi /2)^3+0x^4-\frac{1}{120}(x-\pi /2)^5\text{;}\)

the Taylor series is \(\displaystyle \sum _{n=0}^\infty (-1)^{n+1}\frac{(x-\pi /2)^{2n+1}}{(2n+1)!}\)

8.

\(f(x) = 1/x\text{;}\) \(c=1\)

Answer.

The Taylor series starts \(1-(x-1)+(x-1)^2-(x-1)^3+(x-1)^4-(x-1)^5\text{;}\)

the Taylor series is \(\displaystyle \sum _{n=0}^\infty (-1)^{n}(x-1)^n\)

9.

\(f(x) = e^{-x}\text{;}\) \(c=0\)

Answer.

\(f\,^{(n)}(x) = (-1)^ne^{-x}\text{;}\) at \(x=0\text{,}\) \(f\,^{(n)}(0)=-1\) when \(n\) is odd and \(f\,^{(n)}(0)=1\) when \(n\) is even.

The Taylor series starts \(1-x+\frac{1}{2}x^2-\frac{1}{3!}x^3+\cdots \text{;}\)

the Taylor series is \(\displaystyle \sum _{n=0}^\infty (-1)^n\frac{x^n}{n!}\text{.}\)

10.

\(f(x) = \ln (1+x)\text{;}\) \(c=0\)

Answer.

\(f\,^{(n)}(x) = (-1)^{n+1}\frac{(n-1)!}{(1+x)^n}\text{;}\) at \(x=0\text{,}\) \(f\,^{(n)}(0)=(-1)^{n+1}(n-1)!\)

The Taylor series starts \(x-\frac{x^2}{2}+\frac{x^3}{3}-\frac{x^4}{4}+\cdots \text{;}\)

the Taylor series is \(\displaystyle \sum _{n=1}^\infty (-1)^{n+1}\frac{x^n}{n}\text{.}\)

11.

\(f(x) = x/(x+1)\text{;}\) \(c=1\)

Answer.

\(f\,^{(n)}(x) = (-1)^{n+1}\frac{n!}{(x+1)^{n+1}}\text{;}\) at \(x=1\text{,}\) \(f\,^{(n)}(1)=(-1)^{n+1}\frac{n!}{2^{n+1}}\)

The Taylor series starts \(\frac{1}{2}+\frac{1}{4}(x-1)-\frac{1}{8}(x-1)^2+\frac{1}{16}(x-1)^3\cdots \text{;}\)

the Taylor series is \(\displaystyle \frac{1}{2}+\sum _{n=1}^\infty (-1)^{n+1}\frac{(x-1)^n}{2^{n+1}}\text{.}\)

12.

\(f(x) = \sin x\text{;}\) \(c=\pi /4\)

Answer.

The derivatives of \(\sin x\) are \(\pm \cos x\) and \(\pm \sin x\text{;}\) at \(x=\pi /4\text{,}\) these derivatives evaluate to \(\pm \sqrt{2}/2\text{.}\)

The Taylor series starts \(\frac{\sqrt{2}}{2}+\frac{\sqrt{2}}{2}(x-\pi /4) - \frac{\sqrt{2}}{2}\frac{(x-\pi /4)^2}{2}-\frac{\sqrt{2}}{2}\frac{(x-\pi /4)^3}{3!}+\frac{\sqrt{2}}{2}\frac{(x-\pi /4)^4}{4!}+\frac{\sqrt{2}}{2}\frac{(x-\pi /4)^5}{5!}\cdots \text{.}\) Note how the signs are “even, even, odd, odd, even, even, odd, odd,\(\ldots \)” We saw signs like these in Example 9.1.5; one way of producing such signs is to raise \((-1)\) to a special quadratic power. While many possibilities exist, one such quadratic is \((n+3)(n+4)/2\text{.}\)

Thus the Taylor series is \(\displaystyle \sum _{n=0}^\infty (-1)^{\frac{(n+3)(n+4)}{2}}\frac{\sqrt{2}}{2}\frac{(x-\pi /4)^n}{n!}\text{.}\)

Exercise Group.

In Exercises 13–16, show that the Taylor series for \(f(x)\text{,}\) as given in Key Idea 9.8.9, is equal to \(f(x)\) by applying Theorem 9.7.12; that is, show \(\displaystyle \lim _{n\rightarrow \infty }R_n(x) =0\text{.}\)

13.

\(f(x) = e^x\)

Answer.

Given a value \(x\text{,}\) the magnitude of the error term \(R_n(x)\) is bounded by

\begin{gather*} \big |R_n(x)\big | \le \frac{\max \left|\,f\,^{(n+1)}(z)\right|}{(n+1)!}\big |x^{(n+1)}\big |, \end{gather*}

where \(z\) is between \(0\) and \(x\text{.}\)

If \(x\gt0\text{,}\) then \(z\lt x\) and \(f\,^{(n+1)}(z) =e^z\lt e^x\text{.}\) If \(x\lt 0\text{,}\) then \(x\lt z\lt 0\) and \(f\,^{(n+1)}(z) =e^z\lt 1\text{.}\) So given a fixed \(x\) value, let \(M = \max \lbrace e^x,1\rbrace \text{;}\) \(f\,^{(n)}(z)\lt M.\) This allows us to state

\begin{gather*} \big |R_n(x)\big | \le \frac{M}{(n+1)!}\big |x^{(n+1)}\big |. \end{gather*}

For any \(x\text{,}\) \(\displaystyle \lim _{n\rightarrow \infty } \frac{M}{(n+1)!}\big |x^{(n+1)}\big |= 0\text{.}\) Thus by the Squeeze Theorem, we conclude that \(\displaystyle \lim _{n\rightarrow \infty } R_n(x) = 0\) for all \(x\text{,}\) and hence

\begin{gather*} e^x = \sum _{n=0}^\infty \frac{x^{n}}{n!}\quad \text{for all $x$}. \end{gather*}
14.

\(f(x) = \sin x\)

Answer.

The following argument is essentially the same as that given for \(f(x) = \cos x\) in Example 9.8.2.

Given a value \(x\text{,}\) the magnitude of the error term \(R_n(x)\) is bounded by

\begin{gather*} \big |R_n(x)\big | \le \frac{\max \left|\,f\,^{(n+1)}(z)\right|}{(n+1)!}\big |x^{(n+1)}\big |. \end{gather*}

Since all derivatives of \(\sin x\) are \(\pm \cos x\) or \(\pm \sin x\text{,}\) whose magnitudes are bounded by \(1\text{,}\) we can state

\begin{gather*} \big |R_n(x)\big | \le \frac{1}{(n+1)!}\big |x^{(n+1)}\big |. \end{gather*}

For any \(x\text{,}\) \(\displaystyle \lim _{n\rightarrow \infty } \frac{x^{n+1}}{(n+1)!} = 0\text{.}\) Thus by the Squeeze Theorem, we conclude that \(\displaystyle \lim _{n\rightarrow \infty } R_n(x) = 0\) for all \(x\text{,}\) and hence

\begin{gather*} \sin x = \sum _{n=0}^\infty (-1)^{n}\frac{x^{2n+1}}{(2n+1)!}\quad \text{for all $x$}. \end{gather*}
15.

\(f(x) = \ln x\) (show equality only on \((1,2)\))

Answer.

Given a value \(x\text{,}\) the magnitude of the error term \(R_n(x)\) is bounded by

\begin{gather*} \big |R_n(x)\big | \le \frac{\max \left|\,f\,^{(n+1)}(z)\right|}{(n+1)!}\big |(x-1)^{(n+1)}\big |, \end{gather*}

where \(z\) is between \(1\) and \(x\text{.}\)

Note that \(\big |f\,^{(n+1)}(x)\big | = \frac{n!}{x^{n+1}}\text{.}\)

Per the statement of the problem, we only consider the case \(1\lt x\lt 2\text{.}\)

If \(1\lt x\lt 2\text{,}\) then \(1\lt z\lt x\) and \(f\,^{(n+1)}(z) =\frac{n!}{z^{n+1}}\lt n!\text{.}\) Thus

\begin{gather*} \big |R_n(x)\big | \le \frac{n!}{(n+1)!}\big |(x-1)^{(n+1)}\big |= \frac{(x-1)^{n+1}}{n+1}\lt \frac{1}{n+1}. \end{gather*}

Thus

\begin{gather*} \lim _{n\rightarrow \infty } \big |R_n(x)\big | \lt \lim _{n\rightarrow \infty } \frac{1}{n+1}=0, \end{gather*}

hence

\begin{gather*} \ln x = \sum _{n=1}^\infty (-1)^{n+1}\frac{(x-1)^n}{n}\ \text{on}\ (1,2). \end{gather*}
16.

\(f(x) = 1/(1-x)\) (show equality only on \((-1,0)\))

Answer.

Given a value \(x\text{,}\) the magnitude of the error term \(R_n(x)\) is bounded by

\begin{gather*} \big |R_n(x)\big | \le \frac{\max \left|\,f\,^{(n+1)}(z)\right|}{(n+1)!}\big |x^{(n+1)}\big |, \end{gather*}

where \(z\) is between \(0\) and \(x\text{.}\)

Note that \(\big |f\,^{(n+1)}(x)\big | = \frac{(n+1)!}{(1-x)^{n+2}}\text{.}\)

If \(-1\lt x\lt 0\text{,}\) then \(x\lt z\lt 0\) and \(f\,^{(n+1)}(z) =\frac{(n+1)!}{(1-z)^{n+2}}\lt (n+1)!\text{.}\) Thus

\begin{gather*} \big |R_n(x)\big | \le \frac{(n+1)!}{(n+1)!}\big |x^{n+1}\big |= \big |x^{n+1}\big |. \end{gather*}

For a fixed \(x\text{,}\)

\begin{gather*} \lim _{n\rightarrow \infty } \big |x^{n+1}\big |=0 \text{ as } |x|\lt 1, \end{gather*}

hence

\begin{gather*} \frac{1}{1-x} = \sum _{n=0}^\infty x^n \text{ on } (-1,0). \end{gather*}

Exercise Group.

In Exercises 17–20, use the Taylor series given in Key Idea 9.8.9 to verify the given identity.

17.

\(\cos (-x) = \cos x\)

Answer.

Given \(\displaystyle \cos x = \sum _{n=0}^\infty (-1)^n\frac{x^{2n}}{(2n)!}\text{,}\)

\(\displaystyle \cos (-x) = \sum _{n=0}^\infty (-1)^n\frac{(-x)^{2n}}{(2n)!}=\sum _{n=0}^\infty (-1)^n\frac{x^{2n}}{(2n)!}=\cos x\text{,}\) as all powers in the series are even.

18.

\(\sin (-x) = -\sin x\)

Answer.

Given \(\displaystyle \sin x = \sum _{n=0}^\infty (-1)^n\frac{x^{2n+1}}{(2n+1)!}\text{,}\)

\(\displaystyle \sin (-x) = \sum _{n=0}^\infty (-1)^n\frac{(-x)^{2n+1}}{(2n+1)!}=\sum _{n=0}^\infty (-1)^n\frac{-x^{2n+1}}{(2n+1)!}=-\sin x\text{,}\) as all powers in the series are odd.

19.

\(\frac{d}{dx}\big (\sin x\big ) = \cos x\)

Answer.

Given \(\displaystyle \sin x = \sum _{n=0}^\infty (-1)^n\frac{x^{2n+1}}{(2n+1)!}\text{,}\)

\(\displaystyle \frac{d}{dx}\big (\sin x\big ) = \frac{d}{dx}\left(\sum _{n=0}^\infty (-1)^n\frac{x^{2n+1}}{(2n+1)!}\right)=\sum _{n=0}^\infty (-1)^n\frac{(2n+1)x^{2n}}{(2n+1)!}=\sum _{n=0}^\infty (-1)^n\frac{x^{2n}}{(2n)!}=\cos x\text{.}\) (The summation still starts at \(n=0\) as there was no constant term in the expansion of \(\sin x\)).

20.

\(\frac{d}{dx}\big (\cos x\big ) = -\sin x\)

Answer.

Given \(\displaystyle \cos x = \sum _{n=0}^\infty (-1)^n\frac{x^{2n}}{(2n)!}\text{,}\)

\(\displaystyle \frac{d}{dx}\big (\cos x\big ) = \frac{d}{dx}\left(\sum _{n=0}^\infty (-1)^n\frac{x^{2n}}{(2n)!}\right)=\sum _{n=1}^\infty (-1)^n\frac{(2n)x^{2n-1}}{(2n)!}=\sum _{n=1}^\infty (-1)^n\frac{x^{2n-1}}{(2n-1)!}\text{.}\) We can re-index this summation to start at \(n=0\) by replacing \(n\) with \(n+1\) in the summation:

\begin{gather*} \sum _{n=1}^\infty (-1)^n\frac{x^{2n-1}}{(2n-1)!} =\sum _{n=0}^\infty (-1)^{n+1}\frac{x^{2n+1}}{(2n+1)!}. \end{gather*}

Note that this series has the opposite sign of the Taylor series for \(\sin x\text{;}\) thus \(\frac{d}{dx}(\cos x) = -\sin x\text{.}\)

Exercise Group.

In Exercises 21–24, write out the first 5 terms of the Binomial series with the given \(k\)-value.

21.

\(k=1/2\)

Answer.

\(\displaystyle 1+\frac{x}{2}-\frac{x^2}{8}+\frac{x^3}{16}-\frac{5x^4}{128}\)

22.

\(k=-1/2\)

Answer.

\(\displaystyle 1-\frac{x}{2}+\frac{3x^2}{8}-\frac{5x^3}{16}+\frac{35x^4}{128}\)

23.

\(k=1/3\)

Answer.

\(\displaystyle 1+\frac{x}{3}-\frac{x^2}{9}+\frac{5x^3}{81}-\frac{10x^4}{243}\)

24.

\(k=4\)

Answer.

\(\displaystyle 1+4x+6x^2+4x^3+x^4\) (note the series is finite, and the formula still applies)

Exercise Group.

In Exercises 25–30, use the Taylor series given in Key Idea 9.8.9 to create the Taylor series of the given functions.

25.

\(f(x) = \cos \big (x^2\big )\)

Answer.

\(\displaystyle \sum _{n=0}^\infty (-1)^n\frac{(x^2)^{2n}}{(2n)!} = \sum _{n=0}^\infty (-1)^n\frac{x^{4n}}{(2n)!}.\)

26.

\(f(x) = e^{-x}\)

Answer.

\(\displaystyle \sum _{n=0}^\infty \frac{(-x)^n}{n!}.\)

27.

\(f(x) = \sin \big (2x+3\big )\)

Answer.

\(\displaystyle \sum _{n=0}^\infty (-1)^n\frac{(2x+3)^{2n+1}}{(2n+1)!}.\)

28.

\(f(x) = \tan ^{-1}\big (x/2\big )\)

Answer.

\(\displaystyle \sum _{n=0}^\infty (-1)^n\frac{(x/2)^{2n+1}}{(2n+1)}.\)

29.

\(f(x) = e^x\sin x\) (only find the first 4 terms)

Answer.

\(\displaystyle x+x^2+\frac{x^3}{3}-\frac{x^5}{30}\)

30.

\(f(x) = (1+x)^{1/2}\cos x\) (only find the first 4 terms)

Answer.

\(\displaystyle 1+\frac{x}{2}-\frac{5x^2}{8}-\frac{3x^3}{16}\)

Exercise Group.

In Exercises 31–32, approximate the value of the given definite integral by using the first 4 nonzero terms of the integrand's Taylor series.

31.

\(\displaystyle \int _0^{\sqrt{\pi }} \sin \big (x^2\big )\ dx\)

Answer.

\(\displaystyle \int _0^{\sqrt{\pi }} \sin \big (x^2\big )\ dx \approx \int _0^{\sqrt{\pi }} \left(x^2-\frac{x^6}{6}+\frac{x^{10}}{120}-\frac{x^{14}}{5040}\right) dx = 0.8877\)

32.

\(\displaystyle \int _0^{\pi ^2/4} \cos \big (\sqrt{x}\big )\ dx\)

Answer.

\(\displaystyle \int _0^{\pi ^2/4} \cos \big (\sqrt{x}\big )\ dx \approx \int _0^{\pi ^2/4} \left(1-\frac{x}{2}+\frac{x^2}{24}-\frac{x^3}{720}\right)\ dx = 1.1412\text{.}\) (Actual answer: \(\pi -2\))

Convergence at \(x=\pm1\) depends on the value of \(k\text{.}\)