practicecalculus
Series and multivariable theorems

Taylor's Theorem: Remainder Formula and Error Bound Examples

Taylor's theorem with the Lagrange remainder: how close a Taylor polynomial is to f(x). Statement, error bound, graph and worked examples with e and sin x.

Series and multivariable theorems Updated 3 min read

At a glance

f(x) = P_n(x) + \frac{f^{(n+1)}(c)}{(n+1)!}(x - a)^{n+1}
Hypotheses
f has n + 1 derivatives on an open interval I containing a, and x is in I
Taylor polynomial
P_n(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x - a)^k
Remainder (Lagrange form)
R_n(x) = \frac{f^{(n+1)}(c)}{(n+1)!}(x - a)^{n+1} for some c between a and x
Error bound
|R_n(x)| \le \frac{M}{(n+1)!}|x - a|^{n+1} where |f^{(n+1)}| \le M
Case n = 0
The mean value theorem
Course
Calculus 2
On this page
  1. Statement of Taylor's theorem
  2. Taylor's inequality (the error bound)
  3. What Taylor's theorem means
  4. Why the hypotheses matter
  5. Worked examples
  6. Common mistakes
  7. Related theorems and guides

Taylor's theorem says that a smooth function equals its Taylor polynomial plus an error term, and it gives that error term an exact form. That turns "the Taylor polynomial is a good approximation" into a guaranteed number of correct decimal places.

Statement of Taylor's theorem

Suppose f has derivatives up to order n + 1 on an open interval I containing a. Let

P_n(x) = f(a) + f'(a)(x - a) + \frac{f''(a)}{2!}(x - a)^2 + \cdots + \frac{f^{(n)}(a)}{n!}(x - a)^n

be the degree n Taylor polynomial of f at a. Then for every x in I there is a number c between a and x such that

f(x) = P_n(x) + R_n(x), \qquad R_n(x) = \frac{f^{(n+1)}(c)}{(n+1)!}(x - a)^{n+1}

This is the Lagrange form of the remainder. When a = 0 the polynomial is called a Maclaurin polynomial.

Taylor's inequality (the error bound)

You almost never know c, so you bound the derivative instead. If |f^{(n+1)}(t)| \le M for every t between a and x, then

|f(x) - P_n(x)| = |R_n(x)| \le \frac{M}{(n+1)!}|x - a|^{n+1}

The bound gets small fast because (n+1)! grows faster than any power.

What Taylor's theorem means

The remainder looks exactly like the next term of the Taylor series, except the derivative is evaluated at some point c instead of at a. For n = 0 the statement is f(x) = f(a) + f'(c)(x - a), which is the mean value theorem. Taylor's theorem is the higher-order version.

Taylor's theorem: Taylor polynomials of sin(x) at 0 hug the curve near 0
The degree 1, 3 and 5 Maclaurin polynomials of \sin x. Near x = 0 the error is tiny; it grows with |x| and shrinks as the degree rises.

Why the hypotheses matter

Enough derivatives. The remainder formula uses f^{(n+1)}. For f(x) = |x| at a = 0, f'(0) does not exist, so there is not even a degree 1 Taylor polynomial.

A remainder that does not shrink. Taylor's theorem always holds when its hypotheses do, but it does not promise the error goes to 0. The function f(x) = e^{-1/x^2} (with f(0) = 0) has every derivative equal to 0 at x = 0, so every Taylor polynomial at 0 is the zero polynomial. The remainder R_n(x) = f(x) never shrinks, and the Taylor series converges to 0, not to f. A function equals its Taylor series only when R_n(x) \to 0.

Worked examples

Example 1: approximate e with P_4 and bound the error.

Step 1. For f(x) = e^x at a = 0, every derivative is e^x and equals 1 at 0. So

P_4(1) = 1 + 1 + \frac{1}{2} + \frac{1}{6} + \frac{1}{24} = \frac{65}{24} \approx 2.70833

Step 2. On [0, 1], f^{(5)}(t) = e^t \le e < 3, so take M = 3.

Step 3. |R_4(1)| \le \frac{3}{5!}\cdot 1^5 = \frac{3}{120} = 0.025.

The true error is e - 2.70833 \approx 0.00995, comfortably inside the bound.

Example 2: \sin(0.1) to high accuracy.

The Maclaurin polynomial P_3(x) = x - \frac{x^3}{6} gives \sin(0.1) \approx 0.1 - \frac{0.001}{6} \approx 0.0998333. Since the x^4 coefficient of sine is 0, P_4 = P_3, so we may use R_4. Every derivative of \sin is bounded by M = 1:

|R_4(0.1)| \le \frac{1}{5!}(0.1)^5 = \frac{0.00001}{120} \approx 8.3 \times 10^{-8}

So 0.0998333 is correct to at least six decimal places.

Example 3: how many terms for e^{0.5} within 0.001?

On [0, 0.5], e^t \le e^{0.5} < 2, so |R_n(0.5)| \le \frac{2\,(0.5)^{n+1}}{(n+1)!}.

n Bound \frac{2\,(0.5)^{n+1}}{(n+1)!}
2 \frac{2(0.125)}{6} \approx 0.042
3 \frac{2(0.0625)}{24} \approx 0.0052
4 \frac{2(0.03125)}{120} \approx 0.00052

The bound first drops below 0.001 at n = 4, so P_4(0.5) is accurate enough.

Common mistakes

  1. Using (n)! instead of (n+1)!. The remainder after a degree n polynomial uses the (n+1)st derivative and (n+1)!.
  2. Bounding the derivative at a only. M must bound |f^{(n+1)}| on the whole interval between a and x.
  3. Assuming the Taylor series always equals f. It does only when the remainder tends to 0.

Taylor's theorem generalizes the mean value theorem. For building the polynomials and series themselves, see Taylor series and power series. In several variables, the second-order Taylor expansion uses mixed partial derivatives, which Clairaut's theorem says can be taken in either order.

Practice it now

Estimating with Taylor polynomials

Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.

Practice this lesson

Frequently asked questions

What does Taylor's theorem say?

If f has n + 1 derivatives on an interval containing a and x, then f(x) = P_n(x) + R_n(x), where P_n is the degree n Taylor polynomial at a and R_n(x) = \frac{f^{(n+1)}(c)}{(n+1)!}(x - a)^{n+1} for some c between a and x.

What is the Lagrange error bound?

If |f^{(n+1)}(t)| \le M for all t between a and x, then the error in using P_n(x) to approximate f(x) is at most \frac{M}{(n+1)!}|x - a|^{n+1}. It is the same as Taylor's inequality.

How do you know how many terms of a Taylor polynomial you need?

Write the error bound as a function of n and increase n until the bound is smaller than the accuracy you need. The factorial in the denominator makes the bound shrink quickly.

What is the difference between Taylor's theorem and a Taylor series?

A Taylor series is the infinite sum of all the terms. Taylor's theorem is about a finite polynomial and gives an exact formula for the leftover error, which is how you prove a Taylor series converges to the function.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.