Taylor Series

A Taylor series is the power series \sum_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!}(x - a)^n, built from every derivative of f at x = a. It is a Taylor polynomial that never stops. Where the series converges to f, the function equals its Taylor series; for e^x, sin x and cos x, that is every x.

Before this lesson: Taylor Polynomials, Power Series and Radius and Interval of Convergence

From Taylor polynomials to Taylor series

Each Taylor polynomial P_n(x) matches f and its first n derivatives at a. If you let n grow forever, you get a power series: the Taylor series of f centered at a. Its partial sums are exactly the Taylor polynomials.

The series is useful where it converges to f. Inside that interval, adding more terms always gets you closer to the true value. Outside it, the partial sums run away from the function.

Graph of y = ln x (thick navy curve) for 0 < x ≤ 3 with partial sums of its Taylor series centered at 1: degree 1 (gray dashed line), degree 3 (solid green) and degree 9 (dotted orange). Between x = 0 and x = 2 the partial sums move closer to ln x as the degree grows. To the right of the dotted line x = 2 the degree-9 partial sum swings away from the curve, because the series diverges there.
The Taylor series of ln x at a = 1 matches ln x only for 0 < x ≤ 2; past x = 2 its partial sums break away.

The Taylor series formula

f(x) = \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
  • The coefficient of (x - a)^n is c_n = \frac{f^{(n)}(a)}{n!}.
  • A Taylor series centered at a = 0 is called a Maclaurin series; the next lesson covers the main ones.
  • The equals sign holds only where the series converges to f. Find that interval with the ratio test.

How to find a Taylor series

  1. Find several derivatives of f and look for a pattern.
  2. Evaluate each derivative at x = a.
  3. Divide by n! to get each coefficient, and write a general formula for c_n.
  4. Write the series as a sum, with powers of (x − a).
  5. Use the ratio test to find the radius of convergence.

Taylor series examples

Example 1: eˣ centered at a = 2

Find the Taylor series of f(x) = e^x centered at a = 2.

f^{(n)}(x) = e^x \text{ for every } n

Every derivative of eˣ is eˣ (see derivatives of exponential functions).

f^{(n)}(2) = e^2

Evaluate at a = 2.

c_n = \dfrac{e^2}{n!}

Divide by n!.

e^x = \sum_{n=0}^{\infty} \dfrac{e^2}{n!}(x - 2)^n

Write the series with powers of (x − 2).

\left|\dfrac{c_{n+1}(x - 2)^{n+1}}{c_n(x - 2)^n}\right| = \dfrac{|x - 2|}{n + 1} \to 0

Ratio test: the limit is 0 for every x, so R = ∞.

Answer: e^x = e^2\left[1 + (x - 2) + \frac{(x - 2)^2}{2!} + \frac{(x - 2)^3}{3!} + \cdots\right] for every x.

Example 2: ln x centered at a = 1

Find the Taylor series of f(x) = \ln x centered at a = 1, and its interval of convergence.

f'(x) = x^{-1}, \; f''(x) = -x^{-2}, \; f'''(x) = 2x^{-3}, \; f^{(4)}(x) = -6x^{-4}

Use the power rule again and again.

f^{(n)}(x) = (-1)^{n-1}(n - 1)!\,x^{-n} \quad (n \ge 1)

The signs alternate, and the numbers 1, 1, 2, 6 are 0!, 1!, 2!, 3!.

f^{(n)}(1) = (-1)^{n-1}(n - 1)!

Evaluate at a = 1; also f(1) = ln 1 = 0.

c_n = \dfrac{(-1)^{n-1}(n - 1)!}{n!} = \dfrac{(-1)^{n-1}}{n}

n! = n · (n − 1)!, so cancel (n − 1)!.

\ln x = \sum_{n=1}^{\infty} \dfrac{(-1)^{n-1}}{n}(x - 1)^n

The n = 0 term is 0, so start at n = 1.

\left|\dfrac{a_{n+1}}{a_n}\right| = |x - 1| \cdot \dfrac{n}{n + 1} \to |x - 1|

Ratio test, so R = 1 and 0 < x < 2.

\text{At } x = 2: \; \sum \dfrac{(-1)^{n-1}}{n} \text{ converges}; \quad \text{at } x = 0: \; -\sum \dfrac{1}{n} \text{ diverges}

Check the endpoints (alternating series test; harmonic series).

Answer: \ln x = (x - 1) - \frac{(x - 1)^2}{2} + \frac{(x - 1)^3}{3} - \cdots for 0 < x ≤ 2.

Example 3: 1/x centered at a = 2

Find the Taylor series of f(x) = \dfrac{1}{x} centered at a = 2.

f^{(n)}(x) = (-1)^n n!\,x^{-(n+1)}

The derivatives are −x⁻², 2x⁻³, −6x⁻⁴, …

f^{(n)}(2) = \dfrac{(-1)^n n!}{2^{n+1}}

Evaluate at a = 2.

c_n = \dfrac{(-1)^n}{2^{n+1}}

Divide by n!; the n! cancels.

\dfrac{1}{x} = \sum_{n=0}^{\infty} \dfrac{(-1)^n}{2^{n+1}}(x - 2)^n

Write the series.

\left|\dfrac{a_{n+1}}{a_n}\right| = \dfrac{|x - 2|}{2} \lt 1 \quad \Leftrightarrow \quad 0 \lt x \lt 4

Ratio test: R = 2. At x = 0 and x = 4 the terms do not go to 0, so both endpoints diverge.

Answer: \frac{1}{x} = \frac{1}{2} - \frac{x - 2}{4} + \frac{(x - 2)^2}{8} - \cdots for 0 < x < 4.

Example 4: cos x centered at a = π

Find the Taylor series of f(x) = \cos x centered at a = \pi.

f(\pi) = \cos \pi = -1, \; f'(\pi) = -\sin \pi = 0

Use the unit circle: cos π = −1 and sin π = 0.

f''(\pi) = -\cos \pi = 1, \; f'''(\pi) = \sin \pi = 0

The derivatives cycle: cos, −sin, −cos, sin.

f^{(4)}(\pi) = \cos \pi = -1

The values repeat: −1, 0, 1, 0, −1, …

\cos x = -1 + \dfrac{(x - \pi)^2}{2!} - \dfrac{(x - \pi)^4}{4!} + \cdots

Only even powers survive; divide by n!.

\cos x = \sum_{n=0}^{\infty} \dfrac{(-1)^{n+1}(x - \pi)^{2n}}{(2n)!}

Write the general term; R = ∞, as for eˣ.

Answer: \cos x = \sum_{n=0}^{\infty} \frac{(-1)^{n+1}(x - \pi)^{2n}}{(2n)!} for every x.

Example 5: Side of a square patio (word problem)

A square patio has an area of 101 square feet, so its side is \sqrt{101} feet. Use the first three terms of the Taylor series of \sqrt{x} centered at a = 100 to estimate the side.

f(100) = \sqrt{100} = 10

100 is a nearby perfect square, so center there.

f'(x) = \dfrac{1}{2\sqrt{x}}, \; f'(100) = \dfrac{1}{20}

Differentiate, then evaluate at 100.

f''(x) = -\dfrac{1}{4x^{3/2}}, \; f''(100) = -\dfrac{1}{4000}

100 to the 3/2 is 1000 (see rational exponents).

\sqrt{101} \approx 10 + \dfrac{1}{20}(1) - \dfrac{1}{4000 \cdot 2!}(1)^2

Use the first three terms with x − 100 = 1.

10 + 0.05 - 0.000125 = 10.049875

Divide, then combine.

Answer: the side is about 10.0499 feet. (The true value is 10.04988 to five decimal places.)

Common mistakes

MistakeExample of the errorFix
Evaluating derivatives at xWriting \frac{1}{x}(x - 1) as a term of the ln x seriesEvaluate at the center: f′(1) = 1.
Leaving out n!Writing \sum (-1)^{n-1}(n - 1)!\,(x - 1)^nDivide each derivative by n!, which gives (−1)ⁿ⁻¹/n.
Using powers of x when a ≠ 0Writing \sum \frac{e^2}{n!}x^n for eˣ at a = 2Use powers of (x − a): (x - 2)^n.
Getting the sign pattern wrongStarting the ln x series with −(x − 1)Check the first terms against the derivatives: f′(1) = 1 is positive.
Assuming the series equals f everywhereUsing the ln x series at a = 1 to find ln 5It is valid only for 0 < x ≤ 2. Use a new center or a different method.
Starting the index wrongUsing n = 0 in (−1)ⁿ⁻¹(x − 1)ⁿ/nDivision by 0: start at n = 1, since the constant term is ln 1 = 0.

Related methods

Building series from known series

Finding many derivatives can be slow. Often it is faster to start from a known series, such as the geometric series in power series, and substitute or multiply. The next lesson lists the Maclaurin series you should know.

How good is a partial sum?

A partial sum of a Taylor series is a Taylor polynomial, so the Lagrange error bound tells you how far off it can be. For alternating series, the alternating series error bound is often easier.

Practice problems

  1. Find the Taylor series of e^x centered at a = −1.
  2. Find the Taylor series of sin x centered at a = \frac{\pi}{2}.
  3. Find the Taylor series of \frac{1}{x} centered at a = 1, and its interval of convergence.
  4. Write the first four terms of the Taylor series of e^x centered at a = 3.
  5. Find the Taylor series of ln x centered at a = 2.
  6. Find the Taylor series of x^3 centered at a = 1.
  7. Find the coefficient of (x - 4)^3 in the Taylor series of \sqrt{x} centered at a = 4.
  8. The Taylor series of f at a = 3 is \sum_{n=0}^{\infty} \frac{(n + 1)(x - 3)^n}{2^n}. Find f‴(3).
  9. Find the radius of convergence of the Taylor series of \frac{1}{x} centered at a = 5.
  10. A cube-shaped tank holds 8.3 m³, so its edge is \sqrt[3]{8.3} m. Use three terms of the Taylor series of \sqrt[3]{x} at a = 8 to estimate the edge.
Show answers

1.

f^{(n)}(-1) = e^{-1}

Every derivative of eˣ is eˣ.

c_n = \dfrac{e^{-1}}{n!}

Divide by n!.

Answer: e^x = \sum_{n=0}^{\infty} \dfrac{e^{-1}(x + 1)^n}{n!} for every x

2.

f(\tfrac{\pi}{2}) = 1, \; f'(\tfrac{\pi}{2}) = 0, \; f''(\tfrac{\pi}{2}) = -1, \; f'''(\tfrac{\pi}{2}) = 0

Evaluate sin, cos, −sin, −cos at π/2.

1 - \dfrac{(x - \frac{\pi}{2})^2}{2!} + \dfrac{(x - \frac{\pi}{2})^4}{4!} - \cdots

Only even powers survive, with alternating signs.

Answer: \sin x = \sum_{n=0}^{\infty} \dfrac{(-1)^n (x - \frac{\pi}{2})^{2n}}{(2n)!} for every x

3.

f^{(n)}(1) = (-1)^n n!

From f⁽ⁿ⁾(x) = (−1)ⁿn! x⁻⁽ⁿ⁺¹⁾ at x = 1.

c_n = (-1)^n

Divide by n!.

|x - 1| \lt 1 \quad \Leftrightarrow \quad 0 \lt x \lt 2

Ratio test gives |x − 1|; both endpoints fail the divergence test.

Answer: \frac{1}{x} = \sum_{n=0}^{\infty} (-1)^n (x - 1)^n for 0 < x < 2

4.

c_n = \dfrac{e^3}{n!}

Every derivative at 3 is e³.

Answer: e^3 + e^3(x - 3) + \dfrac{e^3}{2}(x - 3)^2 + \dfrac{e^3}{6}(x - 3)^3

5.

f^{(n)}(2) = \dfrac{(-1)^{n-1}(n - 1)!}{2^n}

Use the pattern from Example 2 at x = 2.

c_n = \dfrac{(-1)^{n-1}}{n \cdot 2^n}

Divide by n! = n · (n − 1)!.

Answer: \ln x = \ln 2 + \sum_{n=1}^{\infty} \dfrac{(-1)^{n-1}(x - 2)^n}{n \cdot 2^n} for 0 < x ≤ 4

6.

f(1) = 1, \; f'(1) = 3, \; f''(1) = 6, \; f'''(1) = 6

f′ = 3x², f″ = 6x, f‴ = 6; all higher derivatives are 0.

c_0 = 1, \; c_1 = 3, \; c_2 = \dfrac{6}{2} = 3, \; c_3 = \dfrac{6}{6} = 1

Divide by n!.

Answer: x^3 = 1 + 3(x - 1) + 3(x - 1)^2 + (x - 1)^3 (the series stops)

7.

f'''(x) = \dfrac{3}{8}x^{-5/2}

Differentiate x to the 1/2 three times.

f'''(4) = \dfrac{3}{8} \cdot \dfrac{1}{32} = \dfrac{3}{256}

4 to the 5/2 is 32.

c_3 = \dfrac{3/256}{3!} = \dfrac{3}{1536} = \dfrac{1}{512}

Divide by 3! = 6.

Answer: 1/512

8.

c_3 = \dfrac{(3 + 1)}{2^3} = \dfrac{1}{2}

Put n = 3 into the coefficient.

f'''(3) = 3! \cdot c_3 = 6 \cdot \dfrac{1}{2} = 3

c₃ = f‴(3)/3!, so multiply by 3!.

Answer: f‴(3) = 3

9.

c_n = \dfrac{(-1)^n}{5^{n+1}}

Same pattern as Example 3, with 5 in place of 2.

\left|\dfrac{a_{n+1}}{a_n}\right| = \dfrac{|x - 5|}{5} \lt 1

Ratio test.

Answer: R = 5 (the distance from 5 to 0, where 1/x is undefined)

10.

f(8) = 2, \; f'(8) = \dfrac{1}{3} \cdot 8^{-2/3} = \dfrac{1}{12}

8 to the −2/3 is 1/4.

f''(8) = -\dfrac{2}{9} \cdot 8^{-5/3} = -\dfrac{2}{9} \cdot \dfrac{1}{32} = -\dfrac{1}{144}

8 to the −5/3 is 1/32.

2 + \dfrac{0.3}{12} - \dfrac{1}{144 \cdot 2}(0.3)^2 = 2 + 0.025 - 0.0003125

x − 8 = 0.3 and 0.3² = 0.09.

2 + 0.025 - 0.0003125 = 2.0246875

Combine.

Answer: about 2.0247 m (true value 2.02469)

Taylor series FAQ

What is a Taylor series?

It is the infinite power series \sum \frac{f^{(n)}(a)}{n!}(x - a)^n built from all the derivatives of f at a point a. Where it converges to f, it equals the function.

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

A Maclaurin series is a Taylor series centered at a = 0. Every Maclaurin series is a Taylor series, but Taylor series can use any center.

Does a Taylor series always equal its function?

Only where it converges to the function. The series for ln x at a = 1 works only for 0 < x ≤ 2. A few unusual functions have a Taylor series that converges but to a different function.

How do you find the radius of convergence of a Taylor series?

Write the general term, then use the ratio test. Often R is the distance from the center to the nearest point where the function breaks down, such as x = 0 for 1/x or ln x.

Summary

  • f(x) = \sum \frac{f^{(n)}(a)}{n!}(x - a)^n wherever the series converges to f.
  • Find derivatives, evaluate them at a, divide by n!, and look for a pattern.
  • Use powers of (x − a), and state the interval where the series is valid.
  • Its partial sums are Taylor polynomials.
  • eˣ, sin x and cos x equal their Taylor series for every x.

Previous lesson: Radius and Interval of Convergence

Next lesson: Maclaurin Series

Back to the Calculus 2 Index