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 exe^x to find lim⁡x→0ex−1−xx2\displaystyle\lim_{x \to 0} \frac{e^x - 1 - x}{x^2}.

Solutionex−1−x=x22!+x33!+x44!+⋯e^x - 1 - x = \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \cdotsex−1−xx2=12+x6+x224+⋯\frac{e^x - 1 - x}{x^2} = \frac{1}{2} + \frac{x}{6} + \frac{x^2}{24} + \cdots

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

lim⁡x→0ex−1−xx2=12\lim_{x \to 0} \frac{e^x - 1 - x}{x^2} = \frac{1}{2}

(L’Hôpital’s rule twice gives the same answer.)

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.