1.1. The Taylor Series#
The Taylor series is an infinite sum of terms where each term is a derivative of the function evaluated at a specific point. Named after English mathematician Brook Taylor the Taylor series expansion of the function \(f(t)\) at the point \(a\) is
where \(f^{(n)}(t)\) denotes the \(n\)-th derivative of \(f(t)\). If we replace \(a\) with \(t\) and \(t\) with \(t+h\) then we can write the Taylor series as
In this form the Taylor series can be used to derive numerical methods for solving differential equations. From now on we shall be referring to this form as the Taylor series.
(The Taylor series)
If \(f(t)\) is a differentiable function of the variable \(t\) then the Taylor series expansion of \(f(t+h)\) where \(h\) is some scalar value is
We can use equation (1.2) to calculate the value of \(f(t+h)\). However, we cannot sum an infinite number of terms so instead we only consider the first few terms. For example, if we include the terms up to and including the \(n\)-th derivative term then
Since we are omitting the higher order terms in the truncation of the Taylor series we only have an approximation of \(f(t+h)\). When we omit the Higher-Order Terms (HOT) from the Taylor series we say we have truncated the Taylor series. So if we omit all terms higher than fourth-order we have say that we have the fourth-order Taylor series expansion of \(f(t+h)\) which is
For example lets use the first, second, third and fourth-order Taylor series expansions to approximate the value of \(\cos(1+h)\) where \(h=0.1\). Here \(f(t) = \cos(t)\) so the derivatives of \(f(t)\) are
then the fourth-order Taylor series expansions of \(\cos(t+h)\) is
Substituting \(t=1\) and \(h=0.1\) and truncating the Taylor series expansion to the first-order term then
The exact value is \(\cos(1.1) = 0.453596\) (correct to 6 decimal places) so the error in the first-order Taylor series approximation is \(|0.456155 - 0.453596| = 0.002559\). Doing similar for the second, third and fourth-order Taylor series gives
The Taylor series approximations of \(\cos(1.1) = 0.453596\ldots\) and the corresponding errors for the first, second, third and fourth order Taylor series expansions is shown in Table 1.1. Note that as we include more terms in the Taylor series expansion the error tends to zero.
Order |
Approximation |
Error |
---|---|---|
first |
0.456155 |
2.56e-03 |
second |
0.453454 |
1.42e-04 |
third |
0.453594 |
2.18e-06 |
fourth |
0.453596 |
7.09e-08 |