1 00:00:01 --> 00:00:03 The following content is provided under a Creative 2 00:00:03 --> 00:00:05 Commons license. Your support will help MIT 3 00:00:05 --> 00:00:08 OpenCourseWare continue to offer high quality educational 4 00:00:08 --> 00:00:13 resources for free. To make a donation or to view 5 00:00:13 --> 00:00:18 additional materials from hundreds of MIT courses, 6 00:00:18 --> 00:00:23 visit MIT OpenCourseWare at ocw.mit.edu. 7 00:00:23 --> 00:00:25 Let me start by basically listing the main things we have 8 00:00:25 --> 00:00:28 learned over the past three weeks or so. 9 00:00:28 --> 00:00:31 And I will add a few complements of information about 10 00:00:31 --> 00:00:34 that because there are a few small details that I didn't 11 00:00:34 --> 00:00:38 quite clarify and that I should probably make a bit clearer, 12 00:00:38 --> 00:00:48 especially what happened at the very end of yesterday's class. 13 00:00:48 --> 00:00:56 Here is a list of things that should be on your review sheet 14 00:00:56 --> 00:01:01 for the exam. The first thing we learned 15 00:01:01 --> 00:01:08 about, the main topic of this unit is about functions of 16 00:01:08 --> 00:01:12 several variables. We have learned how to think of 17 00:01:12 --> 00:01:16 functions of two or three variables in terms of plotting 18 00:01:16 --> 00:01:17 them. In particular, 19 00:01:17 --> 00:01:19 well, not only the graph but also the contour plot and how to 20 00:01:19 --> 00:01:27 read a contour plot. And we have learned how to 21 00:01:27 --> 00:01:38 study variations of these functions using partial 22 00:01:38 --> 00:01:44 derivatives. Remember, we have defined the 23 00:01:44 --> 00:01:47 partial of f with respect to some variable, 24 00:01:47 --> 00:01:52 say, x to be the rate of change with respect to x when we hold 25 00:01:52 --> 00:01:55 all the other variables constant. 26 00:01:55 --> 00:02:01 If you have a function of x and y, this symbol means you 27 00:02:01 --> 00:02:07 differentiate with respect to x treating y as a constant. 28 00:02:07 --> 00:02:15 And we have learned how to package partial derivatives into 29 00:02:15 --> 00:02:20 a vector,the gradient vector. For example, 30 00:02:20 --> 00:02:24 if we have a function of three variables, the vector whose 31 00:02:24 --> 00:02:26 components are the partial derivatives. 32 00:02:26 --> 00:02:33 And we have seen how to use the gradient vector or the partial 33 00:02:33 --> 00:02:39 derivatives to derive various things such as approximation 34 00:02:39 --> 00:02:43 formulas. The change in f, 35 00:02:43 --> 00:02:48 when we change x, y, z slightly, 36 00:02:48 --> 00:02:57 is approximately equal to, well, there are several terms. 37 00:02:57 --> 00:03:03 And I can rewrite this in vector form as the gradient dot 38 00:03:03 --> 00:03:08 product the amount by which the position vector has changed. 39 00:03:08 --> 00:03:11 Basically, what causes f to change is that I am changing x, 40 00:03:11 --> 00:03:16 y and z by small amounts and how sensitive f is to each 41 00:03:16 --> 00:03:22 variable is precisely what the partial derivatives measure. 42 00:03:22 --> 00:03:26 And, in particular, this approximation is called 43 00:03:26 --> 00:03:30 the tangent plane approximation because it tells us, 44 00:03:30 --> 00:03:35 in fact, it amounts to identifying the 45 00:03:35 --> 00:03:38 graph of the function with its tangent plane. 46 00:03:38 --> 00:03:43 It means that we assume that the function depends more or 47 00:03:43 --> 00:03:45 less linearly on x, y and z. 48 00:03:45 --> 00:03:48 And, if we set these things equal, what we get is actually, 49 00:03:48 --> 00:03:52 we are replacing the function by its linear approximation. 50 00:03:52 --> 00:03:56 We are replacing the graph by its tangent plane. 51 00:03:56 --> 00:03:58 Except, of course, we haven't see the graph of a 52 00:03:58 --> 00:04:00 function of three variables because that would live in 53 00:04:00 --> 00:04:04 4-dimensional space. So, when we think of a graph, 54 00:04:04 --> 00:04:08 really, it is a function of two variables. 55 00:04:08 --> 00:04:12 That also tells us how to find tangent planes to level 56 00:04:12 --> 00:04:12 surfaces. 57 00:04:12 --> 00:04:22 58 00:04:22 --> 00:04:30 Recall that the tangent plane to a surface, 59 00:04:30 --> 00:04:37 given by the equation f of x, y, z equals z, 60 00:04:37 --> 00:04:43 at a given point can be found by looking first for its normal 61 00:04:43 --> 00:04:47 vector. And we know that the normal 62 00:04:47 --> 00:04:49 vector is actually, well, 63 00:04:49 --> 00:04:53 one normal vector is given by the gradient of a function 64 00:04:53 --> 00:04:56 because we know that the gradient is actually pointing 65 00:04:56 --> 00:05:01 perpendicularly to the level sets towards higher values of a 66 00:05:01 --> 00:05:05 function. And it gives us the direction 67 00:05:05 --> 00:05:08 of fastest increase of a function. 68 00:05:08 --> 00:05:13 OK. Any questions about these 69 00:05:13 --> 00:05:18 topics? No. 70 00:05:18 --> 00:05:20 OK. Let me add, actually, 71 00:05:20 --> 00:05:23 a cultural note to what we have seen so far about partial 72 00:05:23 --> 00:05:28 derivatives and how to use them, which is maybe something I 73 00:05:28 --> 00:05:32 should have mentioned a couple of weeks ago. 74 00:05:32 --> 00:05:33 Why do we like partial derivatives? 75 00:05:33 --> 00:05:37 Well, one obvious reason is we can do all these things. 76 00:05:37 --> 00:05:39 But another reason is that, really, 77 00:05:39 --> 00:05:42 you need partial derivatives to do physics and to understand 78 00:05:42 --> 00:05:46 much of the world that is around you because a lot of things 79 00:05:46 --> 00:05:50 actually are governed by what is called partial differentiation 80 00:05:50 --> 00:05:51 equations. 81 00:05:51 --> 00:05:59 82 00:05:59 --> 00:06:07 So if you want a cultural remark about what this is good 83 00:06:07 --> 00:06:09 for. A partial differential equation 84 00:06:09 --> 00:06:13 is an equation that involves the partial derivatives of a 85 00:06:13 --> 00:06:15 function. So you have some function that 86 00:06:15 --> 00:06:18 is unknown that depends on a bunch of variables. 87 00:06:18 --> 00:06:23 And a partial differential equation is some relation 88 00:06:23 --> 00:06:28 between its partial derivatives. Let me see. 89 00:06:28 --> 00:06:45 These are equations involving the partial derivatives -- -- of 90 00:06:45 --> 00:06:54 an unknown function. Let me give you an example to 91 00:06:54 --> 00:06:57 see how that works. For example, 92 00:06:57 --> 00:07:02 the heat equation is one example of a partial 93 00:07:02 --> 00:07:09 differential equation. It is the equation -- Well, 94 00:07:09 --> 00:07:15 let me write for you the space version of it. 95 00:07:15 --> 00:07:21 It is the equation partial f over partial t equals some 96 00:07:21 --> 00:07:27 constant times the sum of the second partials with respect to 97 00:07:27 --> 00:07:32 x, y and z. So this is an equation where we 98 00:07:32 --> 00:07:38 are trying to solve for a function f that depends, 99 00:07:38 --> 00:07:42 actually, on four variables, x, y, z, t. 100 00:07:42 --> 00:07:47 And what should you have in mind? 101 00:07:47 --> 00:07:50 Well, this equation governs temperature. 102 00:07:50 --> 00:07:55 If you think that f of x, y, z, t will be the temperature at a 103 00:07:55 --> 00:07:59 point in space at position x, y, z and at time t, 104 00:07:59 --> 00:08:04 then this tells you how temperature changes over time. 105 00:08:04 --> 00:08:07 It tells you that at any given point, 106 00:08:07 --> 00:08:10 the rate of change of temperature over time is given 107 00:08:10 --> 00:08:15 by this complicated expression in the partial derivatives in 108 00:08:15 --> 00:08:18 terms of the space coordinates x, y, z. 109 00:08:18 --> 00:08:21 If you know, for example, the initial distribution of 110 00:08:21 --> 00:08:24 temperature in this room, and if you assume that nothing 111 00:08:24 --> 00:08:26 is generating heat or taking heat away, 112 00:08:26 --> 00:08:29 so if you don't have any air conditioning or heating going 113 00:08:29 --> 00:08:31 on, then it will tell you how the 114 00:08:31 --> 00:08:35 temperature will change over time and eventually stabilize to 115 00:08:35 --> 00:08:41 some final value. Yes? 116 00:08:41 --> 00:08:43 Why do we take the partial derivative twice? 117 00:08:43 --> 00:08:45 Well, that is a question, I would say, 118 00:08:45 --> 00:08:48 for a physics person. But in a few weeks we will 119 00:08:48 --> 00:08:52 actually see a derivation of where this equation comes from 120 00:08:52 --> 00:08:55 and try to justify it. But, really, 121 00:08:55 --> 00:08:57 that is something you will see in a physics class. 122 00:08:57 --> 00:09:02 The reason for that is basically physics of how heat is 123 00:09:02 --> 00:09:09 transported between particles in fluid, or actually any medium. 124 00:09:09 --> 00:09:12 This constant k actually is called the heat conductivity. 125 00:09:12 --> 00:09:17 It tells you how well the heat flows through the material that 126 00:09:17 --> 00:09:20 you are looking at. Anyway, I am giving it to you 127 00:09:20 --> 00:09:23 just to show you an example of a real life problem where, 128 00:09:23 --> 00:09:26 in fact, you have to solve one of these things. 129 00:09:26 --> 00:09:29 Now, how to solve partial differential equations is not a 130 00:09:29 --> 00:09:32 topic for this class. It is not even a topic for 131 00:09:32 --> 00:09:34 18.03 which is called Differential Equations, 132 00:09:34 --> 00:09:38 without partial, which means there actually you 133 00:09:38 --> 00:09:41 will learn tools to study and solve these equations but when 134 00:09:41 --> 00:09:43 there is only one variable involved. 135 00:09:43 --> 00:09:47 And you will see it is already quite hard. 136 00:09:47 --> 00:09:50 And, if you want more on that one, we have many fine classes 137 00:09:50 --> 00:09:52 about partial differential equations. 138 00:09:52 --> 00:09:58 But one thing at a time. I wanted to point out to you 139 00:09:58 --> 00:10:03 that very often functions that you see in real life satisfy 140 00:10:03 --> 00:10:08 many nice relations between the partial derivatives. 141 00:10:08 --> 00:10:10 That was in case you were wondering why on the syllabus 142 00:10:10 --> 00:10:13 for today it said partial differential equations. 143 00:10:13 --> 00:10:15 Now we have officially covered the topic. 144 00:10:15 --> 00:10:20 That is basically all we need to know about it. 145 00:10:20 --> 00:10:22 But we will come back to that a bit later. 146 00:10:22 --> 00:10:27 You will see. OK. 147 00:10:27 --> 00:10:30 If there are no further questions, let me continue and 148 00:10:30 --> 00:10:33 go back to my list of topics. Oh, sorry. 149 00:10:33 --> 00:10:42 I should have written down that this equation is solved by 150 00:10:42 --> 00:10:48 temperature for point x, y, z at time t. 151 00:10:48 --> 00:10:52 OK. And there are, actually, 152 00:10:52 --> 00:10:56 many other interesting partial differential equations you will 153 00:10:56 --> 00:10:59 maybe sometimes learn about the wave equation that governs how 154 00:10:59 --> 00:11:02 waves propagate in space, about the diffusion equation, 155 00:11:02 --> 00:11:07 when you have maybe a mixture of two fluids, 156 00:11:07 --> 00:11:11 how they somehow mix over time and so on. 157 00:11:11 --> 00:11:16 Basically, to every problem you might want to consider there is 158 00:11:16 --> 00:11:19 a partial differential equation to solve. 159 00:11:19 --> 00:11:23 OK. Anyway. Sorry. Back to my list of topics. 160 00:11:23 --> 00:11:27 One important application we have seen of partial derivatives 161 00:11:27 --> 00:11:30 is to try to optimize things, try to solve minimum/maximum 162 00:11:30 --> 00:11:31 problems. 163 00:11:31 --> 00:11:42 164 00:11:42 --> 00:11:47 Remember that we have introduced the notion of 165 00:11:47 --> 00:11:56 critical points of a function. A critical point is when all 166 00:11:56 --> 00:12:03 the partial derivatives are zero. 167 00:12:03 --> 00:12:05 And then there are various kinds of critical points. 168 00:12:05 --> 00:12:09 There is maxima and there is minimum, but there is also 169 00:12:09 --> 00:12:15 saddle points. And we have seen a method using 170 00:12:15 --> 00:12:24 second derivatives -- -- to decide which kind of critical 171 00:12:24 --> 00:12:29 point we have. I should say that is for a 172 00:12:29 --> 00:12:35 function of two variables to try to decide whether a given 173 00:12:35 --> 00:12:41 critical point is a minimum, a maximum or a saddle point. 174 00:12:41 --> 00:12:44 And we have also seen that actually that is not enough to 175 00:12:44 --> 00:12:48 find the minimum of a maximum of a function because the minimum 176 00:12:48 --> 00:12:50 of a maximum could occur on the boundary. 177 00:12:50 --> 00:12:53 Just to give you a small reminder, 178 00:12:53 --> 00:12:55 when you have a function of one variables, 179 00:12:55 --> 00:13:00 if you are trying to find the minimum and the maximum of a 180 00:13:00 --> 00:13:03 function whose graph looks like this, 181 00:13:03 --> 00:13:05 well, you are going to tell me, quite obviously, 182 00:13:05 --> 00:13:07 that the maximum is this point up here. 183 00:13:07 --> 00:13:11 And that is a point where the first derivative is zero. 184 00:13:11 --> 00:13:14 That is a critical point. And we used the second 185 00:13:14 --> 00:13:18 derivative to see that this critical point is a local 186 00:13:18 --> 00:13:20 maximum. But then, when we are looking 187 00:13:20 --> 00:13:23 for the minimum of a function, well, it is not at a critical 188 00:13:23 --> 00:13:26 point. It is actually here at the 189 00:13:26 --> 00:13:30 boundary of the domain, you know, the range of values 190 00:13:30 --> 00:13:38 that we are going to consider. Here the minimum is at the 191 00:13:38 --> 00:13:44 boundary. And the maximum is at a 192 00:13:44 --> 00:13:50 critical point. Similarly, when you have a 193 00:13:50 --> 00:13:53 function of several variables, say of two variables, 194 00:13:53 --> 00:13:55 for example, then the minimum and the 195 00:13:55 --> 00:13:58 maximum will be achieved either at a critical point. 196 00:13:58 --> 00:14:01 And then we can use these methods to find where they are. 197 00:14:01 --> 00:14:06 Or, somewhere on the boundary of a set of values that are 198 00:14:06 --> 00:14:09 allowed. It could be that we actually 199 00:14:09 --> 00:14:13 achieve a minimum by making x and y as small as possible. 200 00:14:13 --> 00:14:16 Maybe letting them go to zero if they had to be positive or 201 00:14:16 --> 00:14:19 maybe by making them go to infinity. 202 00:14:19 --> 00:14:23 So, we have to keep our minds open and look at various 203 00:14:23 --> 00:14:26 possibilities. We are going to do a problem 204 00:14:26 --> 00:14:29 like that. We are going to go over a 205 00:14:29 --> 00:14:34 practice problem from the practice test to clarify this. 206 00:14:34 --> 00:14:38 Another important cultural application of minimum/maximum 207 00:14:38 --> 00:14:42 problems in two variables that we have seen in class is the 208 00:14:42 --> 00:14:45 least squared method to find the best fit line, 209 00:14:45 --> 00:14:49 or the best fit anything, really, 210 00:14:49 --> 00:14:56 to find when you have a set of data points what is the best 211 00:14:56 --> 00:15:01 linear approximately for these data points. 212 00:15:01 --> 00:15:03 And here I have some good news for you. 213 00:15:03 --> 00:15:07 While you should definitely know what this is about, 214 00:15:07 --> 00:15:09 it will not be on the test. 215 00:15:09 --> 00:15:30 216 00:15:30 --> 00:15:35 [APPLAUSE] That doesn't mean that you 217 00:15:35 --> 00:15:41 should forget everything we have seen about it, 218 00:15:41 --> 00:15:51 OK? Now what is next on my list of 219 00:15:51 --> 00:15:58 topics? We have seen differentials. 220 00:15:58 --> 00:16:03 Remember the differential of f, by definition, 221 00:16:03 --> 00:16:09 would be this kind of quantity. At first it looks just like a 222 00:16:09 --> 00:16:12 new way to package partial derivatives together into some 223 00:16:12 --> 00:16:15 new kind of object. Now, what is this good for? 224 00:16:15 --> 00:16:18 Well, it is a good way to remember approximation formulas. 225 00:16:18 --> 00:16:22 It is a good way to also study how variations in x, 226 00:16:22 --> 00:16:26 y, z relate to variations in f. In particular, 227 00:16:26 --> 00:16:30 we can divide this by variations, 228 00:16:30 --> 00:16:34 actually, by dx or by dy or by dz in any situation that we 229 00:16:34 --> 00:16:40 want, or by d of some other variable 230 00:16:40 --> 00:16:46 to get chain rules. The chain rule says, 231 00:16:46 --> 00:16:50 for example, there are many situations. 232 00:16:50 --> 00:16:56 But, for example, if x, y and z depend on some 233 00:16:56 --> 00:17:04 other variable, say of variables maybe even u 234 00:17:04 --> 00:17:08 and v, then that means that f becomes 235 00:17:08 --> 00:17:13 a function of u and v. And then we can ask ourselves, 236 00:17:13 --> 00:17:18 how sensitive is f to a value of u? 237 00:17:18 --> 00:17:25 Well, we can answer that. The chain rule is something 238 00:17:25 --> 00:17:33 like this. And let me explain to you again 239 00:17:33 --> 00:17:41 where this comes from. Basically, what this quantity 240 00:17:41 --> 00:17:46 means is if we change u and keep v constant, what happens to the 241 00:17:46 --> 00:17:48 value of f? Well, why would the value of f 242 00:17:48 --> 00:17:51 change in the first place when f is just a function of x, 243 00:17:51 --> 00:17:55 y, z and not directly of you? Well, it changes because x, 244 00:17:55 --> 00:17:59 y and z depend on u. First we have to figure out how 245 00:17:59 --> 00:18:02 quickly x, y and z change when we change u. 246 00:18:02 --> 00:18:05 Well, how quickly they do that is precisely partial x over 247 00:18:05 --> 00:18:08 partial u, partial y over partial u, partial z over 248 00:18:08 --> 00:18:10 partial u. These are the rates of change 249 00:18:10 --> 00:18:14 of x, y, z when we change u. And now, when we change x, 250 00:18:14 --> 00:18:17 y and z, that causes f to change. 251 00:18:17 --> 00:18:21 How much does f change? Well, partial f over partial x 252 00:18:21 --> 00:18:25 tells us how quickly f changes if I just change x. 253 00:18:25 --> 00:18:29 I get this. That is the change in f caused 254 00:18:29 --> 00:18:33 just by the fact that x changes when u changes. 255 00:18:33 --> 00:18:36 But then y also changes. y changes at this rate. 256 00:18:36 --> 00:18:39 And that causes f to change at that rate. 257 00:18:39 --> 00:18:42 And z changes as well, and that causes f to change at 258 00:18:42 --> 00:18:45 that rate. And the effects add up together. 259 00:18:45 --> 00:18:57 Does that make sense? OK. 260 00:18:57 --> 00:19:00 And so, in particular, we can use the chain rule to do 261 00:19:00 --> 00:19:03 changes of variables. If we have, say, 262 00:19:03 --> 00:19:08 a function in terms of polar coordinates on theta and we like 263 00:19:08 --> 00:19:14 to switch it to rectangular coordinates x and y then we can 264 00:19:14 --> 00:19:19 use chain rules to relate the partial derivatives. 265 00:19:19 --> 00:19:23 And finally, last but not least, 266 00:19:23 --> 00:19:31 we have seen how to deal with non-independent variables. 267 00:19:31 --> 00:19:37 When our variables say x, y, z related by some equation. 268 00:19:37 --> 00:19:41 One way we can deal with this is to solve for one of the 269 00:19:41 --> 00:19:44 variables and go back to two independent variables, 270 00:19:44 --> 00:19:47 but we cannot always do that. Of course, on the exam, 271 00:19:47 --> 00:19:50 you can be sure that I will make sure that you cannot solve 272 00:19:50 --> 00:19:53 for a variable you want to remove because that would be too 273 00:19:53 --> 00:19:56 easy. Then when we have to look at 274 00:19:56 --> 00:20:02 all of them, we will have to take into account this relation, 275 00:20:02 --> 00:20:05 we have seen two useful methods. 276 00:20:05 --> 00:20:09 One of them is to find the minimum of a maximum of a 277 00:20:09 --> 00:20:13 function when the variables are not independent, 278 00:20:13 --> 00:20:17 and that is the method of Lagrange multipliers. 279 00:20:17 --> 00:20:33 280 00:20:33 --> 00:20:39 Remember, to find the minimum or the maximum of the function 281 00:20:39 --> 00:20:45 f, subject to the constraint g 282 00:20:45 --> 00:20:52 equals constant, well, we write down equations 283 00:20:52 --> 00:20:59 that say that the gradient of f is actually proportional to the 284 00:20:59 --> 00:21:04 gradient of g. There is a new variable here, 285 00:21:04 --> 00:21:08 lambda, the multiplier. And so, for example, 286 00:21:08 --> 00:21:12 well, I guess here I had functions of three variables, 287 00:21:12 --> 00:21:14 so this becomes three equations. 288 00:21:14 --> 00:21:21 f sub x equals lambda g sub x, f sub y equals lambda g sub y, 289 00:21:21 --> 00:21:25 and f sub z equals lambda g sub z. 290 00:21:25 --> 00:21:27 And, when we plug in the formulas for f and g, 291 00:21:27 --> 00:21:31 well, we are left with three equations involving the four 292 00:21:31 --> 00:21:33 variables, x, y, z and lambda. 293 00:21:33 --> 00:21:36 What is wrong? Well, we don't have actually 294 00:21:36 --> 00:21:41 four independent variables. We also have this relation, 295 00:21:41 --> 00:21:48 whatever the constraint was relating x, y and z together. 296 00:21:48 --> 00:21:51 Then we can try to solve this. And, depending on the 297 00:21:51 --> 00:21:56 situation, it is sometimes easy. And it sometimes it is very 298 00:21:56 --> 00:22:01 hard or even impossible. But on the test, 299 00:22:01 --> 00:22:03 I haven't decided yet, but it could well be that the 300 00:22:03 --> 00:22:06 problem about Lagrange multipliers just asks you to 301 00:22:06 --> 00:22:08 write the equations and not to solve them. 302 00:22:08 --> 00:22:14 [APPLAUSE] Well, I don't know yet. 303 00:22:14 --> 00:22:18 I am not promising anything. But, before you start solving, 304 00:22:18 --> 00:22:23 check whether the problem asks you to solve them or not. 305 00:22:23 --> 00:22:26 If it doesn't then probably you shouldn't. 306 00:22:26 --> 00:23:02 307 00:23:02 --> 00:23:09 Another topic that we solved just yesterday is constrained 308 00:23:09 --> 00:23:13 partial derivatives. And I guess I have to 309 00:23:13 --> 00:23:19 re-explain a little bit because my guess is that things were not 310 00:23:19 --> 00:23:23 extremely clear at the end of class yesterday. 311 00:23:23 --> 00:23:25 Now we are in the same situation. 312 00:23:25 --> 00:23:29 We have a function, let's say, f of x, 313 00:23:29 --> 00:23:34 y, z where variables x, y and z are not independent but 314 00:23:34 --> 00:23:39 are constrained by some relation of this form. 315 00:23:39 --> 00:23:43 Some quantity involving x, y and z is equal to maybe zero 316 00:23:43 --> 00:23:47 or some other constant. And then, what we want to know, 317 00:23:47 --> 00:23:51 is what is the rate of change of f with respect to one of the 318 00:23:51 --> 00:23:57 variables, say, x, y or z when I keep the 319 00:23:57 --> 00:24:02 others constant? Well, I cannot keep all the 320 00:24:02 --> 00:24:07 other constant because that would not be compatible with 321 00:24:07 --> 00:24:11 this condition. I mean that would be the usual 322 00:24:11 --> 00:24:15 or so-called formal partial derivative of f ignoring the 323 00:24:15 --> 00:24:18 constraint. To take this into account means 324 00:24:18 --> 00:24:23 that if we vary one variable while keeping another one fixed 325 00:24:23 --> 00:24:26 then the third one, since it depends on them, 326 00:24:26 --> 00:24:31 must also change somehow. And we must take that into 327 00:24:31 --> 00:24:34 account. Let's say, for example, 328 00:24:34 --> 00:24:39 we want to find -- I am going to do a different example from 329 00:24:39 --> 00:24:42 yesterday. So, if you really didn't like 330 00:24:42 --> 00:24:46 that one, you don't have to see it again. 331 00:24:46 --> 00:24:51 Let's say that we want to find the partial derivative of f with 332 00:24:51 --> 00:24:56 respect to z keeping y constant. What does that mean? 333 00:24:56 --> 00:25:03 That means y is constant, z varies and x somehow is 334 00:25:03 --> 00:25:11 mysteriously a function of y and z for this equation. 335 00:25:11 --> 00:25:14 And then, of course because it depends on y, 336 00:25:14 --> 00:25:19 that means x will vary. Sorry, depends on y and z and z 337 00:25:19 --> 00:25:21 varies. Now we are asking ourselves 338 00:25:21 --> 00:25:25 what is the rate of change of f with respect to z in this 339 00:25:25 --> 00:25:26 situation? 340 00:25:26 --> 00:25:42 341 00:25:42 --> 00:25:47 And so we have two methods to do that. 342 00:25:47 --> 00:25:55 Let me start with the one with differentials that hopefully you 343 00:25:55 --> 00:26:02 kind of understood yesterday, but if not here is a second 344 00:26:02 --> 00:26:06 chance. Using differentials means that 345 00:26:06 --> 00:26:10 we will try to express df in terms of dz in this particular 346 00:26:10 --> 00:26:14 situation. What do we know about df in 347 00:26:14 --> 00:26:19 general? Well, we know that df is f sub 348 00:26:19 --> 00:26:25 x dx plus f sub y dy plus f sub z dz. 349 00:26:25 --> 00:26:28 That is the general statement. But, of course, 350 00:26:28 --> 00:26:31 we are in a special case. We are in a special case where 351 00:26:31 --> 00:26:41 first y is constant. y is constant means that we can 352 00:26:41 --> 00:26:50 set dy to be zero. This goes away and becomes zero. 353 00:26:50 --> 00:26:53 The second thing is actually we don't care about x. 354 00:26:53 --> 00:26:57 We would like to get rid of x because it is this dependent 355 00:26:57 --> 00:27:00 variable. What we really want to do is 356 00:27:00 --> 00:27:12 express df only in terms of dz. What we need is to relate dx 357 00:27:12 --> 00:27:16 with dz. Well, to do that, 358 00:27:16 --> 00:27:20 we need to look at how the variables are related so we need 359 00:27:20 --> 00:27:24 to look at the constraint g. Well, how do we do that? 360 00:27:24 --> 00:27:31 We look at the differential g. So dg is g sub x dx plus g sub 361 00:27:31 --> 00:27:37 y dy plus g sub z dz. And that is zero because we are 362 00:27:37 --> 00:27:40 setting g to always stay constant. 363 00:27:40 --> 00:27:44 So, g doesn't change. If g doesn't change then we 364 00:27:44 --> 00:27:48 have a relation between dx, dy and dz. 365 00:27:48 --> 00:27:50 Well, in fact, we say we are going to look 366 00:27:50 --> 00:27:52 only at the case where y is constant. 367 00:27:52 --> 00:27:56 y doesn't change and this becomes zero. 368 00:27:56 --> 00:27:59 Well, now we have a relation between dx and dz. 369 00:27:59 --> 00:28:05 We know how x depends on z. And when we know how x depends 370 00:28:05 --> 00:28:10 on z, we can plug that into here and get how f depends on z. 371 00:28:10 --> 00:28:11 Let's do that. 372 00:28:11 --> 00:28:28 373 00:28:28 --> 00:28:33 Again, saying that g cannot change and keeping y constant 374 00:28:33 --> 00:28:39 tells us g sub x dx plus g sub z dz is zero and we would like to 375 00:28:39 --> 00:28:46 solve for dx in terms of dz. That tells us dx should be 376 00:28:46 --> 00:28:53 minus g sub z dz divided by g sub x. 377 00:28:53 --> 00:28:57 If you want, this is the rate of change of x 378 00:28:57 --> 00:29:00 with respect to z when we keep y constant. 379 00:29:00 --> 00:29:13 In our new terminology this is partial x over partial z with y 380 00:29:13 --> 00:29:18 held constant. This is the rate of change of x 381 00:29:18 --> 00:29:23 with respect to z. Now, when we know that, 382 00:29:23 --> 00:29:30 we are going to plug that into this equation. 383 00:29:30 --> 00:29:37 And that will tell us that df is f sub x times dx. 384 00:29:37 --> 00:29:43 Well, what is dx? dx is now minus g sub z over g 385 00:29:43 --> 00:29:51 sub x dz plus f sub z dz. So that will be minus fx g sub 386 00:29:51 --> 00:29:56 z over g sub x plus f sub z times dz. 387 00:29:56 --> 00:30:02 And so this coefficient here is the rate of change of f with 388 00:30:02 --> 00:30:06 respect to z in the situation we are considering. 389 00:30:06 --> 00:30:13 This quantity is what we call partial f over partial z with y 390 00:30:13 --> 00:30:21 held constant. That is what we wanted to find. 391 00:30:21 --> 00:30:25 Now, let's see another way to do the same calculation and then 392 00:30:25 --> 00:30:28 you can choose which one you prefer. 393 00:30:28 --> 00:30:57 394 00:30:57 --> 00:31:09 The other method is using the chain rule. 395 00:31:09 --> 00:31:14 We use the chain rule to understand how f depends on z 396 00:31:14 --> 00:31:19 when y is held constant. Let me first try the chain rule 397 00:31:19 --> 00:31:24 brutally and then we will try to analyze what is going on. 398 00:31:24 --> 00:31:29 You can just use the version that I have up there as a 399 00:31:29 --> 00:31:35 template to see what is going on, but I am going to explain it 400 00:31:35 --> 00:31:37 more carefully again. 401 00:31:37 --> 00:31:50 402 00:31:50 --> 00:31:57 That is the most mechanical and mindless way of writing down the 403 00:31:57 --> 00:32:01 chain rule. I am just saying here that I am 404 00:32:01 --> 00:32:04 varying z, keeping y constant, and I want to know how f 405 00:32:04 --> 00:32:07 changes. Well, f might change because x 406 00:32:07 --> 00:32:10 might change, y might change and z might 407 00:32:10 --> 00:32:14 change. Now, how quickly does x change? 408 00:32:14 --> 00:32:18 Well, the rate of change of x in this situation is partial x, 409 00:32:18 --> 00:32:24 partial z with y held constant. If I change x at this rate then 410 00:32:24 --> 00:32:29 f will change at that rate. Now, y might change, 411 00:32:29 --> 00:32:32 so the rate of change of y would be the rate of change of y 412 00:32:32 --> 00:32:35 with respect to z holding y constant. 413 00:32:35 --> 00:32:38 Wait a second. If y is held constant then y 414 00:32:38 --> 00:32:40 doesn't change. So, actually, 415 00:32:40 --> 00:32:43 this guy is zero and you didn't really have to write that term. 416 00:32:43 --> 00:32:47 But I wrote it just to be systematic. 417 00:32:47 --> 00:32:51 If y had been somehow able to change at a certain rate then 418 00:32:51 --> 00:32:54 that would have caused f to change at that rate. 419 00:32:54 --> 00:32:57 And, of course, if y is held constant then 420 00:32:57 --> 00:33:01 nothing happens here. Finally, while z is changing at 421 00:33:01 --> 00:33:05 a certain rate, this rate is this one and that 422 00:33:05 --> 00:33:10 causes f to change at that rate. And then we add the effects 423 00:33:10 --> 00:33:12 together. See, it is nothing but the 424 00:33:12 --> 00:33:16 good-old chain rule. Just I have put these extra 425 00:33:16 --> 00:33:22 subscripts to tell us what is held constant and what isn't. 426 00:33:22 --> 00:33:23 Now, of course we can simplify it a little bit more. 427 00:33:23 --> 00:33:27 Because, here, how quickly does z change if I 428 00:33:27 --> 00:33:32 am changing z? Well, the rate of change of z, 429 00:33:32 --> 00:33:37 with respect to itself, is just one. 430 00:33:37 --> 00:33:41 In fact, the really mysterious part of this is the one here, 431 00:33:41 --> 00:33:45 which is the rate of change of x with respect to z. 432 00:33:45 --> 00:33:49 And, to find that, we have to understand the 433 00:33:49 --> 00:33:52 constraint. How can we find the rate of 434 00:33:52 --> 00:33:54 change of x with respect to z? Well, we could use 435 00:33:54 --> 00:33:56 differentials, like we did here, 436 00:33:56 --> 00:33:58 but we can also keep using the chain rule. 437 00:33:58 --> 00:34:17 438 00:34:17 --> 00:34:20 How can I do that? Well, I can just look at how g 439 00:34:20 --> 00:34:24 would change with respect to z when y is held constant. 440 00:34:24 --> 00:34:33 I just do the same calculation with g instead of f. 441 00:34:33 --> 00:34:37 But, before I do it, let's ask ourselves first what 442 00:34:37 --> 00:34:40 is this equal to. Well, if g is held constant 443 00:34:40 --> 00:34:44 then, when we vary z keeping y constant and changing x, 444 00:34:44 --> 00:34:53 well, g still doesn't change. It is held constant. 445 00:34:53 --> 00:34:58 In fact, that should be zero. But, if we just say that, 446 00:34:58 --> 00:35:01 we are not going to get to that. 447 00:35:01 --> 00:35:04 Let's see how we can compute that using the chain rule. 448 00:35:04 --> 00:35:09 Well, the chain rule tells us g changes because x, 449 00:35:09 --> 00:35:12 y and z change. How does it change because of x? 450 00:35:12 --> 00:35:18 Well, partial g over partial x times the rate of change of x. 451 00:35:18 --> 00:35:21 How does it change because of y? Well, partial g over partial y 452 00:35:21 --> 00:35:24 times the rate of change of y. But, of course, 453 00:35:24 --> 00:35:28 if you are smarter than me then you don't need to actually write 454 00:35:28 --> 00:35:31 this one because y is held constant. 455 00:35:31 --> 00:35:38 And then there is the rate of change because z changes. 456 00:35:38 --> 00:35:45 And how quickly z changes here, of course, is one. 457 00:35:45 --> 00:35:50 Out of this you get, well, I am tired of writing 458 00:35:50 --> 00:35:58 partial g over partial x. We can just write g sub x times 459 00:35:58 --> 00:36:05 partial x over partial z y constant plus g sub z. 460 00:36:05 --> 00:36:11 And now we found how x depends on z. 461 00:36:11 --> 00:36:17 Partial x over partial z with y held constant is negative g sub 462 00:36:17 --> 00:36:24 z over g sub x. Now we plug that into that and 463 00:36:24 --> 00:36:32 we get our answer. It goes all the way up here. 464 00:36:32 --> 00:36:34 And then we get the answer. I am not going to, 465 00:36:34 --> 00:36:35 well, I guess I can write it again. 466 00:36:35 --> 00:36:47 467 00:36:47 --> 00:36:52 There was partial f over partial x times this guy, 468 00:36:52 --> 00:36:59 minus g sub z over g sub x, plus partial f over partial z. 469 00:36:59 --> 00:37:03 And you can observe that this is exactly the same formula that 470 00:37:03 --> 00:37:07 we had over here. In fact, let's compare this to 471 00:37:07 --> 00:37:10 make it side by side. I claim we did exactly the same 472 00:37:10 --> 00:37:13 thing, just with different notations. 473 00:37:13 --> 00:37:17 If you take the differential of f and you divide it by dz in 474 00:37:17 --> 00:37:20 this situation where y is held constant and so on, 475 00:37:20 --> 00:37:23 you get exactly this chain rule up there. 476 00:37:23 --> 00:37:28 That chain rule up there is this guy, df, 477 00:37:28 --> 00:37:33 divided by dz with y held constant. 478 00:37:33 --> 00:37:38 And the term involving dy was replaced by zero on both sides 479 00:37:38 --> 00:37:41 because we knew, actually, that y is held 480 00:37:41 --> 00:37:44 constant. Now, the real difficulty in 481 00:37:44 --> 00:37:48 both cases comes from dx. And what we do about dx is we 482 00:37:48 --> 00:37:52 use the constant. Here we use it by writing dg 483 00:37:52 --> 00:37:55 equals zero. Here we write the chain rule 484 00:37:55 --> 00:38:00 for g, which is the same thing, just divided by dz with y held 485 00:38:00 --> 00:38:03 constant. This formula or that formula 486 00:38:03 --> 00:38:07 are the same, just divided by dz with y held 487 00:38:07 --> 00:38:11 constant. And then, in both cases, 488 00:38:11 --> 00:38:16 we used that to solve for dx. And then we plugged into the 489 00:38:16 --> 00:38:21 formula of df to express df over dz, or partial f, 490 00:38:21 --> 00:38:26 partial z with y held constant. So, the two methods are pretty 491 00:38:26 --> 00:38:27 much the same. Quick poll. 492 00:38:27 --> 00:38:33 Who prefers this one? Who prefers that one? 493 00:38:33 --> 00:38:34 OK. Majority vote seems to be for 494 00:38:34 --> 00:38:36 differentials, but it doesn't mean that it is 495 00:38:36 --> 00:38:39 better. Both are fine. 496 00:38:39 --> 00:38:42 You can use whichever one you want. 497 00:38:42 --> 00:38:50 But you should give both a try. OK. Any questions? 498 00:38:50 --> 00:38:58 Yes? Yes. Thank you. 499 00:38:58 --> 00:39:02 I forgot to mention it. Where did that go? 500 00:39:02 --> 00:39:11 I think I erased that part. We need to know -- -- 501 00:39:11 --> 00:39:20 directional derivatives. Pretty much the only thing to 502 00:39:20 --> 00:39:23 remember about them is that df over ds, 503 00:39:23 --> 00:39:25 in the direction of some unit vector u, 504 00:39:25 --> 00:39:30 is just the gradient f dot product with u. 505 00:39:30 --> 00:39:35 That is pretty much all we know about them. 506 00:39:35 --> 00:39:39 Any other topics that I forgot to list? 507 00:39:39 --> 00:39:45 No. Yes? 508 00:39:45 --> 00:39:46 Can I erase three boards at a time? 509 00:39:46 --> 00:39:47 No, I would need three hands to do that. 510 00:39:47 --> 00:40:03 511 00:40:03 --> 00:40:07 I think what we should do now is look quickly at the practice 512 00:40:07 --> 00:40:10 test. I mean, given the time, 513 00:40:10 --> 00:40:15 you will mostly have to think about it yourselves. 514 00:40:15 --> 00:40:23 Hopefully you have a copy of the practice exam. 515 00:40:23 --> 00:40:26 The first problem is a simple problem. 516 00:40:26 --> 00:40:28 Find the gradient. Find an approximation formula. 517 00:40:28 --> 00:40:30 Hopefully you know how to do that. 518 00:40:30 --> 00:40:33 The second problem is one about writing a contour plot. 519 00:40:33 --> 00:40:41 And so, before I let you go for the weekend, I want to make sure 520 00:40:41 --> 00:40:47 that you actually know how to read a contour plot. 521 00:40:47 --> 00:40:51 One thing I should mention is this problem asks you to 522 00:40:51 --> 00:40:55 estimate partial derivatives by writing a contour plot. 523 00:40:55 --> 00:40:57 We have not done that, so that will not actually be on 524 00:40:57 --> 00:40:59 the test. We will be doing qualitative 525 00:40:59 --> 00:41:01 questions like what is the sine of a partial derivative. 526 00:41:01 --> 00:41:04 Is it zero, less than zero or more than zero? 527 00:41:04 --> 00:41:07 You don't need to bring a ruler to estimate partial derivatives 528 00:41:07 --> 00:41:09 the way that this problem asks you to. 529 00:41:09 --> 00:41:35 530 00:41:35 --> 00:41:38 [APPLAUSE] Let's look at problem 2B. 531 00:41:38 --> 00:41:43 Problem 2B is asking you to find the point at which h equals 532 00:41:43 --> 00:41:46 2200, partial h over partial x equals 533 00:41:46 --> 00:41:49 zero and partial h over partial y is less than zero. 534 00:41:49 --> 00:41:53 Let's try and see what is going on here. 535 00:41:53 --> 00:41:57 A point where f equals 2200, well, that should be probably 536 00:41:57 --> 00:41:59 on the level curve that says 2200. 537 00:41:59 --> 00:42:09 We can actually zoom in. Here is the level 2200. 538 00:42:09 --> 00:42:12 Now I want partial h over partial x to be zero. 539 00:42:12 --> 00:42:17 That means if I change x, keeping y constant, 540 00:42:17 --> 00:42:24 the value of h doesn't change. Which points on the level curve 541 00:42:24 --> 00:42:30 satisfy that property? It is the top and the bottom. 542 00:42:30 --> 00:42:34 If you are here, for example, and you move in the x 543 00:42:34 --> 00:42:36 direction, well, you see, 544 00:42:36 --> 00:42:38 as you get to there from the left, 545 00:42:38 --> 00:42:41 the height first increases and then decreases. 546 00:42:41 --> 00:42:44 It goes for a maximum at that point. 547 00:42:44 --> 00:42:47 So, at that point, the partial derivative is zero 548 00:42:47 --> 00:42:53 with respect to x. And the same here. 549 00:42:53 --> 00:42:59 Now, let's find partial h over partial y less than zero. 550 00:42:59 --> 00:43:03 That means if we go north we should go down. 551 00:43:03 --> 00:43:07 Well, which one is it, top or bottom? 552 00:43:07 --> 00:43:11 Top. Yes. Here, if you go north, 553 00:43:11 --> 00:43:16 then you go from 2200 down to 2100. 554 00:43:16 --> 00:43:23 This is where the point is. Now, the problem here was also 555 00:43:23 --> 00:43:25 asking you to estimate partial h over partial y. 556 00:43:25 --> 00:43:28 And if you were curious how you would do that, 557 00:43:28 --> 00:43:33 well, you would try to figure out how long it takes before you 558 00:43:33 --> 00:43:42 reach the next level curve. To go from here to here, 559 00:43:42 --> 00:43:47 to go from Q to this new point, say Q prime, 560 00:43:47 --> 00:43:49 the change in y, well, you would have to read 561 00:43:49 --> 00:43:56 the scale, which was down here, 562 00:43:56 --> 00:44:00 would be about something like 300. 563 00:44:00 --> 00:44:04 What is the change in height when you go from Q to Q prime? 564 00:44:04 --> 00:44:07 Well, you go down from 2200 to 2100. 565 00:44:07 --> 00:44:14 That is actually minus 100 exactly. 566 00:44:14 --> 00:44:19 OK? And so delta h over delta y is 567 00:44:19 --> 00:44:27 about minus one-third, well, minus 100 over 300 which 568 00:44:27 --> 00:44:35 is minus one-third. And that is an approximation 569 00:44:35 --> 00:44:43 for partial derivative. So, that is how you would do it. 570 00:44:43 --> 00:44:48 Now, let me go back to other things. 571 00:44:48 --> 00:44:52 If you look at this practice exam, basically there is a bit 572 00:44:52 --> 00:44:56 of everything and it is kind of fairly representative of what 573 00:44:56 --> 00:45:00 might happen on Tuesday. There will be a mix of easy 574 00:45:00 --> 00:45:03 problems and of harder problems. Expect something about 575 00:45:03 --> 00:45:05 computing gradients, approximations, 576 00:45:05 --> 00:45:08 rate of change. Expect a problem about reading 577 00:45:08 --> 00:45:13 a contour plot. Expect one about a min/max 578 00:45:13 --> 00:45:15 problem, something about Lagrange 579 00:45:15 --> 00:45:17 multipliers, something about the chain rule 580 00:45:17 --> 00:45:20 and something about constrained partial derivatives. 581 00:45:20 --> 00:45:22 I mean pretty much all the topics are going to be there. 582 00:45:22 --> 00:45:23