Subsection 3.4.5 Still Better Approximations — Taylor Polynomials
¶We can use the same strategy to generate still better approximations by polynomials 8 of any degree we like. As was the case with the approximations above, we determine the coefficients of the polynomial by requiring, that at the point \(x=a\text{,}\) the approximation and its first \(n\) derivatives agree with those of the original function.
Rather than simply moving to a cubic polynomial, let us try to write things in a more general way. We will consider approximating the function \(f(x)\) using a polynomial, \(T_n(x)\text{,}\) of degree \(n\) — where \(n\) is a non-negative integer. As we discussed above, the algebra is easier if we write
\begin{align*}
T_n(x) &= c_0 + c_1(x-a) + c_2 (x-a)^2 + \cdots + c_n (x-a)^n\\
&= \sum_{k=0}^n c_k (x-a)^k & \text{using } \Sigma \text{ notation}
\end{align*}
The above form 9 10 makes it very easy to evaluate this polynomial and its derivatives at \(x=a\text{.}\) Before we proceed, we remind the reader of some notation (see Notation 2.2.8):
Additionally we will need
Definition 3.4.9 Factorial
Let \(n\) be a positive integer 11 , then \(n\)-factorial, denoted \(n!\text{,}\) is the product
\begin{align*}
n! &= n \times (n-1) \times \cdots \times 3 \times 2 \times 1
\end{align*}
Further, we use the convention that
\begin{align*}
0! &= 1
\end{align*}
The first few factorials are
\begin{align*}
1! &=1 &
2! &=2 &
3! &=6\\
4! &=24 &
5! &=120 &
6! &=720
\end{align*}
Now consider \(T_n(x)\) and its derivatives:
\begin{alignat*}{4}
T_n(x) &=& c_0 &+ c_1(x-a) & + c_2 (x-a)^2 & + c_3(x-a)^3 &+ \cdots+ & c_n (x-a)^n\\
T_n'(x) &=& &c_1 & + 2 c_2 (x-a) & + 3c_3(x-a)^2 &+ \cdots +& n c_n (x-a)^{n-1}\\
T_n''(x) &=& & & 2 c_2 & + 6c_3(x-a) &+ \cdots +& n(n-1) c_n (x-a)^{n-2}\\
T_n'''(x) &=& & & & 6c_3 &+ \cdots + & n(n-1)(n-2) c_n (x-a)^{n-3}\\
& \vdots\\
T_n^{(n)}(x) &=& & & & & & n! \cdot c_n
\end{alignat*}
Now notice that when we substitute \(x=a\) into the above expressions only the constant terms survive and we get
\begin{align*}
T_n(a) &= c_0\\
T_n'(a) &= c_1\\
T_n''(a) &= 2\cdot c_2\\
T_n'''(a) &= 6 \cdot c_3\\
&\vdots\\
T_n^{(n)}(a) &= n! \cdot c_n
\end{align*}
So now if we want to set the coefficients of \(T_n(x)\) so that it agrees with \(f(x)\) at \(x=a\) then we need
\begin{align*}
T_n(a) &= c_0 = f(a) & c_0 &= f(a) = \frac{1}{0!} f(a)\\
\end{align*}
We also want the first \(n\) derivatives of \(T_n(x)\) to agree with the derivatives of \(f(x)\) at \(x=a\text{,}\) so
\begin{align*}
T_n'(a) &= c_1 = f'(a) & c_1 &= f'(a) = \frac{1}{1!} f'(a)\\
T_n''(a) &= 2\cdot c_2 = f''(a) & c_2 &= \frac{1}{2} f''(a) = \frac{1}{2!}f''(a)\\
T_n'''(a) &= 6\cdot c_3 = f'''(a) & c_3 &= \frac{1}{6} f'''(a) = \frac{1}{3!} f'''(a)\\
\end{align*}
More generally, making the \(k^\mathrm{th}\) derivatives agree at \(x=a\) requires :
\begin{align*}
T_n^{(k)}(a) &= k!\cdot c_k = f^{(k)}(a) & c_k &= \frac{1}{k!} f^{(k)}(a)\\
\end{align*}
And finally the \(n^\mathrm{th}\) derivative:
\begin{align*}
T_n^{(n)}(a) &= n!\cdot c_n = f^{(n)}(a) & c_n &= \frac{1}{n!} f^{(n)}(a)
\end{align*}
Putting this all together we have
Equation 3.4.10 Taylor polynomial
\begin{align*}
f(x) \approx T_n(x)
&= f(a) + f'(a) (x-a) + \frac{1}{2} f''(a) \cdot(x-a)^2 + \cdots \\
\amp\hskip2in+ \frac{1}{n!}f^{(n)}(a) \cdot (x-a)^n\\
&= \sum_{k=0}^n \frac{1}{k!} f^{(k)}(a) \cdot (x-a)^k
\end{align*}
Let us formalise this definition.
Definition 3.4.11 Taylor polynomial
Let \(a\) be a constant and let \(n\) be a non-negative integer. The \(n^\mathrm{th}\) degree Taylor polynomial for \(f(x)\) about \(x=a\) is
\begin{align*}
T_n(x) &= \sum_{k=0}^n \frac{1}{k!} f^{(k)}(a) \cdot (x-a)^k.
\end{align*}
The special case \(a=0\) is called a Maclaurin 12 polynomial.
Before we proceed with some examples, a couple of remarks are in order.