Real AnalysisDerivatives

Taylor's Theorem with Remainder

f(x) = Pₙ(x) + f⁽ⁿ⁺¹⁾(c)(x − a)ⁿ⁺¹/(n + 1)! for some c between a and x; a bound on f⁽ⁿ⁺¹⁾ bounds the error.

Not started Jump to practice

In Calculus 2 you used Taylor's inequality to bound errors. Taylor's theorem says exactly what the error is, up to one unknown point, and it is the mean value theorem taken to higher order. (The case $n = 0$ is the MVT itself: $f(x) = f(a) + f'(c)(x - a)$.)

Key idea

Taylor's theorem. If $f$ has $n + 1$ derivatives on an interval containing $a$ and $x$, then $$f(x) = P_n(x) + \frac{f^{(n+1)}(c)}{(n + 1)!}(x - a)^{n+1}$$ for some $c$ between $a$ and $x$, where $P_n(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x - a)^{k}$. If $|f^{(n+1)}| \le M$ between $a$ and $x$, then $|f(x) - P_n(x)| \le \frac{M|x - a|^{n+1}}{(n + 1)!}$.

Why it works

Fix $x \ne a$ and choose the number $K$ so that $g(t) = f(t) - P_n(t) - K(t - a)^{n+1}$ has $g(x) = 0$. By construction $g(a) = g'(a) = \cdots = g^{(n)}(a) = 0$. Rolle's theorem on $[a, x]$ gives $c_1$ with $g'(c_1) = 0$; Rolle again on $[a, c_1]$ (since $g'(a) = 0$) gives $c_2$ with $g''(c_2) = 0$; after $n + 1$ steps, $g^{(n+1)}(c) = 0$ for some $c$ between $a$ and $x$. But $g^{(n+1)}(t) = f^{(n+1)}(t) - (n + 1)!\,K$, because $P_n$ has degree $n$. So $K = \frac{f^{(n+1)}(c)}{(n + 1)!}$, which is the formula. $\blacksquare$
Taylor polynomials of $e^{x}$ at $0$: add terms and watch the error at the probe point shrink like $\frac{3x^{n+1}}{(n + 1)!}$ predicts.

Worked examples

Worked example: How many terms for $e$?

Approximating $e = e^{1}$ by $P_n(1) = \sum_{k=0}^{n} \frac{1}{k!}$, using $e^{c} < 3$ for $0 \le c \le 1$, find the smallest $n$ with error bound below $0.001$.
  1. The bound is $\frac{3}{(n + 1)!}$.
  2. $n = 5$: $\frac{3}{720} \approx 0.0042$, too big. $n = 6$: $\frac{3}{5040} \approx 0.0006$.

Answer: $n = 6$ (or more).

Worked example: A sine error

Bound the error of $\sin x \approx x - \frac{x^{3}}{6}$ at $x = \frac{1}{2}$.
  1. This is $P_3$ (the $x^{2}$ and $x^{4}$ terms are $0$, so it is also $P_4$). Using $P_4$: $|R_4| \le \frac{|x|^{5}}{5!}$ since every derivative of $\sin$ is at most $1$ in size.
  2. $\frac{(1/2)^{5}}{120} = \frac{1}{3840}$.

Answer: Error at most $\frac{1}{3840} \approx 0.00026$.

Worked example: Finding the point $c$

For $f(x) = x^{4}$, $a = 0$ and $n = 2$, find $c$ with $f(x) = P_2(x) + \frac{f'''(c)}{3!}x^{3}$ at $x = 6$.
  1. $P_2 = 0$ (all derivatives up to order $2$ vanish at $0$), and $f'''(t) = 24t$.
  2. So $6^{4} = \frac{24c}{6}\cdot 6^{3}$, that is, $1296 = 864c$.

Answer: $c = \frac{3}{2} = \frac{6}{4}$, which is between $0$ and $6$.

Common mistake

The wrong derivative, or a guessed $c$. The remainder after $P_n$ uses the $(n + 1)$st derivative. And since $c$ is unknown, you cannot plug in $c = a$ or $c = x$; bound $|f^{(n+1)}|$ over the whole interval between $a$ and $x$ instead. For $e^{x}$ on $[0, 1]$ that bound is $e < 3$, not $e^{0} = 1$.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

This is one of the top rungs of Real Analysis.

Sources and further reading

  • Jiří Lebl, Basic Analysis I: Introduction to Real Analysis, section 4.3 (Taylor's theorem)
  • MIT OpenCourseWare 18.100A Real Analysis, lecture notes on Taylor's theorem
@teddyrookbook GitHub