Skip to content
Family Table Math
Auto

Taylor and Maclaurin Series

A Taylor polynomial stops at some degree nn. If you never stop, you get a Taylor series: a power series that, for many functions, equals the function exactly on its interval of convergence. Four of these series come up so often that the AP exam expects you to know them by heart. Once you know them, you can build series for many other functions without taking a single derivative.

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’s called a Maclaurin series. Its partial sums are exactly the Taylor polynomials P0,P1,P2,…P_0, P_1, P_2, \dots

For the functions in this course, the Taylor series equals f(x)f(x) at every xx in its interval of convergence. (For exe^x, sin⁡x\sin x, and cos⁡x\cos x you can prove this with the Lagrange error bound, which shrinks to 00 as nn grows.)

FunctionSeriesGeneral termConverges for
exe^x1+x+x22!+x33!+⋯1 + x + \dfrac{x^2}{2!} + \dfrac{x^3}{3!} + \cdotsxnn!\dfrac{x^n}{n!}all real xx
sin⁡x\sin xx−x33!+x55!−⋯x - \dfrac{x^3}{3!} + \dfrac{x^5}{5!} - \cdots(−1)nx2n+1(2n+1)!\dfrac{(-1)^n x^{2n+1}}{(2n+1)!}all real xx
cos⁡x\cos x1−x22!+x44!−⋯1 - \dfrac{x^2}{2!} + \dfrac{x^4}{4!} - \cdots(−1)nx2n(2n)!\dfrac{(-1)^n x^{2n}}{(2n)!}all real xx
11−x\dfrac{1}{1 - x}1+x+x2+x3+⋯1 + x + x^2 + x^3 + \cdotsxnx^n−1<x<1-1 \lt x \lt 1

In each, the sum starts at n=0n = 0. As always in calculus, xx is in radians for sin⁡x\sin x and cos⁡x\cos x.

  • exe^x: every derivative is exe^x, which is 11 at 00, so every coefficient is 1n!\dfrac{1}{n!}.
  • sin⁡x\sin x: an odd function, so only odd powers, with alternating signs. Each power is divided by its own factorial.
  • cos⁡x\cos x: an even function, so only even powers, with alternating signs.
  • 11−x\dfrac{1}{1 - x}: a geometric series with first term 11 and ratio xx (see infinite geometric series), so it only converges when ∣x∣<1|x| \lt 1.

A quick check: differentiate the sin⁡x\sin x series term by term and you get the cos⁡x\cos x series, just as ddxsin⁡x=cos⁡x\dfrac{d}{dx}\sin x = \cos x.

Inside the interval of convergence, adding more terms makes the partial sums match the function over a wider and wider stretch. For sin⁡x\sin x, cos⁡x\cos x and exe^x this keeps going for every xx.

The graph of y = cos x from -7 to 7 with two Maclaurin polynomials. The degree 4 polynomial matches cos x from about -2 to 2, then curves up away from it. The degree 10 polynomial matches from about -4.5 to 4.5, then curves down away from it. P4 P10 cos x −2 2 −6 −4 −2 2 4 6
The partial sums of the cosine series of degree 4 and 10. The series converges to cos⁡x\cos x for every xx, so higher degrees fit over wider intervals.

To find a Taylor series directly:

  1. Find several derivatives and evaluate them at x=ax = a.
  2. Look for a pattern in f(n)(a)f^{(n)}(a).
  3. Write the first few terms, then the general term f(n)(a)n!(x−a)n\dfrac{f^{(n)}(a)}{n!}(x - a)^n, simplified.

Often, though, it’s faster to start from one of the four known series; see representing functions as power series.

Example 1: Where the e to the x series comes from

Section titled “Example 1: Where the e to the x series comes from”

Use derivatives to find the Maclaurin series for exe^x, and write the general term. Then use it to write ∑n=0∞1n!\displaystyle\sum_{n=0}^{\infty} \frac{1}{n!} in closed form.

Solution. If f(x)=exf(x) = e^x, then f(n)(x)=exf^{(n)}(x) = e^x and f(n)(0)=1f^{(n)}(0) = 1 for every nn. So the coefficient of xnx^n is 1n!\dfrac{1}{n!}:

ex=1+x+x22!+x33!+⋯+xnn!+⋯=∑n=0∞xnn!e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots + \frac{x^n}{n!} + \cdots = \sum_{n=0}^{\infty} \frac{x^n}{n!}

At x=1x = 1, this says ∑n=0∞1n!=e1=e\displaystyle\sum_{n=0}^{\infty} \frac{1}{n!} = e^1 = e.

Example 2: Where the sine series comes from

Section titled “Example 2: Where the sine series comes from”

Use derivatives to find the Maclaurin series for sin⁡x\sin x.

Solution. The derivatives cycle with period 44:

nn001122334455
f(n)(x)f^{(n)}(x)sin⁡x\sin xcos⁡x\cos x−sin⁡x-\sin x−cos⁡x-\cos xsin⁡x\sin xcos⁡x\cos x
f(n)(0)f^{(n)}(0)001100−1-10011

The even-numbered terms vanish, and the odd ones alternate 1,−1,1,…1, -1, 1, \dots:

sin⁡x=x−x33!+x55!−x77!+⋯=∑n=0∞(−1)nx2n+1(2n+1)!\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{(2n+1)!}

Check the general term: n=0n = 0 gives xx, n=1n = 1 gives −x33!-\dfrac{x^3}{3!}, n=2n = 2 gives x55!\dfrac{x^5}{5!}. ✓

Find the Taylor series for f(x)=ln⁡xf(x) = \ln x about x=1x = 1. Give the first four nonzero terms and the general term.

Solution. Find derivatives and look for the pattern:

f′(x)=x−1f′(1)=1f′′(x)=−x−2f′′(1)=−1f′′′(x)=2x−3f′′′(1)=2f(4)(x)=−6x−4f(4)(1)=−6\begin{aligned} f'(x) &= x^{-1} && f'(1) = 1 \\ f''(x) &= -x^{-2} && f''(1) = -1 \\ f'''(x) &= 2x^{-3} && f'''(1) = 2 \\ f^{(4)}(x) &= -6x^{-4} && f^{(4)}(1) = -6 \end{aligned}

The pattern is f(n)(1)=(−1)n+1(n−1)!f^{(n)}(1) = (-1)^{n+1}(n - 1)! for n≥1n \ge 1, and f(1)=ln⁡1=0f(1) = \ln 1 = 0. The coefficient of (x−1)n(x - 1)^n is

(−1)n+1(n−1)!n!=(−1)n+1n\frac{(-1)^{n+1}(n - 1)!}{n!} = \frac{(-1)^{n+1}}{n}

So

ln⁡x=(x−1)−(x−1)22+(x−1)33−(x−1)44+⋯=∑n=1∞(−1)n+1(x−1)nn\ln x = (x - 1) - \frac{(x - 1)^2}{2} + \frac{(x - 1)^3}{3} - \frac{(x - 1)^4}{4} + \cdots = \sum_{n=1}^{\infty} \frac{(-1)^{n+1}(x - 1)^n}{n}

Example 4: From a formula for the derivatives

Section titled “Example 4: From a formula for the derivatives”

A function ff has derivatives of all orders, with f(n)(0)=n+12nf^{(n)}(0) = \dfrac{n + 1}{2^n} for n=0,1,2,…n = 0, 1, 2, \dots

  • (a) Write the first four terms and the general term of the Maclaurin series for ff.
  • (b) Find the radius of convergence.

Solution. (a) The values are f(0)=1f(0) = 1, f′(0)=1f'(0) = 1, f′′(0)=34f''(0) = \dfrac{3}{4}, f′′′(0)=12f'''(0) = \dfrac{1}{2}. Dividing by n!n!:

f(x)=1+x+3/42!x2+1/23!x3+⋯=1+x+38x2+112x3+⋯f(x) = 1 + x + \frac{3/4}{2!}x^2 + \frac{1/2}{3!}x^3 + \cdots = 1 + x + \frac{3}{8}x^2 + \frac{1}{12}x^3 + \cdots

The general term is (n+1) xn2n n!\dfrac{(n + 1)\,x^n}{2^n\, n!}.

(b) Ratio test:

∣an+1an∣=(n+2)∣x∣n+12n+1(n+1)!⋅2n n!(n+1)∣x∣n=n+2n+1⋅∣x∣2(n+1)\left|\frac{a_{n+1}}{a_n}\right| = \frac{(n + 2)|x|^{n+1}}{2^{n+1}(n+1)!} \cdot \frac{2^n\, n!}{(n + 1)|x|^n} = \frac{n + 2}{n + 1} \cdot \frac{|x|}{2(n + 1)}

This goes to 00 for every xx, so the series converges for all real xx: R=∞R = \infty.

Mixing up the sine and cosine series. Sine has odd powers and starts with xx (because sin⁡0=0\sin 0 = 0); cosine has even powers and starts with 11 (because cos⁡0=1\cos 0 = 1). Check by plugging in x=0x = 0.

Dividing by the wrong factorial. In the sine series, x5x^5 is divided by 5!5!, not 3!3! or (2n)!(2n)!. The factorial always matches the power: xkx^k goes with k!k!.

Using the 1/(1 − x) series outside its interval. The series 1+x+x2+⋯1 + x + x^2 + \cdots only equals 11−x\dfrac{1}{1 - x} for −1<x<1-1 \lt x \lt 1. At x=2x = 2 the function equals −1-1, but the series diverges.

Writing a general term that doesn’t match the first terms. Always test your general term with n=0,1,2n = 0, 1, 2 to see that it reproduces the terms you wrote out, as in Example 2.

Forgetting radians. The series for sin⁡x\sin x and cos⁡x\cos x are only true in radians. sin⁡30\sin 30 means 3030 radians, not 30∘30^\circ.

1. (Warm-up) Write the first four nonzero terms and the general term of the Maclaurin series for cos⁡x\cos x.

Solutioncos⁡x=1−x22!+x44!−x66!+⋯=∑n=0∞(−1)nx2n(2n)!\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!}

2. (Warm-up) Find the sum of each series by recognizing a known Maclaurin series.

  • (a) 1+2+222!+233!+⋯1 + 2 + \dfrac{2^2}{2!} + \dfrac{2^3}{3!} + \cdots
  • (b) 1−π22!+π44!−π66!+⋯1 - \dfrac{\pi^2}{2!} + \dfrac{\pi^4}{4!} - \dfrac{\pi^6}{6!} + \cdots
Solution

(a) This is the exe^x series with x=2x = 2, so the sum is e2e^2.

(b) This is the cos⁡x\cos x series with x=πx = \pi, so the sum is cos⁡π=−1\cos \pi = -1.

3. (Warm-up) What is the sum of 1+0.3+0.32+0.33+⋯1 + 0.3 + 0.3^2 + 0.3^3 + \cdots? What happens to 1+2+22+23+⋯1 + 2 + 2^2 + 2^3 + \cdots, even though 11−2=−1\dfrac{1}{1 - 2} = -1?

Solution

The first is the 11−x\dfrac{1}{1 - x} series with x=0.3x = 0.3, which is inside −1<x<1-1 \lt x \lt 1, so the sum is 10.7=107\dfrac{1}{0.7} = \dfrac{10}{7}.

The second has x=2x = 2, outside the interval of convergence. The partial sums grow without bound, so the series diverges. The formula 11−x\dfrac{1}{1 - x} doesn’t apply there.

4. (Core) Find the Taylor series for exe^x about x=3x = 3. Give the first three terms and the general term.

Solution

Every derivative of exe^x is exe^x, so f(n)(3)=e3f^{(n)}(3) = e^3 for every nn:

ex=e3+e3(x−3)+e32!(x−3)2+⋯=∑n=0∞e3(x−3)nn!e^x = e^3 + e^3(x - 3) + \frac{e^3}{2!}(x - 3)^2 + \cdots = \sum_{n=0}^{\infty} \frac{e^3 (x - 3)^n}{n!}

5. (Core) Find the Taylor series for cos⁡x\cos x about x=π2x = \dfrac{\pi}{2}. Give the first three nonzero terms and the general term.

Solution

At x=π2x = \dfrac{\pi}{2}, the derivatives cos⁡x,−sin⁡x,−cos⁡x,sin⁡x,cos⁡x,−sin⁡x,…\cos x, -\sin x, -\cos x, \sin x, \cos x, -\sin x, \dots have values 0,−1,0,1,0,−1,…0, -1, 0, 1, 0, -1, \dots So only odd powers appear:

cos⁡x=−(x−π2)+13!(x−π2)3−15!(x−π2)5+⋯\cos x = -\left(x - \frac{\pi}{2}\right) + \frac{1}{3!}\left(x - \frac{\pi}{2}\right)^3 - \frac{1}{5!}\left(x - \frac{\pi}{2}\right)^5 + \cdots=∑n=0∞(−1)n+1(2n+1)!(x−π2)2n+1= \sum_{n=0}^{\infty} \frac{(-1)^{n+1}}{(2n+1)!}\left(x - \frac{\pi}{2}\right)^{2n+1}

6. (Core) A function ff has f(n)(0)=(−1)n2nf^{(n)}(0) = (-1)^n 2^n for all n≥0n \ge 0. Write the first four terms and the general term of its Maclaurin series. Which familiar function is ff?

Solutionf(x)=1−2x+42!x2−83!x3+⋯=1−2x+2x2−43x3+⋯f(x) = 1 - 2x + \frac{4}{2!}x^2 - \frac{8}{3!}x^3 + \cdots = 1 - 2x + 2x^2 - \frac{4}{3}x^3 + \cdots

The general term is (−1)n2nxnn!=(−2x)nn!\dfrac{(-1)^n 2^n x^n}{n!} = \dfrac{(-2x)^n}{n!}. That’s the exe^x series with xx replaced by −2x-2x, so f(x)=e−2xf(x) = e^{-2x}.

7. (Core) Find the Taylor series for f(x)=1xf(x) = \dfrac{1}{x} about x=2x = 2, and its interval of convergence.

Solution

f(n)(x)=(−1)nn! x−(n+1)f^{(n)}(x) = (-1)^n n!\, x^{-(n+1)}, so f(n)(2)=(−1)nn!2n+1f^{(n)}(2) = \dfrac{(-1)^n n!}{2^{n+1}}. Dividing by n!n!:

1x=12−x−24+(x−2)28−⋯=∑n=0∞(−1)n(x−2)n2n+1\frac{1}{x} = \frac{1}{2} - \frac{x - 2}{4} + \frac{(x - 2)^2}{8} - \cdots = \sum_{n=0}^{\infty} \frac{(-1)^n (x - 2)^n}{2^{n+1}}

This is geometric with ratio −x−22-\dfrac{x - 2}{2}, so it converges when ∣x−2∣2<1\dfrac{|x - 2|}{2} \lt 1, that is, 0<x<40 \lt x \lt 4. At x=0x = 0 and x=4x = 4 the terms have constant size 12\dfrac{1}{2}, so they don’t approach 00 and both endpoints diverge. The interval of convergence is 0<x<40 \lt x \lt 4.

8. (Challenge) Use the Maclaurin series for cos⁡x\cos x to find lim⁡x→0cos⁡x−1+x22x4\displaystyle\lim_{x \to 0} \frac{\cos x - 1 + \frac{x^2}{2}}{x^4}.

Solution

The first two terms of the series cancel with −1+x22-1 + \dfrac{x^2}{2}:

cos⁡x−1+x22=x44!−x66!+x88!−⋯\cos x - 1 + \frac{x^2}{2} = \frac{x^4}{4!} - \frac{x^6}{6!} + \frac{x^8}{8!} - \cdotscos⁡x−1+x22x4=124−x2720+x440 320−⋯\frac{\cos x - 1 + \frac{x^2}{2}}{x^4} = \frac{1}{24} - \frac{x^2}{720} + \frac{x^4}{40\,320} - \cdots

As x→0x \to 0, every term after the first goes to 00, so

lim⁡x→0cos⁡x−1+x22x4=124\lim_{x \to 0} \frac{\cos x - 1 + \frac{x^2}{2}}{x^4} = \frac{1}{24}

(L’Hôpital’s rule would need four rounds to get the same answer; the series does it in one line.)

9. (Challenge) The Maclaurin series for a function gg is ∑n=0∞(n+1)xn3n\displaystyle\sum_{n=0}^{\infty} \frac{(n + 1)x^n}{3^n}.

  • (a) Find g(4)(0)g^{(4)}(0).
  • (b) Find the interval of convergence.
Solution

(a) The coefficient of x4x^4 is 534=581\dfrac{5}{3^4} = \dfrac{5}{81}, and it equals g(4)(0)4!\dfrac{g^{(4)}(0)}{4!}. So

g(4)(0)=4!⋅581=12081=4027g^{(4)}(0) = 4! \cdot \frac{5}{81} = \frac{120}{81} = \frac{40}{27}

(b)

L=lim⁡n→∞n+2n+1⋅∣x∣3=∣x∣3L = \lim_{n \to \infty} \frac{n + 2}{n + 1} \cdot \frac{|x|}{3} = \frac{|x|}{3}

so ∣x∣<3|x| \lt 3. At x=±3x = \pm 3 the terms are (n+1)(n + 1) and (−1)n(n+1)(-1)^n (n + 1), which don’t approach 00, so both endpoints diverge. The interval of convergence is −3<x<3-3 \lt x \lt 3.

Try these independently after the practice questions. Show your setup and explain your reasoning. Use exact answers where possible, and check that your answers fit the question. Homework solutions are not provided on the published site.

All angles are in radians. Write each general term in sigma notation, starting at n=0n = 0 unless the question says otherwise.

H1. (Foundations) Let f(x)=e3xf(x) = e^{3x}.

  • (a) Find f′(0)f'(0), f′′(0)f''(0), f′′′(0)f'''(0), and a formula for f(n)(0)f^{(n)}(0).
  • (b) Use your answers to write the first four terms and the general term of the Maclaurin series for ff.
  • (c) Check your answer by replacing xx with 3x3x in the series for exe^x.

H2. (Foundations) Start from one of the four known series. For each function, write the first four nonzero terms and the general term of its Maclaurin series.

  • (a) e−x2e^{-x^2}
  • (b) sin⁡(2x)\sin(2x)
  • (c) 11+x2\dfrac{1}{1 + x^2}. Also state the values of xx for which this series converges.

H3. (Core) Build each series from a known one, without taking derivatives. Give the first four nonzero terms and the general term.

  • (a) x2exx^2 e^x
  • (b) xsin⁡(3x)x \sin(3x)

H4. (Core) Taylor series about a centre other than 00.

  • (a) Find the Taylor series for exe^x about x=2x = 2. Give the first four terms and the general term.
  • (b) Use the first three terms of your series from (a) to estimate e2.1e^{2.1} as a multiple of e2e^2, then as a decimal. Compare with your calculator’s value of e2.1e^{2.1}.
  • (c) Find the Taylor series for ln⁡x\ln x about x=2x = 2. Give the first four terms (including the constant term) and the general term for n≥1n \ge 1.

H5. (Core) Each series below is a known Maclaurin series with something substituted in. Name the function it equals.

  • (a) ∑n=0∞(−1)nx2n(2n)!\displaystyle\sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!}
  • (b) ∑n=0∞(−1)nxnn!\displaystyle\sum_{n=0}^{\infty} \frac{(-1)^n x^{n}}{n!}
  • (c) ∑n=0∞(−1)n 32n+1x2n+1(2n+1)!\displaystyle\sum_{n=0}^{\infty} \frac{(-1)^n\, 3^{2n+1} x^{2n+1}}{(2n+1)!}
  • (d) ∑n=0∞x3n\displaystyle\sum_{n=0}^{\infty} x^{3n}. For which xx does this one converge?

H6. (Core) (AP style) Let g(x)=sin⁡x−xx3g(x) = \dfrac{\sin x - x}{x^3} for x≠0x \ne 0, and g(0)=−16g(0) = -\dfrac{1}{6}.

  • (a) Write the first three nonzero terms and the general term of the Maclaurin series for sin⁡x−x\sin x - x.
  • (b) Use your answer to (a) to find lim⁡x→0sin⁡x−xx3\displaystyle\lim_{x \to 0} \frac{\sin x - x}{x^3}. Explain why this shows gg is continuous at x=0x = 0.
  • (c) Write the first three nonzero terms of the Maclaurin series for gg, and use them to find g′′(0)g''(0).

H7. (Challenge) (IB style)

  • (a) Using the Maclaurin series for exe^x and sin⁡x\sin x, show that the Maclaurin series for exsin⁡xe^x \sin x begins x+x2+x33+⋯x + x^2 + \dfrac{x^3}{3} + \cdots
  • (b) Hence find lim⁡x→0exsin⁡x−x−x2x3\displaystyle\lim_{x \to 0} \frac{e^x \sin x - x - x^2}{x^3}.

H8. (Challenge) A student finds the Maclaurin series for sin⁡(x2)\sin(x^2) like this:

sin⁡(x2)=∑n=0∞(−1)n(x2)2n+1(2n+1)!=∑n=0∞(−1)nx2n+3(2n+1)!\sin(x^2) = \sum_{n=0}^{\infty} \frac{(-1)^n (x^2)^{2n+1}}{(2n+1)!} = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+3}}{(2n+1)!}

Answer these:

  • (a) The first step is correct, but the second is not. Explain the error, and write the correct general term.
  • (b) Write the first three nonzero terms of the correct series. Check them by writing out the student’s first three terms and showing the two series disagree.
  • (c) A second student writes the denominator as (4n+2)!(4n + 2)! instead of (2n+1)!(2n + 1)!. Explain why that is also wrong.

H9. (Challenge) Let f(x)=x2cos⁡xf(x) = x^2 \cos x.

  • (a) Write the general term of the Maclaurin series for ff.
  • (b) Find f(10)(0)f^{(10)}(0) without taking ten derivatives.
  • (c) Explain why f(9)(0)=0f^{(9)}(0) = 0.

H10. (Challenge) Find the exact sum of each series by recognizing a known Maclaurin series. Explain which series you used and what you substituted.

  • (a) ∑n=0∞(−1)n2n n!\displaystyle\sum_{n=0}^{\infty} \frac{(-1)^n}{2^n\, n!}
  • (b) 1−12!(π3)2+14!(π3)4−16!(π3)6+⋯1 - \dfrac{1}{2!}\left(\dfrac{\pi}{3}\right)^2 + \dfrac{1}{4!}\left(\dfrac{\pi}{3}\right)^4 - \dfrac{1}{6!}\left(\dfrac{\pi}{3}\right)^6 + \cdots
  • (c) ∑n=1∞nn!\displaystyle\sum_{n=1}^{\infty} \frac{n}{n!}. (Hint: simplify nn!\dfrac{n}{n!} first, and watch the starting index.)