Approximation. mmm. Way back in Calculus 1, we were finding linear approximations for a function near a point a. Well how did that go? Well it look like this, f was x is approximately f of a, right now linear approximation around the point a plus the derivative at a times how much the input has to change to go from a to x, so times x minus a. And why does this make sense? Well, the derivative is recording infinitesimally how the output changes as the input changes, so if I take the ratio of output change to input change and multiply by the input change. This is approximately the output change. Then I'm adding it to the output at the point a, and that'll give me about the value of the function at x. But let me put a little different spin on this. Instead of thinking about, you know, what the derivative means, the sub-ratio between output values and input values. Let's just think a little more naively, let's just think that I'm trying to write down a function which has the same value as my function f at the point a and which has the same derivative as my function f at the point a. We'll talk about this a little more precisely, let me give a name to this linear approximation. Let's call that g of x. So g of x will be f of a plus f prime of a times x minus a. Now, what do I know about this function g? Well, what's the value of g at a? Alright, what happens if I plug in a for x? Well then I've got a minus a. This is 0 in that case, so this whole term is 0. So g of a is just this, f of a. And what's the derivative of g at a? Well what's just the derivative of g? Alright. Well it's the derivative of this constant which is 0 plus the derivative of this. This is a constant so it's f prime of a times the derivative of this, but what's the derivative of this with respect to x? It's just 1. So the derivative of g regardless of what x is, is just the derivative of f at a. So look. The function g here is a function whose value at a is equal to the value of f at a and whose derivative at a is equal to the derivative of f at a. I can do better. So I'm going to define a new function. I'm also going to call it g. But it's going to be defined this way. So g of x will be defined as follows. G of x will be f of a plus the derivative of f at a times x minus a. So this is just the linear approximation to f at the point a, and I'm going to add an extra term. Plus, the second derivative of f at a divided by 2 times x minus a squared. Why is that a good idea? Well when I write it out like this, this new function g, has three really great properties. First of all, g at the point a is just equal to f of a. If I plug in an a for x, that kills this term, and this term. All that I'm left with is just f of a. Also, the derivative of g, at the point a, is equal to the derivative of f, at the point a. Now that would have been true even if I didn't have this extra term. But, by including this extra term, it also turns out that the second derivative of g at the point a is equal to the second derivative of f at the point a. Now, I mean actually, the second derivative of g at any point is equal to the second derivative of f at the point a. But in particular, this is true. So I've written down a function that not only has the same value as f does at a, not only has the same derivative as f does at a. But also has the same second derivative as f does at a. And, I can just keep on going. So, here we go. I'm going to define yet another function that I'll again call g of x. It's going to start out the exact same way. It's going to start out with f of a plus the derivative of f. At the point a times x minus a. So this is just the linear approximation to f that we're used to. Then, last time I added just one more term, I'm going to add that term again, the second derivative of f, at the point a divided by 2 times x minus a squared. But I'll add another term. I'm going to add this term. The third derivative of the function f at the point a divided by 6 times x minus a cubed. Now the idea here is that this function g is going to turn out to agree with the function f at the point a. It's also going to have the same derivative as the function f at the point a. It's also going to have the same second derivative as the function f at the point a, and it's going to have the same third derivative as the function f at the point a. Now to see this all I have to do is differentiate. Before I differentiate let me just point out that g of a is equal to what? Well if I plug in a for x, that kills this term, this term, and this term. These are all 0. So the only thing that's left is f of a. Now. Let's try differentiating. Let's differentiate this once. What's the derivative of g? Well the differentiate g is going to differentiate this. So the derivative of this constant is zero, the derivative of this constant times x minus a, well that's the constant f prime of a times the derivative of x minus a which is one. Plus what's the derivative of this term? Well that's this constant. F double prime of f at a divided by 2 times the derivative of x minus a squared, which is 2 times x minus a, times the derivative of the inside, which is just 1. Alright, and then I gotta add the derivative of this term. Well, that's this constant. F triple prime at the point a divided by 6 times the derivative of this. Which is 3 times x minus a squared times the derivative of the inside, which is just 1. And now, what happens if I plug in a. What is g prime at a? Well this term and this term both have an x minus a so they die the only thing that survives is this. So the derivative of the function g at the point a is the same as the derivative of the function f at the point a. Now what about the second derivative? I've just got to differentiate this again. So what's g double prime of x? Well I don't need to differentiate the zero, that's just zero, this is a constant so that's also zero. What's the derivative of this? Well it's this which is just f double prime of a, times the derivative of x minus a which is 1. And then what's the derivative of this? Well it's this constant which is f triple prime at a divided by 2, times the derivative of x minus a squared. Which is 2 times x minus a times the derivative of the inside, which is just 1. Now, what is this when I plug in a for x? All right, what's g double prime at the point a? Well, when I plug in a for x, that kills this term, and the only thing that survives is this. So the 2nd derivative of the function g at the point a is the same as the 2nd derivative of f at the point a. Now, what about the 3rd derivative? Well, then, I just gotta differentiate this. So, what's g triple prime at x? Well, it's 0 plus 0 plus the derivative of this constant is 0. Plus the derivative of this term. Well, that's this constant times the derivative of x minus a. Well, this constant is just f triple prime at a times the derivative of x minus a which is just one. So, the third derivative of g at the point a is equal to the third derivative of F at the point A. So this cubic polynomial not only matches the function's value, but it also matches the first, second and third derivative of the function f at the point a. Let me make this more concrete. Let me apply this to a specific function. Here's a specific example. Let's apply this to the function f of x equals sine x. I'm going to differentiate sine a bunch of times. So the derivative of sine is cosine. The second derivative of sine, the derivative of cosine, is minus sine, so that if we choke. What's the third derivative of sine, what's the derivative of minus sine, that's negative cosine x. Now let's evaluate those at zero. Well the function's value at zero and what's sine at zero, that's zero. What's the derivative at zero? What's co sin at zero, that's one. What's the second derivative at zero? Well, that's negative sine of zero, that's zero. What's the third derivative at zero? Well, that's negative cosine of zero, that's negative one. Now I've got all the pieces ready. I'm ready to write down a polynomial that has the same value, the same derivative, the same second derivative, and the same third derivative. As sine does at the point zero. Well in this case, g of x is what? Well if the function's value is zero, which is zero, plus the derivative of zero, which is one, times x minus a, which is just x plus the second derivative at 0, which is 0 divided by 2 times x minus a squared, plus the third derivative of the function at 0, which is negative 1, divided by 6 times x minus a cubed. And the a is 0 in this case, so just x cubed. I can simplify that a bit. We'll now just get zero, I don't have to write that down, x which is just zero minus x cubed over six. So there is my cubic polynomial. So this is pretty great. I've got this polynomial and it's supposed to be a pretty good approximation to sine. We'll let's take a look at a graph of sign just to get an idea just to get an idea of just how good an approximation this polynomial really is. Well, here's a graph of the function y equals sin of x. It has that familiar sinasoidal shape. Let me super impose on this, the graph of the cubic polynomial that we've been studying. Here's that that cubic polynomial. This thick, green curve is the graph of y equals x minus x cubed over six. And remember how I got this polynomial. This polynomial is rigged so that the value of this polynomial at zero is the same as the value of sine at zero. The derivative of this polynomial at zero is the same as the derivative of sine at zero. Same goes for the second derivative and the third derivative, right? If I differentiate this thing three times, I get the same thing as this, differentiated three times at zero. But it's interesting to note that even though I've rigged this polynomial only to match up with sine at zero at least in value for second or third derivative. This graph is sort of resembling sine. I mean, this green curve, especially around here, is a pretty good approximation to the graph of the sine function. I mean, it's obviously not great out here, but at least in here, it's looking pretty good. We can also look at this numerically. For example. Sine of a half a radion is approximately, to four decimal places, 0.4794, but what is this approximating function at one half? What's g of one half? Well, that's one half minus one half cubed over 6. Well that's one half minus what is this? That's one half to the third, that's an eighth or a sixth, that's one half minus a fourty-eighth. So instead of writing a half, I could write 24/48ths Minus a forty-eight. Well that's 23 forty-eights. Well what's 23 forty-eights? That's approximately 0.4792. That is awfully close to sine of one half. And whether we're thinking graphically or numerically, we're seeing something significant here. Well way back in calculus 1, we thought about approximating a function like this. These linear approximations, but now we getting the idea that it'd be even better. To approximate f not just by a degree 1 polynomial, but by a higher degree polynomial. And even better than polynomials are power series. Well, exactly. A power series is a lot like a polynomial that just keeps on going. So if a degree ten polynomial is doing better job than just a linear approximation, and if a degree of thousand polynomial would do an even better job, maybe the power series, if we just kept on going forever, we do such a good job that the function would actually be equal to some power series. That is a huge thing to hope for. But sometimes dreams come true. [SOUND]