A Taylor polynomial is an approximation. How good is it? Taylor's inequality bounds the error using the next derivative, much as the Mean Value Theorem bounds how far a function can move.
Why it works
Write $f(x) = T_n(x) + R_n(x)$. Taylor's theorem says the remainder has the form
$$R_n(x) = \frac{f^{(n+1)}(c)}{(n + 1)!}(x - a)^{n+1}$$
for some $c$ between $a$ and $x$: it looks just like the next term of the series, with the derivative taken at an unknown point. (For $n = 0$ this is the Mean Value Theorem.) You do not know $c$, but if you know a bound $M$ for $|f^{(n+1)}|$ on the whole interval, you get a guaranteed error bound.
Key idea
Taylor's inequality: if $|f^{(n+1)}(t)| \le M$ for all $t$ between $a$ and $x$, then
$$|R_n(x)| \le \frac{M}{(n + 1)!}|x - a|^{n+1}.$$
If $R_n(x) \to 0$ as $n \to \infty$, the Taylor series converges to $f(x)$.
Worked example: A sine estimate
Bound the error when $T_3(x) = x - \frac{x^{3}}{6}$ approximates $\sin(0.5)$.
- Every derivative of $\sin$ is $\pm\sin$ or $\pm\cos$, so $M = 1$ works.
- $|R_3(0.5)| \le \frac{1}{4!}(0.5)^{4} = \frac{1}{384} \approx 0.0026$.
- (Actually $T_3(0.5) = 0.479167$ and $\sin 0.5 = 0.479426$: the true error is $0.00026$, well inside the bound.)
Answer: At most $\frac{1}{384}$
Worked example: How many terms for e?
How many terms of $e = \sum\frac{1}{n!}$ guarantee an error less than $0.001$?
- For $f(x) = e^{x}$ on $[0, 1]$, every derivative is at most $e < 3$, so $M = 3$.
- $|R_n(1)| \le \frac{3}{(n + 1)!}$. Need $(n + 1)! > 3000$: $6! = 720$ is too small, $7! = 5040$ works.
- So $n = 6$: $$\begin{aligned} T_6(1) &= 1 + 1 + \frac{1}{2} + \cdots + \frac{1}{720} \\ &\approx 2.71806, \end{aligned}$$ within $0.001$ of $e = 2.71828$.
Answer: $n = 6$ (seven terms)
Common mistake
Choosing $M$ from the value at the center only. For $e^{x}$ on $[0, 2]$, $f^{(n+1)}(0) = 1$, but the bound must hold for every $t$ in the interval, and $e^{t}$ reaches $e^{2} \approx 7.39$. Using $M = 1$ would understate the error. Find the largest value of $|f^{(n+1)}|$ on the whole interval between $a$ and $x$ (or a convenient number above it).
Worked example: Why the series for e^x works
Show that $\sum\frac{x^{n}}{n!}$ equals $e^{x}$ for every $x$.
- On the interval between 0 and $x$, $|f^{(n+1)}| \le e^{|x|}$, so $|R_n(x)| \le e^{|x|}\frac{|x|^{n+1}}{(n + 1)!}$.
- For fixed $x$, $\frac{|x|^{n+1}}{(n + 1)!} \to 0$ (factorials beat powers).
- So $R_n(x) \to 0$, and the series converges to $e^{x}$.
Answer: $e^{x} = \sum\frac{x^{n}}{n!}$ for all $x$