Welcome to Lab 6 of Math 101, Sections 203, 204, 207 and 209
Instructions
Warning!
If you leave this page or reload it, your work will be lost. Always save your work before leaving or reloading.
You can't really do that many different kinds of numerical computations. In grade one, you learned how to add and subtract and in grade three how to multiply and divide. Since then, you really haven't learned much new. The reason why is that pretty much all numerical operations can be derived from these simple four. Even computers don't do much more than this. So how do we perform computations involving functions like sin, cos, and tan? In this lab we are going to investigate how to approximate functions like these using polynomial functions. Remember that polynomials are functions made by adding, subtracting, and multiplying numbers, all computations you could do by hand if you had to.
|
Suppose we have a function f(x) that we want to approximate with some other function g(x) near x = 0. By approximate we mean that if x is close to 0, then g(x) is close to f(x). A good first step is to make sure that g(0) = f(0). But what more can we do? To the right is a plot of the graph of two functions: f(x) in blue, and g(x) in red. Near the origin they are close to each other in value, but they look less alike further from the origin. So g(x) is an approximation for f(x). Naturally, g(0)=f(0). But by looking at the difference of these two functions we can see something else. |
|
Which of the following graphs is a plot of the difference f(x) - g(x)?
a) b) c) d) e)
Notice that near the origin, the graph of the difference is "flat". This property is important because it tells us something about the derivative of the difference, namely that
In fact, it would be reasonable to think that the flatter the difference is at 0, the better the approximation is near 0.
|
Since we would like to make the difference as flat as possible, we should think about what makes a function flat. In the diagram to the left the functions xn are plotted. You can increase the value of n. Notice that when you do this, the function gets flatter at the origin. The increasing flatness of these functions is related to their derivatives. The first derivative of x2 (at the orgin) is 0, but its second derivative is not. On, the other hand, x3 is flatter, and both its first and second derivatives are 0 at the orgin. The general idea is that a function with its first several derivatives equal to zero is pretty flat, and the more derivatives equal to zero, the flatter it gets. Now suppose we wanted to approximate the function
|
Which of the following quadratic polynomials provides the best approximation toat x = 0 in the sense that the graph of
is flattest at the origin?
a) x2 b) 1 + x + x2 c) 1 + x + x2/2 d) 1 - x - x2 e) 1 - x - x2/2
Remember that a polynomial of degree n can be written as a sum
.The derivative of p(x) is a polynomial of degree n - 1,
.Substituting x = 0 into p(x) we see that p(0) = c0. Substituting x = 0 into p'(x), we see that p'(0) = c1. Notice that p(0) is related to c0 and p'(0) is related to c1. This connection is true also for larger derivatives.
If p(x) is written as in the previous paragraph, what is p''(0)?
a) c2 b) c1 c) 2c2 d) c1+c2 e) c0
In general, the kth derivative of p(x) at x = 0 (which we will write as p(k)(0)) is given by
.The factor at the front of ck appears so often that we give it a name
k!,which we pronounce "kay factorial". Suppose we want to approximate the function f(x) near x = 0 with a polynomial p(x). Then we want p(0) = f(0), p'(0) = f'(0), and so on. Since p(k)(0)= k!ck, if we want p(k)(0)= f(k)(0), then we get the formula k! ck = f(k)(0). In other words
.This is a pretty handy formula. A polynomial of degree n with these coefficients is called "the nth Taylor polynomial of f at 0". This polynomial can be written
.|
In the diagram to the right you see the plot of
,which we call the Taylor series of f at x = 0. |
The remarkable fact is that for smooth functions, there is a region near 0 such that
for all x in that region. Of course, since we can't add infinitely many terms, we never use a Taylor series for computations (we use Taylor polynomials instead). But it is useful to have the concept of this infinite series.
Now that we know what a Taylor series is, we are going to look at a way to use differential equations to quickly find the coefficients of a Taylor polynomial.
Suppose we want to find a series for cos(x). We know that the derivative of cos(x) is -sin(x), and the second derivative is -cos(x). So, cos(x) is a solution of the differential equation
Now suppose that cos(x) has a Taylor series
.What do you think the "derivative" of this series is? The natural guess is that you differentiate each term of the series, just like you do for polynomials. This intuition is mostly correct, although you have to approach the problem from another angle to show that this is true. Using this fact, however, we can show that
.by "differentiating" the series twice. So now we have two series for cos(x):
.We would expect that the terms of these series are the same. This means cm= -(m+1)(m+2)cm+2, or better yet
.We can use this formula to find the coefficients of the series. For example, since c0 = cos(0) = 1, we know c2 = -c0/(0+1)(0+2) = -1/2. And now that we know c2, we can easily find c4.
In the diagram below you see on the left a graph of cos(x). In the boxes above the graph you can enter the coefficients of a polynomial, which will also be plotted on the left. On the right you see the difference of the two functions.Use the formula given above for cm+2 to find the coefficients of the Taylor polynomial of degree 8 of cos(x) at 0. Enter the coefficients into the appropriate boxes below. In each box you can enter a number, like 1.3, or a fraction of two numbers, such as -1/4. (The box will turn red if you have entered in something it doesn't understand, like 4*3).
Notice when you are done that the plot on the right is very flat near the origin, just as we discussed at the beginning of the lab.
You have now completed the lab and you may save your work. If technical problems prevent your answers from being saved, you will receive a message telling you so. In that case, you will either have to submit your work from the Math labs or try again from some other place. We will NOT accept your answers by e-mail.