1 00:00:00,758 --> 00:00:05,636 I've drawn an arbitrary function here and what we're going to do is try to approximate this arbitrary 2 00:00:05,636 --> 00:00:10,625 function, we don't know what it is. Using a polynomial will keep on adding terms to that polynomial. 3 00:00:10,733 --> 00:00:15,225 But to do this we're going to assume that we can evaluate the function at zero that it gives us some 4 00:00:15,302 --> 00:00:22,175 value and that we can keep taking the derivative of the function and evaluating the first, the second, 5 00:00:22,205 --> 00:00:28,538 the third derivatives, so on and so forth at zero as well. So we're assuming that we know what F(0) is, 6 00:00:28,600 --> 00:00:34,867 we're assuming we know what F'(0) is, we're assuming that the second derivative of it is zero, we're 7 00:00:34,882 --> 00:00:42,800 assuming that we know the third derivative at zero. I'll write the third derivative as f prime prime at zero 8 00:00:42,800 --> 00:00:49,667 so forth and so on. So let's think of how we can approximate this using polynomials of ever increasing 9 00:00:49,667 --> 00:00:55,600 length. So we could have a polynomial of just one term. And it would just be a constant term. So this 10 00:00:55,600 --> 00:01:01,400 would be a polynomial of degree zero. And if we have a constant term, we at least want to might make that 11 00:01:01,400 --> 00:01:10,067 polynomial, it's just really a constant function, equal the function at F(0). So, at first maybe we just 12 00:01:10,067 --> 00:01:19,133 want P(0) where P is the polynomial that we want to construct. We want P(0) to be equal F(0). 13 00:01:19,133 --> 00:01:30,667 If we want to do that we can just set P(x) is equal to F(0). 14 00:01:30,667 --> 00:01:37,133 So if I were to graph it it will look like this. It will be just a horizontal line at F(0). 15 00:01:37,133 --> 00:01:43,267 And you can say Sal, that is a horrible approximation it only approximate at the function at this point 16 00:01:43,267 --> 00:01:46,067 Looks like we got lucky at a couple of other points but its really bad everywhere else 17 00:01:46,067 --> 00:01:49,467 And I will try to tell you try to do any better using a horizontal line 18 00:01:49,467 --> 00:01:55,733 at least we got it right at F(0) and this is just as good as we can do with just a constant. 19 00:01:55,733 --> 00:02:02,600 And even though this might not look like a constant we are assuming that given the function 20 00:02:02,600 --> 00:02:06,667 we can evaluate it at zero and that will just give us the number. So whatever number that was 21 00:02:06,667 --> 00:02:11,067 we would put right over here. And we would say P(x) is equal to that number. It will just be a horizontal 22 00:02:11,067 --> 00:02:19,933 line right there at F(0). But that is obviously not so great so lets add some more constraints. 23 00:02:19,933 --> 00:02:32,000 Beyond the fact that we want p(0) to be equal to f(0) lets say that we want also want p'(0) = f'(0) 24 00:02:32,000 --> 00:02:40,067 Let me do this in a new color. So we also want, in the new color, we also want, thats not a new color. 25 00:02:40,067 --> 00:02:46,667 We also want p', we want the first derivative of our polynomial while evaluated at zero to be the same 26 00:02:46,667 --> 00:02:52,333 thing as the first derivative of the function when evaluated at zero. And we don't wanna lose this right 27 00:02:52,333 --> 00:03:03,067 over here. So what if, what if we set p(x) as being equal to f(0), so we are taking our p(x) so we are 28 00:03:03,067 --> 00:03:12,467 going to add another term so the derivatives match up. Plus f'(0) times x. So lets think about this a 29 00:03:12,467 --> 00:03:19,133 little bit, so if we use this as our new polynomial what happens? p(0) what is p(0)? p(0) is going to 30 00:03:19,133 --> 00:03:30,600 be equal to, you're going to have f(0) + whatever this f prime (0) times zero. If you put a zero in for 31 00:03:30,600 --> 00:03:36,333 x this term is going just to be zero. So you're going to be left with p(0) = f(0). That's cool ;) 32 00:03:36,333 --> 00:03:40,133 That's just as good as our first version. Now what's the derivative over here? 33 00:03:40,133 --> 00:03:48,467 So the derivative is p'(x) =, take the derivative of this, and this is just a constant so its 34 00:03:48,467 --> 00:03:53,733 derivative is zero. And the derivative of a coefficient times x is going to be the coefficient. 35 00:03:53,733 --> 00:04:04,000 So its going to be f'(0). So if you evaluate it at zero so p' of zero or the derivative 36 00:04:04,000 --> 00:04:07,267 of our polynomial evaluated at zero. I know its a little weird because we are not using 37 00:04:07,941 --> 00:04:12,918 you know, we're doing, oh, p'(x), f'(0), but just remember, what's the variable 38 00:04:12,918 --> 00:04:18,930 what's the constant, and hopefully it'll make sense. So this is, obviously, going to be f'(0). Its derivative 39 00:04:18,930 --> 00:04:23,463 is a constant value. This is a constant value right here. We're assuming we can take the derivative 40 00:04:23,463 --> 00:04:29,496 of our function and evaluate that thing at 0 to give a constant value. So, if p'(x) is equal 41 00:04:29,496 --> 00:04:35,028 to this constant value then, obviously, p'(x) evaluated at 0 is going to be that value. 42 00:04:35,028 --> 00:04:42,281 But what's cool about this right here, this polynomial that has a zero-degree term 43 00:04:42,281 --> 00:04:49,365 and a first-degree term, is now, this polynomial is equal to our function at x = 0 44 00:04:49,365 --> 00:04:56,496 and it also has the same first derivative. It also has the same slope at x = 0 ! 45 00:04:56,496 --> 00:05:02,467 So this thing will look, this new polynomial with two terms is getting a little bit better. 46 00:05:02,467 --> 00:05:05,115 It will look something like that. It will 47 00:05:05,115 --> 00:05:14,049 essentially have, it'll look like a tangent line at f(0), at x = 0. So, we're doing better, 48 00:05:14,049 --> 00:05:20,664 but still, not a super good approximation. It kind of is going in the same general direction 49 00:05:20,664 --> 00:05:24,631 as our function around 0, but maybe we can do better by making sure they have 50 00:05:24,631 --> 00:05:29,317 the same second derivative. And to try to have the same second derivative while 51 00:05:29,317 --> 00:05:35,964 still having the same first derivate and the same value at 0, let's try to do something interesting. 52 00:05:35,964 --> 00:05:44,520 Let's define p(x), let's make it clear, this was our first try. 53 00:05:44,520 --> 00:05:50,099 This is our second try, right over here, and I'm about to embark on our third try. 54 00:05:50,099 --> 00:05:54,296 So, in our third try, my goal is that the value of my polynomial is the same 55 00:05:54,296 --> 00:05:57,048 as the value of the function at 0, they have the same derivative at 0, 56 00:05:57,048 --> 00:06:02,413 and they also have the same second derivative at 0. So let's define my polynomial 57 00:06:02,413 --> 00:06:08,084 to be equal to, so I'm going to do the first two terms of these guys right over here. 58 00:06:08,084 --> 00:06:15,833 So it's going to be, f(0) plus f'(0) times x. 59 00:06:15,833 --> 00:06:18,848 So, exactly what we did here, but now let me add another term. 60 00:06:18,848 --> 00:06:25,187 I'll do the other term in another color. Plus, I'm going to be a one-half out here, 61 00:06:25,187 --> 00:06:28,187 and hopefully it might make sense why I'm about to do this. 62 00:06:28,187 --> 00:06:35,446 Plus one-half times f the second derivative of our function evaluated at 0 x squared. 63 00:06:35,446 --> 00:06:41,599 And when we evaluate the derivative of this, I think you'll see why this one-half is there. 64 00:06:41,599 --> 00:06:47,296 Because now, let's evaluate this and its derivatives at 0. So, if we evalute p(0), 65 00:06:47,296 --> 00:06:53,853 p(0) is going to be equal to what? Well, you have this constant term, 66 00:06:53,853 --> 00:06:57,166 if you evaluate it at 0, this x and this x^2 are both going to be 0, so 67 00:06:57,166 --> 00:07:01,532 those terms are going to go away. So p(0) is still equal to f(0). 68 00:07:01,532 --> 00:07:08,700 If you take the derivative of p(x), so let me take the derivative right here, I'll do it in yellow. 69 00:07:08,700 --> 00:07:13,584 So the derivative of my new p(x) is going to be equal to, so this term's going to go away, 70 00:07:13,584 --> 00:07:18,748 it's a constant term, it's going to be equal to f'(0), that's the coefficient on this, 71 00:07:18,748 --> 00:07:24,198 plus, this is the power rule right here, two times one-half 72 00:07:24,198 --> 00:07:33,283 is just one, plus f''(0) times x. Take the two, multiply it by one-half, and decrement that two right 73 00:07:33,283 --> 00:07:37,650 there. And I think you now have a sense of why we put the one-half there. 74 00:07:37,650 --> 00:07:44,433 it's making it so that we don't end up with a two coefficient out front. 75 00:07:44,433 --> 00:07:50,588 Now, what is p'(0)? p'(0) is what? 76 00:07:50,588 --> 00:07:55,847 Well, this term right here is going to be 0, so you're left with this constant value right here. 77 00:07:55,847 --> 00:08:02,932 So it's going to be f'(0). So, so far our third generation polynomial has all the properties 78 00:08:02,932 --> 00:08:06,437 of the first two. And let's see how it does on its third derivative. 79 00:08:06,945 --> 00:08:13,429 So, let's see, I should say, the second derivative. p''(x) is equal to, 80 00:08:13,429 --> 00:08:17,160 this is a constant, so it's derivative is 0, so then you just take the coefficient 81 00:08:17,160 --> 00:08:24,028 on this second term, is equal to f''(0). So what's the second derivative of p 82 00:08:24,228 --> 00:08:29,978 evaluated at 0? Well, it's just going to be this constant value, f''(0). 83 00:08:29,978 --> 00:08:38,345 So notice, by adding this term, not only is the polynomial value the same thing as our 84 00:08:38,345 --> 00:08:43,174 function value at 0, its derivative at 0 is the same thing as the derivative of our function at 0, 85 00:08:43,174 --> 00:08:48,026 and its second derivative at 0 is the same thing as the second derivative of the function at 0. 86 00:08:48,026 --> 00:08:54,508 And you might guess there's a pattern here – every term we add it'll allow us 87 00:08:54,508 --> 00:09:02,493 to set up the situation so that the nth derivative of our approximation at 0 will be the same thing 88 00:09:02,493 --> 00:09:07,378 as the nth derivative of our function at 0. So, in general, if we wanted to keep doing this, 89 00:09:07,440 --> 00:09:16,519 if we wanted to keep adding terms to our polynomial, we could, let me do this in a new color, 90 00:09:16,519 --> 00:09:24,587 we could make our polynomial approximation, so the first term will just be f(0), 91 00:09:24,587 --> 00:09:40,804 and the next term will be f'(0) times x. Then the next term will be f''() times one-half times x^2. 92 00:09:40,804 --> 00:09:47,086 Then the next term, if we want to make their third derivatives the same at 0, would be 93 00:09:47,224 --> 00:09:57,087 f'''(0), the third derivative of the function at 0, times one-half times one-third times x^3. 94 00:10:00,672 --> 00:10:04,243 And we can keep going, maybe you'll start to see a pattern here. 95 00:10:04,351 --> 00:10:09,773 Plus, if we want to make their fourth derivatives at 0 coincide, it would be 96 00:10:09,820 --> 00:10:17,468 the fourth derivative of the function, it's the fourth derivative at 0 times 97 00:10:17,468 --> 00:10:30,373 one over four times three times two, times x^4. And you can verify for yourself, 98 00:10:30,373 --> 00:10:34,845 If we had this only, and if you were to take the fourth derivative of this at 0, 99 00:10:34,845 --> 00:10:39,782 it would be the same thing as the fourth derivative of the function at 0. 100 00:10:39,782 --> 00:10:45,055 And in general, you can keep adding terms, where the nth term will look this: 101 00:10:45,055 --> 00:10:56,000 The nth derivative of your function evaluated at 0, times x^n over n factorial. 102 00:10:56,031 --> 00:11:05,193 Notice, this is the same thing as four factorial - four factorial is 432*1. 103 00:11:06,163 --> 00:11:17,621 This, right here, is three factorial, 321, this right here is two factorial, 2*1. 104 00:11:17,621 --> 00:11:23,511 This is the same thing as one factorial, the same thing as one. 105 00:11:23,511 --> 00:11:29,110 And you could divide this by zero factorial, which also happens to be one, 106 00:11:29,110 --> 00:11:35,553 but this general series, that I've kind of set up right here, is called the Maclaurin series. 107 00:11:37,753 --> 00:11:43,335 And you can approximate a polynomial and we'll see some pretty powerful results later on. 108 00:11:43,335 --> 00:11:47,788 But, what happens, and I don't have the computing power in my brain to draw the graph properly, 109 00:11:47,788 --> 00:11:53,366 when only the function is equal, you get that horizontal line. When you make the functions 110 00:11:53,366 --> 00:12:00,032 and, when you make the function equal at 0, and their first derivatives equal at 0, then you have 111 00:12:00,032 --> 00:12:04,619 something that looks like the tangent line. When you add another degree, it might approximate 112 00:12:04,619 --> 00:12:11,145 the polynomial something like this. When you add another degree, it might look something like that. 113 00:12:11,191 --> 00:12:18,300 And, as you keep adding more and more terms, it gets closer and closer around, especially 114 00:12:18,300 --> 00:12:25,377 as you get close to x = 0, but in theory, if you add an infinite number of terms, 115 00:12:25,454 --> 00:12:30,954 I haven't proven this to you, so that's why I'm saying it's in theory, but if you add an infinite 116 00:12:30,954 --> 00:12:34,979 number of terms, it should be, all of the derivatives should be the same, and then 117 00:12:34,979 --> 00:12:38,935 the functions should pretty much look like each other. 118 00:12:38,935 --> 00:12:44,208 In the next video, I'll do this with some actual functions, just so it makes a little more sense. 119 00:12:44,208 --> 00:12:49,667 And, just so you know, the Maclaurin series is a special case of the Taylor series, since we're 120 00:12:49,683 --> 00:12:53,969 centering it at 0. And when you're doing a Taylor series, you can pick any center point, 121 00:12:53,969 --> 99:59:59,999 but we'll focus on the Maclaurin right now.