Math Core

Lesson 6.13 · Infinite Sequences and Series

Taylor and Maclaurin series

If Taylor polynomials get better as the degree goes up, what happens if you never stop? You get a Taylor series: a power series that, for the most important functions in calculus, equals the function exactly on its interval of convergence. A handful of these series are so useful that the AP exam expects you to know them by heart.

From polynomials to series

Definition

Taylor series

If ff has derivatives of all orders at x=ax = a, the Taylor series for ff about x=ax = a is

∑n=0∞f(n)(a)n!(x−a)n=f(a)+f′(a)(x−a)+f′′(a)2!(x−a)2+⋯ .\sum_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!}(x - a)^n = f(a) + f'(a)(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \cdots.

When a=0a = 0, it is called the Maclaurin series for ff.

The nnth partial sum of the Taylor series is just the Taylor polynomial Pn(x)P_n(x). For the functions in this lesson, the Lagrange remainder Rn(x)R_n(x) goes to 00 as n→∞n \to \infty for every xx in the interval of convergence, so the series really does equal the function there.

cos x with Maclaurin polynomials of degree 2, 4 and 8. Adding terms extends the good fit farther from 0; the full series equals cos x for every x.Open in grapher →

Does the series equal the function?

Having a Taylor series isn't quite the same as having the function. The series is built only from derivatives at a single point, and there are two separate questions to ask:

  1. Where does the series converge? Answer this with the ratio test, as in the previous lesson.
  2. Where it converges, does it converge to f(x)f(x)? Answer this by showing the Lagrange remainder goes to 00.

For exe^x, for instance, the remainder after nn terms is at most M∣x∣n+1(n+1)!\dfrac{M|x|^{n+1}}{(n+1)!}, where MM is the largest value of ete^t between 00 and xx. Factorials outgrow powers, so this goes to 00 for every xx, and the series equals exe^x everywhere. The same argument, with M=1M = 1, works for sin⁡x\sin x and cos⁡x\cos x. For 11−x\frac{1}{1-x} you already know the answer from geometric series. On the AP exam, you can take for granted that the standard series below equal their functions on their intervals of convergence.

The series to memorize

Essential Maclaurin series

ex=∑n=0∞xnn!=1+x+x22!+x33!+⋯all xsin⁡x=∑n=0∞(−1)nx2n+1(2n+1)!=x−x33!+x55!−⋯all xcos⁡x=∑n=0∞(−1)nx2n(2n)!=1−x22!+x44!−⋯all x11−x=∑n=0∞xn=1+x+x2+x3+⋯−1<x<1\begin{aligned} e^x &= \sum_{n=0}^{\infty} \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots && \text{all } x \\ \sin x &= \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{(2n+1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots && \text{all } x \\ \cos x &= \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots && \text{all } x \\ \frac{1}{1 - x} &= \sum_{n=0}^{\infty} x^n = 1 + x + x^2 + x^3 + \cdots && -1 < x < 1 \end{aligned}

Some patterns make these easier to remember. The series for sin⁡x\sin x has only odd powers, matching the fact that sin⁡\sin is an odd function; cos⁡x\cos x has only even powers because cos⁡\cos is even. Both alternate in sign. The series for exe^x has every power, all positive. And 11−x\frac{1}{1-x} is the geometric series.

Two more series, which you'll derive in the next lesson, round out the list:

ln⁡(1+x)=x−x22+x33−⋯    (−1<x≤1),arctan⁡x=x−x33+x55−⋯    (−1≤x≤1).\ln(1 + x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots \;\; (-1 < x \le 1), \qquad \arctan x = x - \frac{x^3}{3} + \frac{x^5}{5} - \cdots \;\; (-1 \le x \le 1).

Building series by substitution

You rarely need to compute derivatives from scratch. Instead, substitute into a known series. To get the Maclaurin series for e3xe^{3x}, replace xx by 3x3x in the series for exe^x:

e3x=1+3x+(3x)22!+(3x)33!+⋯=1+3x+9x22+9x32+⋯ .e^{3x} = 1 + 3x + \frac{(3x)^2}{2!} + \frac{(3x)^3}{3!} + \cdots = 1 + 3x + \frac{9x^2}{2} + \frac{9x^3}{2} + \cdots.

You can also multiply a series by a power of xx:   xcos⁡x=x−x32!+x54!−⋯\; x\cos x = x - \dfrac{x^3}{2!} + \dfrac{x^5}{4!} - \cdots.

Common mistake

When you substitute, put the whole replacement in parentheses and raise it to the power. (3x)2=9x2(3x)^2 = 9x^2, not 3x23x^2. And (−x2)n=(−1)nx2n(-x^2)^n = (-1)^n x^{2n}: the sign and the exponent both change.

Recognizing a series

Running the process backward is a common exam question: identify the function whose series you are looking at, then evaluate it. For example,

∑n=0∞(−1)nπ2n+1(2n+1)! 22n+1=∑n=0∞(−1)n(π/2)2n+1(2n+1)!=sin⁡π2=1.\sum_{n=0}^{\infty} \frac{(-1)^n \pi^{2n+1}}{(2n+1)!\,2^{2n+1}} = \sum_{n=0}^{\infty} \frac{(-1)^n (\pi/2)^{2n+1}}{(2n+1)!} = \sin\frac{\pi}{2} = 1.

Worked examples

Worked example: Substituting a power

Find the first four nonzero terms of the Maclaurin series for e−x2e^{-x^2}.

Solution. Replace xx with −x2-x^2 in the series for exe^x:

e−x2=1+(−x2)+(−x2)22!+(−x2)33!+⋯=1−x2+x42−x66+⋯ .e^{-x^2} = 1 + (-x^2) + \frac{(-x^2)^2}{2!} + \frac{(-x^2)^3}{3!} + \cdots = 1 - x^2 + \frac{x^4}{2} - \frac{x^6}{6} + \cdots.

Worked example: A Taylor series not centered at 0

Find the Taylor series for f(x)=exf(x) = e^x about x=2x = 2.

Solution. Every derivative is exe^x, so f(n)(2)=e2f^{(n)}(2) = e^2 for all nn:

ex=∑n=0∞e2n!(x−2)n=e2+e2(x−2)+e22(x−2)2+⋯ .e^x = \sum_{n=0}^{\infty} \frac{e^2}{n!}(x - 2)^n = e^2 + e^2(x - 2) + \frac{e^2}{2}(x-2)^2 + \cdots.

Worked example: Summing a series by recognition

Find the exact sum of ∑n=0∞3nn!\displaystyle\sum_{n=0}^{\infty} \frac{3^n}{n!} and of ∑n=0∞(−1)n(2n)!\displaystyle\sum_{n=0}^{\infty} \frac{(-1)^n}{(2n)!}.

Solution. The first matches ∑xnn!\sum \frac{x^n}{n!} with x=3x = 3, so it equals e3e^3. The second matches the cosine series with x=1x = 1 (since 12n=11^{2n} = 1), so it equals cos⁡1\cos 1.

Worked example: A coefficient deep in the series

Find the coefficient of x10x^{10} in the Maclaurin series for cos⁡(x2)\cos(x^2).

Solution. Substitute x2x^2 into the cosine series: cos⁡(x2)=∑(−1)nx4n(2n)!\cos(x^2) = \sum \dfrac{(-1)^n x^{4n}}{(2n)!}. The power x10x^{10} would need 4n=104n = 10, which has no whole-number solution. So the coefficient is 00. (Only powers x0,x4,x8,x12,…x^0, x^4, x^8, x^{12}, \dots appear.)

Tip

Since the Taylor coefficient of (x−a)n(x-a)^n is f(n)(a)n!\dfrac{f^{(n)}(a)}{n!}, a series gives you every derivative at the center for free: f(n)(a)=n!⋅cnf^{(n)}(a) = n! \cdot c_n. For example, from e−x2e^{-x^2} above, the x6x^6 coefficient is −16-\frac16, so the sixth derivative at 00 is 6!⋅(−16)=−1206!\cdot\left(-\frac16\right) = -120.

Practice

Practice 1

What is the coefficient of x6x^6 in the Maclaurin series for cos⁡x\cos x?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

What is the coefficient of x6x^6 in the Maclaurin series for e−x2e^{-x^2}?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

What is the coefficient of (x−2)3(x - 2)^3 in the Taylor series for exe^x about x=2x = 2? Give an exact value.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

Find the exact sum of ∑n=0∞(−1)nπ2n(2n)!\displaystyle\sum_{n=0}^{\infty} \frac{(-1)^n \pi^{2n}}{(2n)!}.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Find the exact sum of ∑n=0∞2nn!\displaystyle\sum_{n=0}^{\infty} \frac{2^n}{n!}.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

Which is the Maclaurin series for xsin⁡xx\sin x?

Practice 7

Let f(x)=e−x2f(x) = e^{-x^2}. Use the Maclaurin series to find f(6)(0)f^{(6)}(0).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

The Maclaurin series for ff is ∑n=0∞(−1)n 22n+1 x2n+1(2n+1)!\displaystyle\sum_{n=0}^{\infty} \frac{(-1)^n\, 2^{2n+1}\, x^{2n+1}}{(2n+1)!}. Which function is ff?