1 00:00:00,000 --> 00:00:00,670 2 00:00:00,670 --> 00:00:02,799 Let's say I have this bizarre-looking function. 3 00:00:02,799 --> 00:00:04,599 It's just some arbitrary function. 4 00:00:04,599 --> 00:00:06,969 And we'll call that f of x. 5 00:00:06,969 --> 00:00:09,879 So this function right there is f of x. 6 00:00:09,880 --> 00:00:11,780 And what we're going to do in this video is, it's not an 7 00:00:11,779 --> 00:00:13,699 experiment, but we're going to play around a little bit, and 8 00:00:13,699 --> 00:00:15,919 we're going to try to approximate this function 9 00:00:15,919 --> 00:00:18,719 using a polynomial with some coefficients. 10 00:00:18,719 --> 00:00:20,839 And this polynomial we're going to do, we're going to keep 11 00:00:20,839 --> 00:00:23,670 adding terms to the polynomial, so that we can better and 12 00:00:23,670 --> 00:00:25,380 better approximate this function. 13 00:00:25,379 --> 00:00:26,890 And that's actually called a power series. 14 00:00:26,890 --> 00:00:29,060 And we'll do more about that later, but we're going to 15 00:00:29,059 --> 00:00:32,359 specifically try, in this case, to approximate the function 16 00:00:32,359 --> 00:00:34,320 around x is equal to 0. 17 00:00:34,320 --> 00:00:36,490 So around this point. 18 00:00:36,490 --> 00:00:40,020 So the easiest way to approximate it is to say, well, 19 00:00:40,020 --> 00:00:43,000 the simplest polynomial is just a constant, right? 20 00:00:43,000 --> 00:00:44,590 Let's say this is my polynomial, let me call 21 00:00:44,590 --> 00:00:47,100 my polynomial p of x. 22 00:00:47,100 --> 00:00:49,320 The simplest polynomial is just a constant, and it would just 23 00:00:49,320 --> 00:00:51,280 be a horizontal line someplace. 24 00:00:51,280 --> 00:00:54,310 So if I just wanted this one term polynomial, what would be 25 00:00:54,310 --> 00:00:57,300 my best approximation for this function, at least 26 00:00:57,299 --> 00:00:58,289 at this point? 27 00:00:58,289 --> 00:01:02,850 Well, I could just set p of x is equal to f of 0. 28 00:01:02,850 --> 00:01:06,129 And in that case, p of x would just look like a horizontal 29 00:01:06,129 --> 00:01:08,599 line going through f of 0. 30 00:01:08,599 --> 00:01:10,049 It would just look like that. 31 00:01:10,049 --> 00:01:12,459 I'm going to erase that now, just so I don't dirty up 32 00:01:12,459 --> 00:01:13,589 this picture too much. 33 00:01:13,590 --> 00:01:17,540 But that's, you could say, a very rough approximation 34 00:01:17,540 --> 00:01:19,050 of f of x, right? 35 00:01:19,049 --> 00:01:23,069 36 00:01:23,069 --> 00:01:24,859 So that's a start. 37 00:01:24,859 --> 00:01:27,450 Well, what would be one way to approximate it even more? 38 00:01:27,450 --> 00:01:33,140 Well, what if not only does p of x equal f of 0 at x is equal 39 00:01:33,140 --> 00:01:44,900 to 0, so that horizontal line we did, we got p of 0 is equal 40 00:01:44,900 --> 00:01:48,450 to f of 0, so we knew that at x equals 0, at least that 41 00:01:48,450 --> 00:01:50,430 horizontal line is the same value of f of x, that's a 42 00:01:50,430 --> 00:01:51,920 very rough approximation. 43 00:01:51,920 --> 00:02:00,010 But what if we set it up so that the derivative of p of 0 44 00:02:00,010 --> 00:02:06,020 is equal to the derivative of the function at 0? 45 00:02:06,019 --> 00:02:08,349 All of a sudden, this could be a little bit more interesting. 46 00:02:08,349 --> 00:02:09,789 So how could we set it up like that? 47 00:02:09,789 --> 00:02:14,349 Well, what if we set p of x, and I'm doing it very general, 48 00:02:14,349 --> 00:02:16,180 and we're going to do specific examples, and actually, the 49 00:02:16,180 --> 00:02:19,159 first example we're going to do is probably the coolest one. 50 00:02:19,159 --> 00:02:23,460 So what if p of x is equal to, well, the constant term is f of 51 00:02:23,460 --> 00:02:31,650 0, and then it's plus the derivative of this function, so 52 00:02:31,650 --> 00:02:37,110 the slope of this function at that point, f prime 53 00:02:37,110 --> 00:02:39,780 of 0 times x. 54 00:02:39,780 --> 00:02:42,020 Let's say I'm defining, so this is a polynomial. 55 00:02:42,020 --> 00:02:44,040 I just added a first degree term here. 56 00:02:44,039 --> 00:02:46,269 I had a constant, and now I'm adding a first degree term. 57 00:02:46,270 --> 00:02:48,630 And let me confirm that this will have the same derivative. 58 00:02:48,629 --> 00:02:49,990 So let's see. 59 00:02:49,990 --> 00:02:52,800 First of all, let's confirm that p of 0 is equal to f of 0. 60 00:02:52,800 --> 00:03:03,130 Well, p of 0 is equal to f of 0 plus f prime of 0 times 0. 61 00:03:03,129 --> 00:03:05,979 Well, this last term just goes to, is nothing, right? 62 00:03:05,979 --> 00:03:06,560 Times 0. 63 00:03:06,560 --> 00:03:09,180 So that checks out. 64 00:03:09,180 --> 00:03:12,500 At x is equal to 0, the two functions are 65 00:03:12,500 --> 00:03:13,840 equal to each other. 66 00:03:13,840 --> 00:03:16,189 Now let me confirm that their derivative, their first 67 00:03:16,189 --> 00:03:17,990 derivatives are the same. 68 00:03:17,990 --> 00:03:21,450 So what's the first derivative of p? 69 00:03:21,449 --> 00:03:25,469 p prime of x is equal to, well, the derivative of a 70 00:03:25,469 --> 00:03:27,659 constant term is 0, right? 71 00:03:27,659 --> 00:03:30,849 Plus, and what's the derivative of a next term, of a 72 00:03:30,849 --> 00:03:32,169 first degree term? 73 00:03:32,169 --> 00:03:33,799 Well, it's just f prime of 0. 74 00:03:33,800 --> 00:03:36,800 75 00:03:36,800 --> 00:03:37,780 So this checks out. 76 00:03:37,780 --> 00:03:45,289 My new polynomial that I've defined right here is equal to 77 00:03:45,289 --> 00:03:49,359 the function f at x is equal to 0, and its derivative is equal 78 00:03:49,360 --> 00:03:52,380 to the function f at x is equal to 0. 79 00:03:52,379 --> 00:03:54,740 So what would it look like? 80 00:03:54,740 --> 00:03:58,830 Well, it would intersect, at x is equal to 0, the two 81 00:03:58,830 --> 00:04:00,170 functions would overlap. 82 00:04:00,169 --> 00:04:02,459 And also, they would have the same slope at that point. 83 00:04:02,460 --> 00:04:04,180 So whatever f of x is doing, that function's 84 00:04:04,180 --> 00:04:04,640 going to be doing. 85 00:04:04,639 --> 00:04:07,779 So it's going to look something like, I'm going to try my best 86 00:04:07,780 --> 00:04:11,650 to, it's going to look something like that. 87 00:04:11,650 --> 00:04:14,289 88 00:04:14,289 --> 00:04:17,930 And so that is a better approximation, if we had to use 89 00:04:17,930 --> 00:04:20,769 a line, that's as good as any, especially around 0, 90 00:04:20,769 --> 00:04:23,469 of what f of x is. 91 00:04:23,470 --> 00:04:27,180 f of x might have been some really crazy weirdo function, 92 00:04:27,180 --> 00:04:31,350 but we were able to approximate it reasonably well with this 93 00:04:31,350 --> 00:04:33,760 very simple linear equation. 94 00:04:33,759 --> 00:04:36,750 Well, that's all good, but let's approximate it with a 95 00:04:36,750 --> 00:04:40,490 quadratic equation, with adding another x squared term. 96 00:04:40,490 --> 00:04:42,910 And we're going to do that way, but we're going to say, well, 97 00:04:42,910 --> 00:04:47,050 we said, when at x is equal to 0, the functions 98 00:04:47,050 --> 00:04:47,900 equal each other. 99 00:04:47,899 --> 00:04:49,589 That's what we did here. 100 00:04:49,589 --> 00:04:51,569 Then we said, the derivatives equal each other, and 101 00:04:51,569 --> 00:04:53,269 so we added this term. 102 00:04:53,269 --> 00:04:56,129 And now I'm going to say, what happens when their second 103 00:04:56,129 --> 00:04:58,480 derivatives equal each other? 104 00:04:58,480 --> 00:05:00,050 So what has to happen for their second derivatives 105 00:05:00,050 --> 00:05:02,430 to equal each other? 106 00:05:02,430 --> 00:05:05,610 Well, let's try out this, and I think you'll start 107 00:05:05,610 --> 00:05:06,960 to see the intuition here. 108 00:05:06,959 --> 00:05:10,859 Let me define my new p of x, so let me add another term. 109 00:05:10,860 --> 00:05:14,069 p of x, the first terms are going to be the same. 110 00:05:14,069 --> 00:05:14,819 They're going to be f of 0. 111 00:05:14,819 --> 00:05:17,099 Remember, this is just a constant term. 112 00:05:17,100 --> 00:05:21,530 Plus f prime of 0, the first derivative at 0, 113 00:05:21,529 --> 00:05:24,049 the slope at 0 times x. 114 00:05:24,050 --> 00:05:32,790 Plus f prime prime, the second derivative of the function at 115 00:05:32,790 --> 00:05:37,610 0, times x squared over 2. 116 00:05:37,610 --> 00:05:40,500 Now you're probably saying, why are you multiplying 117 00:05:40,500 --> 00:05:41,389 it by 1/2 here? 118 00:05:41,389 --> 00:05:43,300 And you'll see, and maybe you'll even realize it, when 119 00:05:43,300 --> 00:05:45,500 you take a second derivative, what happens, right? 120 00:05:45,500 --> 00:05:48,459 You multiply the expression by the exponents so you can have a 121 00:05:48,459 --> 00:05:50,799 2 come down, it's going to cancel out with the 1/2. 122 00:05:50,800 --> 00:05:52,150 And that's why I put the 1/2 there. 123 00:05:52,149 --> 00:05:55,389 So that when I take the derivative, that 2 and the 1/2 124 00:05:55,389 --> 00:05:59,459 cancel out, and I'm just left with the second derivative 125 00:05:59,459 --> 00:06:00,469 of the original function. 126 00:06:00,470 --> 00:06:02,570 So let me confirm that. 127 00:06:02,569 --> 00:06:09,670 So p of 0 is equal to f of 0 plus, well when x is equal to 128 00:06:09,670 --> 00:06:12,290 0, that's 0, this term is 0, and when x is equal to 0, 129 00:06:12,290 --> 00:06:14,010 that term is 0, right? 130 00:06:14,009 --> 00:06:16,379 So that checks out. 131 00:06:16,379 --> 00:06:20,790 What's the first derivative of p? 132 00:06:20,790 --> 00:06:26,629 The first derivative of p is going to be, up here, this 133 00:06:26,629 --> 00:06:31,569 was the first derivative of p at 0, right? 134 00:06:31,569 --> 00:06:34,699 So what's the first derivative of p? 135 00:06:34,699 --> 00:06:38,719 Well, the constant term becomes 0, plus-- oh, actually, no, 136 00:06:38,720 --> 00:06:40,770 this was actually of x, sorry. 137 00:06:40,769 --> 00:06:43,129 I shouldn't go back on my work, I know it best when I'm doing 138 00:06:43,129 --> 00:06:44,079 it the first time around. 139 00:06:44,079 --> 00:06:44,969 Anyway. 140 00:06:44,970 --> 00:06:49,530 The first derivative of p of x, this is my current p of x, this 141 00:06:49,529 --> 00:06:51,199 constant term, derivative of 0. 142 00:06:51,199 --> 00:06:55,779 This x term, the derivative is f prime of 0. 143 00:06:55,779 --> 00:06:58,379 And then, what's the derivative of this term? 144 00:06:58,379 --> 00:07:00,990 Well, we take the exponent, multiply it by the expression. 145 00:07:00,990 --> 00:07:03,650 We have 2 times 1/2, that cancels out. 146 00:07:03,649 --> 00:07:09,339 So we're just left with f prime prime of 0 x. 147 00:07:09,339 --> 00:07:10,019 Right? 148 00:07:10,019 --> 00:07:12,549 You take the exponent, multiply by the whole thing, and then 149 00:07:12,550 --> 00:07:14,900 decrement the exponent by 1. 150 00:07:14,899 --> 00:07:18,019 So what is p prime of 0? 151 00:07:18,019 --> 00:07:20,729 What is the derivative at 0? 152 00:07:20,730 --> 00:07:22,960 Well, it equals, this is nothing. 153 00:07:22,959 --> 00:07:27,029 It equals f prime of 0 plus, and, well, this 154 00:07:27,029 --> 00:07:28,989 term's going to be 0. 155 00:07:28,990 --> 00:07:30,930 So that checks out. 156 00:07:30,930 --> 00:07:33,990 And so what's the third derivative? 157 00:07:33,990 --> 00:07:36,379 Let me clean up some of the stuff on the top. 158 00:07:36,379 --> 00:07:38,779 Since this is our current f of x anyway, I can clean 159 00:07:38,779 --> 00:07:41,359 up all of this stuff. 160 00:07:41,360 --> 00:07:43,050 Let me clean up all of this. 161 00:07:43,050 --> 00:07:50,150 162 00:07:50,149 --> 00:07:55,699 So what is the third derivative of this p that I defined here? 163 00:07:55,699 --> 00:07:57,539 This is our current p. 164 00:07:57,540 --> 00:08:02,900 Well, the third derivative is going to be, so p prime prime 165 00:08:02,899 --> 00:08:07,539 prime of x, we could have also written p3 of x, is equal 166 00:08:07,540 --> 00:08:09,900 to the derivative of this. 167 00:08:09,899 --> 00:08:11,359 Oh, sorry, we're not on the third, we're only on 168 00:08:11,360 --> 00:08:12,650 the second derivative. 169 00:08:12,649 --> 00:08:16,060 p, and I'll write prime prime, I was going to write a 2 there. 170 00:08:16,060 --> 00:08:17,750 p prime prime of x. 171 00:08:17,750 --> 00:08:20,000 That equals what? 172 00:08:20,000 --> 00:08:21,990 That's the derivative of this. 173 00:08:21,990 --> 00:08:24,439 So there was a 0 here, that goes to nothing. 174 00:08:24,439 --> 00:08:27,089 This is now a constant term, that becomes nothing. 175 00:08:27,089 --> 00:08:29,250 And then we take the derivative of this term. 176 00:08:29,250 --> 00:08:32,049 Well, we just, it's a constant times x. 177 00:08:32,049 --> 00:08:34,039 Remember, this might look like a function or some variable. 178 00:08:34,039 --> 00:08:34,679 It's just a constant. 179 00:08:34,679 --> 00:08:39,139 Because we evaluated this curvy function, it's 180 00:08:39,139 --> 00:08:41,569 second derivative 0, so we just got a number here. 181 00:08:41,570 --> 00:08:43,900 So this derivative is just this number. 182 00:08:43,899 --> 00:08:48,649 So it equals f prime prime of 0. 183 00:08:48,649 --> 00:08:54,000 And so our current p of x has the same value when x is equal 184 00:08:54,000 --> 00:08:58,080 to 0 as f of x, it has the same first derivative at xis equal 185 00:08:58,080 --> 00:09:01,050 to zero as f of x, it has the same second derivative. 186 00:09:01,049 --> 00:09:05,269 And I don't, this is getting beyond my visualization 187 00:09:05,269 --> 00:09:07,360 ability, especially for an arbitrary function like this, 188 00:09:07,360 --> 00:09:10,139 but I could guess that maybe it looks something like this. 189 00:09:10,139 --> 00:09:10,620 I don't know. 190 00:09:10,620 --> 00:09:14,940 Maybe it looks, maybe our new function will curve, and it'll 191 00:09:14,940 --> 00:09:17,180 approximate it a little bit better, and then maybe 192 00:09:17,179 --> 00:09:18,179 it'll come down like that. 193 00:09:18,179 --> 00:09:18,479 I don't know. 194 00:09:18,480 --> 00:09:19,710 I'm just guessing. 195 00:09:19,710 --> 00:09:22,460 But around x is equal to 0, it's going to be a better 196 00:09:22,460 --> 00:09:24,560 approximation of f of x. 197 00:09:24,559 --> 00:09:27,169 Well, we could just keep doing this, and actually, we will 198 00:09:27,169 --> 00:09:31,539 keep doing this, and you know, just saying, well, the zeroth 199 00:09:31,539 --> 00:09:34,429 derivative, or at the value, is the same the first derivative 200 00:09:34,429 --> 00:09:36,599 is the same at 0, the second derivative is the same at 0, 201 00:09:36,600 --> 00:09:38,379 we'll say the third derivative, the fourth derivative, and 202 00:09:38,379 --> 00:09:39,519 we'll keep doing that. 203 00:09:39,519 --> 00:09:41,730 And I only have 20 seconds left in this video, so we will 204 00:09:41,730 --> 00:09:44,250 continue that in the next video. 205 00:09:44,250 --> 00:09:44,399