Definition: The degree n Taylor polynomial of the function f at the point x = a is
Here we have defined a function t(n, z) of two variables, and n is the degree of the polynomial.
You can use the applet above to see the values of other polynomials.
Try it yourself ...
- Click the mouse on the 5 in the t(5, 0.1) above. A box with a blinking cursor should appear around the 5. Use the right arrow, if necessary, to put the cursor to the right of the 5, then backspace to delete the 5 and type 7. Now reevaluate the function by typing <ctrl> z. (If the box is around more than just the 5, then use the up, right and left arrow keys to "navigate" in the formula until only the 5 is boxed.)
- If you evaluate the degree 9 polynomial you will get the same value that is reported for sin(0.1). These two values are not actually equal, but when rounded to 15 decimal places, they agree.
- Question: Why did I use only odd degrees? Try evaluating t(4, 0.1) and compare with t(3, 0.1).
Now we will take a closer look at the polynomials. In the applet below I defined a vector v with 8 components. Initially each component is set equal to 0. Next I set the kth component of v equal to the kth derivative of f. Notice the pattern. Finally, I redefined the components of v to be the derivatives evaluated at x = 0. Now you see why I used only odd degree polynomials. The even degree terms have coefficient 0.
So far we have compared sin(x) and it's Taylor polynomials only at x = 0.1. What happens with other values of x?
Try it yourself ...
- Go back and replace 0.1 with 1 and reevaluate the functions with <ctrl> z.
- At x = 1, the degree 9 Taylor polynomial agrees with sin to only 5 decimal places.
- Try x = 2, and you will see that the degree 9 polynomial is not even close to sin(2).
The Taylor polynomials at x = a can effectively approximate a function for values of x that are near a. In our example, a is 0, and the Taylor polynomials are very close to sin at x = 0.1, but very far off at x = 2.
Looking at the graphs will help to illustrate this point.
Here I have defined a polynomial taylor of just one variable. The n that appears in the formula for taylor is the degree of the polynomial (when n is odd), and it is initially set equal to 3.
The graph shows the the sine function f and the degree 3 taylor polynomial of f at 0.
Clearly, taylor is quite close to f near zero. However, away from 0 the values of the polynomial and f are not close.
You can use the applet to change the value of n and then graph the new polynomial.
Try it yourself ...
- Click on the 3 to select that node of the formula. As before, use the arrow keys as necessary to box only the 3 and position the cursor to the right of the 3. Now backspace and replace the 3 with a 5. You must reevaluate the n formula by typing <ctrl> z. After you do so, the formula will be n:=5=5. This is the applet's way of indicating that it has registered the new value of n.
- You do not need to reevaluate the formula for taylor. Click the update button to the right of the graph to show the new polynomial.
- You can drag the mouse in the graph window to change the view. Either right-click in the graph window, or click the window button to get zoom options.
- Question: What does the degree one Taylor polynomial look like?