4.5 Taylor’s Theorem
Theorem 4.5.1. Let \(n\geq 1\), and suppose that \(f\) and its derivatives \(f', f'', \dots , f^{(n-1)}\) exist and are continuous on the closed interval \([a,b]\), and that \(f^{(n)}\) exists on the open interval \((a,b)\). Then there is a number \(c\) with \(a < c< b\) such that \begin {align*} f(b) = f(a) &+ f'(a) (b-a) + \frac {f''(a)}{2!} (b - a)^2 + \cdots \\ &+ \frac {f^{(n-1)}(a)}{(n - 1)!} (b - a)^{n - 1} + \frac {f^{(n)}(c)}{n!} (b - a)^n . \end {align*}
Proof. We prove the theorem the way we proved the Mean Value Theorem: we construct a suitable function \(F\) and apply Rolle’s Theorem, this time repeatedly. Define \begin {equation} \label {eq:taylorF} \begin {split} F(x) = f(x) - f(a) &- f'(a) (x - a) - \frac {f''(a)}{2!} (x - a)^2 - \cdots \\ &-\frac {f^{(n - 1)} (a)}{(n - 1)!} (x - a)^{n - 1} - K (x -a)^n , \end {split} \end {equation} where \(K\) is chosen so that \(F(b) = F(a)\). Since \(F(a) = 0\), this gives \begin {equation} \label {eq:taylorK} K = \frac {f(b) - f(a) -\sum _{r = 1}^{n - 1} \frac {f^{(r)} (a)}{r!} (b - a)^r}{(b - a)^n}. \end {equation} Now \(F\) is continuous on \([a,b]\), differentiable on \((a,b)\), and \(F(a) = 0 = F(b)\). By Rolle’s Theorem there is some \(c_1\) with \(a < c_1 < b\) such that \(F'(c_1) = 0\). Differentiating (4.7) gives \begin {align*} F'(x) = f'(x) - f'(a) &- f''(a) (x-a)-\cdots \\ &- \frac {f^{(n-1)} (a)}{(n - 2)!} (x - a)^{n - 2}- K n (x - a)^{n - 1}, \end {align*}
so \(F'(a) = 0\). If \(n\geq 2\), then \(F'\) is continuous on \([a,c_1]\), differentiable on \((a,c_1)\), and \(F'(a) = F'(c_1) = 0\), so by Rolle’s Theorem there is a \(c_2\) with \(a< c_2 < c_1\) and \(F''(c_2) = 0\).
In the same way \(F^{(k)}(a) = 0\) for \(1 \leq k \leq n - 1\). Applying Rolle’s Theorem successively to \(F'', F''', \dots \) we obtain numbers \(a < c_n < c_{n-1} < \cdots < c_2 < c_1 < b\) with \begin {equation} \label {eq:taylorFn} F^{(n)}(c_n) = 0 . \end {equation} From (4.7), \(F^{(n)}(x) = f^{(n)}(x) - n!\,K\) for \(a < x <b\). Writing \(c = c_n\), equation (4.9) gives \(K = \frac {f^{(n)} (c)}{n!}\). Comparing with (4.8), \[\frac {f^{(n)}(c) (b - a)^n}{n!} = f(b) - f(a) - \sum ^{n - 1}_{r=1}\frac {f^{(r)}(a)}{r!} (b - a)^r ,\] and solving for \(f(b)\) gives the result. □
Note. The same proof works with \(b<a\), so for any \(x\) in an interval where \(f\) is \(n\) times differentiable, \[f(x) = \sum _{r=0}^{n-1}\frac {f^{(r)}(a)}{r!}(x-a)^r + R_n(x), \qquad R_n(x) = \frac {f^{(n)}(c)}{n!}(x-a)^n\] for some \(c\) between \(a\) and \(x\). The polynomial is the Taylor polynomial of degree \(n-1\), and \(R_n(x)\) is the Lagrange form of the remainder.
Example 4.5.2. Use Taylor’s formula with remainder to show that \(e^x = \sum ^{\infty }_{n = 0} \frac {x^n}{n!}\) for all real \(x\).
Solution. With \(f(x) = e^x\) and \(a = 0\), every derivative is \(e^x\), so \[e^x = 1 + x + \frac {x^2}{2!} + \dots + \frac {x^{n -1}}{(n - 1)!} + R_n(x), \qquad R_n(x) = \frac {e^c x^n}{n!}\] for some \(c\) between \(0\) and \(x\). Since \(e^c\leq e^{|x|}\), \(|R_n(x)| \leq e^{|x|}\frac {|x|^n}{n!}\). For fixed \(x\), \(\frac {|x|^n}{n!}\longrightarrow 0\) (once \(n>2|x|\), each further factor \(\frac {|x|}{n}\) is less than \(\frac {1}{2}\)). Hence \(R_n(x)\longrightarrow 0\), and the series converges to \(e^x\).
Solution. Let \(f(x) = \ln (1+x)\). Then \(f'(x) = (1+x)^{-1}\), \(f''(x) = -(1+x)^{-2}\), \(f'''(x) = 2(1+x)^{-3}\) and \(f^{(4)}(x) = -6(1+x)^{-4}\), so \(f(0) = 0\), \(f'(0) = 1\), \(f''(0) = -1\), \(f'''(0) = 2\). Taylor’s Theorem with \(n=4\) gives \[\ln (1+x) = x - \frac {x^2}{2} + \frac {x^3}{3} + R_4(x),\qquad R_4(x) = -\frac {6}{(1+c)^4}\cdot \frac {x^4}{4!}\] for some \(c\) between \(0\) and \(x\). At \(x = 0.1\), \[\ln (1.1)\approx 0.1 - 0.005 + 0.000333 = 0.095333,\qquad |R_4(0.1)|\leq \frac {6}{24}(0.1)^4 = 0.000025 .\] So \(\ln (1.1) = 0.0953\) to four decimal places. (The true value is \(0.0953102\ldots \).)
Example 4.5.4. How many terms of the series \(\sum \frac {1}{k!}\) are needed to compute \(e\) to four decimal places?
Solution. By Taylor’s Theorem for \(e^x\) at \(a = 0\) with \(x = 1\), \[e = \sum _{k=0}^{n-1}\frac {1}{k!} + \frac {e^c}{n!},\qquad 0<c<1 .\] Since \(e^c<e<3\), the error is less than \(\frac {3}{n!}\). We need \(\frac {3}{n!}<0.00005\), that is, \(n!>60000\). Since \(8! = 40320\) and \(9! = 362880\), \(n = 9\) suffices, and \[e\approx \sum _{k=0}^{8}\frac {1}{k!} = 2.718279\ldots ,\] with error less than \(\frac {3}{9!}<0.0000083\). So \(e = 2.7183\) to four decimal places.
Example 4.5.5. Prove that \(\cos x\geq 1 - \frac {x^2}{2}\) for all real \(x\), and that \(\left |\sin x - x\right |\leq \frac {|x|^3}{6}\).
Solution. Taylor’s Theorem for \(\cos \) at \(0\) with \(n = 3\) gives \[\cos x = 1 - \frac {x^2}{2} + \frac {\sin c}{6}x^3\] for some \(c\) between \(0\) and \(x\). If \(0<x\leq \pi \) then \(0<c<\pi \), so \(\sin c\geq 0\) and \(x^3>0\); the remainder is non-negative. If \(x>\pi \), then \(1 - \frac {x^2}{2}<1-\frac {\pi ^2}{2}<-1\leq \cos x\). The inequality is even in \(x\), so it holds for all \(x\).
For the sine, with \(n=3\), \(\sin x = x - \frac {\cos c}{6}x^3\), and \(|\cos c|\leq 1\) gives \(|\sin x - x|\leq \frac {|x|^3}{6}\). For instance, \(\sin (0.1)\) differs from \(0.1\) by less than \(0.000167\).
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.