Consider a function and a point . The derivative, , gives the instantaneous rate of change of at . Of all lines that pass through the point , the line that best approximates at this point is the tangent line; that is, the line whose slope (rate of change) is .
In Figure 9.7.2, we see a function graphed. The table in Figure 9.7.3 shows that and ; therefore, the tangent line to at is . The tangent line is also given in the figure. Note that “near” ,; that is, the tangent line approximates well.
The image shows the graph of a function and its tangent line at . The precise features of the graph of are unimportant for this illustration. What is relevant is that points on the tangent line, which is the graph of a linear function labeled as , are close to the corresponding points on the graph of , near the point . In other words, the image illustrates the fact that when is close to zero, the value of is close to the value of .
Figure9.7.2.A graph of and its tangent line at
Figure9.7.3.Derivatives of evaluated at
One shortcoming of this approximation is that the tangent line only matches the slope of ; it does not, for instance, match the concavity of . We can find a polynomial, , that does match the concavity near without much difficulty, though. The table in Figure 9.7.3 gives the following information:
This is simply an initial-value problem. We can solve this using the techniques first described in Section 5.1. To keep as simple as possible, we’ll assume that not only , but that . That is, the second derivative of is constant, meaning is a quadratic function.
If , then for some constant . Since we have determined that , we find that and so . Finally, we can compute . Using our initial values, we know so . We conclude that . This function is plotted with in Figure 9.7.4.
We can repeat this approximation process by creating polynomials of higher degree that match more of the derivatives of at . In general, a polynomial of degree can be created to match the first derivatives of .Figure 9.7.4 shows , whose first four derivatives at 0 match those of . (Using the table in Figure 9.7.3, start with and solve the related initial-value problem.)
The graph of a function is shown. It is the same function as the first image in this section, but again, the precise details of the graph are unimportant.
Also shown are the graphs of two functions and . The function is quadratic, and its graph is a parabola that opens upward. The function is a polynomial of degree 4.
All three graphs intersect at the point , and the values of both and are close to the value of when is close to . Two observations are important: first, both of these polynomial graphs appear to lie more closely to the graph of than the tangent line in the first image. Second, the graph of is a good approximation to over a larger interval than the graph of .
In particular, the point appears to be a local minimum, and there is a corresponding minimum in the graphs of both and . But the graph of also appears to have a local maximum near . Near , the graph of separates from that of : the first continues to increase, while the second begins to decrease. Near , is no longer a good approximation to .
However, the graph of also has a maximum near , and appears to be a good approximation to at least until .
As we use more and more derivatives, our polynomial approximation to gets better and better. In this example, the interval on which the approximation is “good” gets bigger and bigger. Figure 9.7.6 shows ; we can visually affirm that this polynomial approximates very well on . The polynomial is not particularly “nice”. It is
The graph of a function is shown. It is the same function as in the previous two images. Also shown is the graph of a degree 13 polynomial . We can see that the values of and are very close over an interval from to . For , the graph of appears to approach a horizontal asymptote, while the graph of approaches , so it ceases to be a good approximation to at this point.
The polynomials we have created are examples of Taylor polynomials, named after the British mathematician Brook Taylor who made important discoveries about such functions. While we created the above Taylor polynomials by solving initial-value problems, it can be shown that Taylor polynomials follow a general pattern that make their formation much more direct. This is described in the following definition.
We start with creating a table of the derivatives of evaluated at . In this particular case, this is relatively simple, as shown in Figure 9.7.10.
Figure9.7.10.The derivatives of evaluated at
By the definition of the Maclaurin polynomial, we have
.
Using our answer from part 1, we have
.
To approximate the value of , note that . It is very straightforward to evaluate :
.
A plot of and is given in Figure 9.7.11. To decimal places, the actual value of is . So this approximation agrees to two decimal places.
The graph of is shown on the interval . Also shown is the graph of , the degree 5 Maclaurin polynomial of . For , there is very little visible difference between the two graphs. Near we can see that the two graphs begin to separate.
Figure9.7.11.A plot of and its 5 degree Maclaurin polynomial
We begin by creating a table of derivatives of evaluated at . While this is not as straightforward as it was in the previous example, a pattern does emerge (for ), as shown in Figure 9.7.13. Notice in the table below that each time we take a derivative (starting at the second derivative), we apply the power rule and “bring down” the exponent to multiply by the previous coefficent. So the in the derivative is actually .
Figure9.7.13.Derivatives of evaluated at
Notice that the coefficients alternate in sign starting at . Using Definition 9.7.7, we have
.
Note how the coefficients of the terms turn out to be “nice.”
We can compute using our work above:
.
Since approximates well near , we approximate :
.
This is a good approximation as a calculator shows that .Figure 9.7.14 below plots with . We can see that .
We approximate with :
.
This approximation is not terribly impressive: a hand held calculator shows that . The graph in Figure 9.7.14 shows that provides less accurate approximations of as gets close to 0 or 2. Surprisingly enough, even the th degree Taylor polynomial fails to approximate for very well, as shown in Figure 9.7.15. We’ll soon discuss why this is.
The graph of is shown on the interval . Also shown is the graph of , the degree 6 Taylor polynomial of , centered at . The graph of is very close to the graph of on the interval , but does not approximate the logarithm very well outside of this interval.
Figure9.7.14.A plot of and its 6th degree Taylor polynomial at
The graph is shown again, this time with the degree 20 Taylor polynomial of , centered at . Unlike with the example involving , increasing the degree of the Taylor polynomial did not do much to improve how well it approximates the logarithm. The approximation appears to be accurate over a slightly larger interval than the degree 6 approximation, but there is not a significant difference between the two images.
Figure9.7.15.A plot of and its 20 degree Taylor polynomial at
When is known, but perhaps “hard” to compute directly. For instance, we can define the cosine of an angle as either the ratio of sides of a right triangle (“adjacent over hypotenuse”) or using the definition in terms of the unit circle. However, neither of these provides a convenient way of computing . A Taylor polynomial of sufficiently high degree can provide a reasonable method of computing such values using only operations usually hard-wired into a computer (,,× and ).
When is not known, but information about its derivatives is known. This occurs more often than one might think, especially in the study of differential equations.
In both situations, a critical piece of information to have is “How good is my approximation?” If we use a Taylor polynomial to compute , how do we know how accurate the approximation is?
We had the same problem when studying Numerical Integration. Theorem 5.5.24 provided bounds on the error when using, say, Simpson’s Rule to approximate a definite integral. These bounds allowed us to determine that, for instance, using subintervals provided an approximation within of the exact value. The following theorem gives similar bounds for Taylor (and hence Maclaurin) polynomials.
The first part of Taylor’s Theorem states that , where is the th order Taylor polynomial and is the remainder, or error, in the Taylor approximation. The second part gives bounds on how big that error can be. If the th derivative is large on , the error may be large; if is far from , the error may also be large. However, the term in the denominator tends to ensure that the error gets smaller as increases.
We start with the approximation of with . The theorem references an open interval that contains both and . The smaller the interval we use the better; it will give us a more accurate (and smaller!) approximation of the error. We let , as this interval contains both and . The theorem references . In our situation, this is asking “How big can the th derivative of be on the interval ?” The seventh derivative is . The largest absolute value it attains on is about 1506. (There are no critical numbers of in the interval so we evaluate the endpoints: and .) In particular, we are evaluating at , so we let . Thus we can bound the error as:
.
We computed ; using a calculator, we find , so the actual error is about , which is less than our bound of . This affirms Taylor’s Theorem; the theorem states that our approximation would be within about 2 thousandths of the actual value, whereas the approximation was actually closer. Taylor’s Theorem only gives an upper bound on the error.
We again find an interval that contains both and ; we choose . The maximum value of the seventh derivative of on this interval is again about 1506 (as the largest values come near ). Thus
.
This bound is not as nearly as good as before. Using the degree 6 Taylor polynomial at will bring us within 0.3 of the correct answer. As , our error estimate guarantees that the actual value of is somewhere between and . These bounds are not particularly useful. In reality, our approximation was only off by about 0.07. However, we are approximating ostensibly because we do not know the real answer. In order to be assured that we have a good approximation, we would have to resort to using a polynomial of higher degree.
Following Taylor’s theorem, we need bounds on the size of the derivatives of . In the case of this trigonometric function, this is easy. All derivatives of cosine are or . In all cases, these functions are never greater than 1 in absolute value. We want the error to be less than . To find the appropriate , consider the following inequalities:
.
We find an that satisfies this last inequality with trial-and-error. When , we have ; when , we have . Thus we want to approximate with .
We now set out to compute . We again need a table of the derivatives of evaluated at . A table of these values is given in Figure 9.7.20.
Figure9.7.20.A table of the derivatives of evaluated at
Notice how the derivatives, evaluated at , follow a certain pattern. All the odd powers of in the Taylor polynomial will disappear as their coefficient is . While our error bounds state that we need , our work shows that this will be the same as .
Since we are forming our polynomial at , we are creating a Maclaurin polynomial, and:
.
We finally approximate :
.
Our error bound guarantee that this approximation is within of the correct answer. Technology shows us that our approximation is actually within about of the correct answer.
Figure 9.7.21 shows a graph of and . Note how well the two functions agree on about .
The graph is given on the interval , along with the graph of , the degree 8 Maclaurin polynomial approximation of .
The image illustrates how well the Maclaurin polynomials approximate the cosine function. With a degree 8 polynomial, there is little to no visible difference between the graphs over the interval .
Figure9.7.21.A graph of and its degree 8 Maclaurin polynomial
We begin by evaluating the derivatives of at . This is done in Figure 9.7.23.
Figure9.7.23.A table of the derivatives of evaluated at
These values allow us to form the Taylor polynomial :
.
As near , we approximate with .
To find a bound on the error, we need an open interval that contains and . We set . The largest value the fifth derivative of takes on this interval is near , at about . (We often graph the derivative to find its extrema. In this case is is always decreasing, so the maximum occurs at .) Thus
.
This shows our approximation is accurate to at least the first 2 places after the decimal. (It turns out that our approximation is actually accurate to 4 places after the decimal.) A graph of and is given in Figure 9.7.24. Note how the two functions are nearly indistinguishable on .
The graph is shown, for in the interval . Also shown is the degree 4 Taylor polynomial , centered at . The Taylor polynomial appears to approximate very well over the interval .
Figure9.7.24.A graph of and its degree 4 Taylor polynomial at
One might initially think that not enough information is given to find . However, note how the second fact above actually lets us know what is:
.
Since , we conclude that .
Now we find information about . Starting with , take derivatives of both sides, with respect to . That means we must use implicit differentiation.
Now evaluate both sides at :
.
We repeat this once more to find . We again use implicit differentiation; this time the Product Rule is also required.
Now evaluate both sides at :
.
In summary, we have:
.
We can now form :
.
It turns out that the differential equation we started with, , where , can be solved without too much difficulty:
.
Figure 9.7.26 shows this function plotted with . Note how similar they are near .
The graph is shown, for from to about . Also shown is the graph of , the Maclaurin polynomial obtained as an approximate solution to the differential equation in this example. As expected, the polynomial is a good approximation to the exact solution when is close to .
It is beyond the scope of this text to pursue error analysis when using Taylor polynomials to approximate solutions to differential equations. This topic is often broached in introductory Differential Equations courses and usually covered in depth in Numerical Analysis courses. Such an analysis is very important; one needs to know how good their approximation is. We explored this example simply to demonstrate the usefulness of Taylor polynomials.
Most of this chapter has been devoted to the study of infinite series. This section has taken a step back from this study, focusing instead on finite summation of terms. In the next section, we explore Taylor Series, where we represent a function with an infinite series.