Hi everyone. Welcome to our lecture on partial derivatives. We've seen what it is to take a derivative of a single variable function. Our focus this lecture is going to be how to talk about what it means to find the derivative of a multi variable function. For a partial derivative, we have two variables going on. This is little more difficult, I think more subtle to find derivatives. The idea is that if you have a function, and here's the generic picture, the magic carpet, and you take f of x, y and I say to you, "All right, let's pick a point," and we pick some random point on the magic carpet, maybe it corresponds, maybe the x-axis comes towards you, the y-axis goes this way. It's right above some point x, y in the plane, call that point P, and I say to you, "Talk to me about the tangent line at that point." The problem is, well, what do you mean? If you want to see this in real life, take your hand and make a fist and look at your knuckle and then try to balance a pencil or pen or whatever you're holding on your knuckle. Close your fist, look at your knuckle and put a pen on it and the idea is that if that pen is just touching the knuckle, you can spin your pen in different directions. This is not obvious anymore butt it means to say the tangent line. In fact, there are lots of tangent lines at this point. You're going to have one perhaps going in the x-direction, you can have another one perhaps going in the y-direction. The slopes of those lines, how steep those lines are growing, their rate of change can be different. It's important when you're in the multi-variable case not to talk about the derivative because there's no such thing as the tangent line. There are in fact many, many, many. What we have to be careful about is what direction are we talking about? Where do we want to look at? Which direction we want to change? We're going to define the partial derivative of a multi-variable function with respect to x. This is denoted as Del f, Del x. Sometimes we say df, dx but this is what it is written as. This is the partial derivative of the multi-variable function with respect to x. I'll abbreviate that as wrt, with respect to x. This is important. The variable that you choose is the variable that goes in the symbol for the partial derivative and the idea behind this is that y is treated as a constant. The partial derivative of a multi-variable function with respect to x is the derivative when y is treated as constant. When you do that, when y is treated as a constant, this multi-variable function then becomes a function of x alone and the partial derivative of f with respect to y is similar. It's similar definition, so we treat x as a constant and y as a variable. This is the idea of partial derivatives. It's interesting. You have multi-variable function that has two variables going on and then you want to look at derivatives, you have to fix a variable, which is the same as fixing a direction. Which variable becomes constant? Which variable stays a variable? You'll see what I mean in some example. This number that we're going to compute, the function that we're going to compute, it's nice to have a geometric interpretation of what it means. Take your 3D axis, multi-variable functions, they live in 3D. Let's just imagine for a minute I have some graph, I don't know what it's doing, but some graph of a function that's over here and this is my f of x, y, so I use a computer to graph this thing. Fantastic. I pick a point, let's pick a point right on this little surface here, and I want you to imagine that that point is you. You are the hiker, you're on a mountain, you're climbing and I ask you, "How steep is the path?" Maybe you have options to which way to go. You could move in the x-direction, you could move in the - direction, maybe it's like north-south or east-west, but if you were to lay a tangent line on that in the x-direction, the slope of that tangent line is the partial derivative with respect to x. This line is the one that moves in the x-direction, whichever way that maybe drawn. Then the other side, if I draw a line in the y-direction and notice by the way, I've held y constant as I'm let x move along its axis. If I do the same thing, if I hold x constant and I let y move, well then I get the line in that direction and the slope, how steep that particular line is, that number, if we evaluated at the point, is the partial derivative of f with respect to y. This is the idea. These are the slopes. They do still represent a slope but it's in a specific direction. If that direction is not clarified, this is ambiguous. It's a very common mistake to say the derivative when we talk in the multi-variable setting. That's incorrect, you have to be very clear about what you mean. Let's do some examples and we'll go through some, how to find these things algebraically. As an example, let's let f of x, y be the function 10x squared, y to the fourth. I would like to compute partial derivatives, so find for me the partial derivative df, dx or Del f, Del x. When you see this, when we're computing x is a variable, the way I want you to think about this is that y is constant, so you treat it just like you would the 10. These pieces are constant. y is a constant, y_4 is a constant 10 x squared, you treat them the same. You got to get to, isn't y variable? Not when I'm looking at things df/dx, the partial derivative of f with respect to x. We treat it all as a constant. If you really want to write it slightly differently, you can write this as 10y_4, and then times x squared. This can help you see it as a constant because remember when you take the derivative of a constant times x square, like if I said it was the derivative of 3x squared, 4x squared, 5x squared. Hopefully, you just ignore the constant in front it comes along for the ride. That's still true. Then you take a derivative with respect to x. Times good old 2x. Partial derivative of y is taken the same way. You get faster as you go through these but if you need to rewrite the function, please do so, y is the variable. I want to think of 10x squared as the big constant that comes along for the ride. When I see an x, I just ignore it, it's a constant. Then I take a derivative of y_4, which of course is 4y cubed. Clean that up a little bit and you get 40x squared y cubed. Notice they are in fact different. They are very different. If I gave you a particular point, you could plug in and get the slope of the tangent line in each direction accordingly, but like derivatives in the single variable case, you will get back functions, and now they will be multivariable functions as you start off with. Let's do another example. Let's take the function, f(x, y) equals 5x squared plus 2xy plus 10y. If you'd like, pause the video, see if you can do it. Takes a little bit of practice to sort of see a variable now is a constant, but I'm still looking for the same thing. Find each of the partial derivatives. I want the partial derivative of f with respect to x and the partial derivative of f with respect to y. Same idea. Let's do the first one again. When I find the partial with respect to x, I treat y as a constant. Let's take this term by term, 5x squared, the variables x, so its derivative is 10x. 2xy, y is a constant for all the same reasons as the last one. I lump it together with the 2. I see this as 2y, that's the constant in front, times x. What's the derivative 5x, 6x, 7x? The partial derivative is 2y. The last one here to be very careful, this is with respect to x. What is the derivative of 10y? Remember y is a big old constant in this case. It's 0 plus 0. Our final answer here, of course, is 10x plus 2y. Do it again, partial derivative of f with respect to y. Here we go, 5x squared. No ys, it is a big constant, so its derivative is 0, it's partial derivative is 0. 2xy, again, think of this as like the constant 2x times y. Its derivative is 2x and then 10y. Nice, easy, normal. Single derivative feeling to it, 2x plus 10. This is what we're looking for when we treat partial derivatives and keeping variables, focusing on one variable at a time. Let's do another one. Practice makes perfect. We have our multivariable function. Let's do start mixing these with some other rules here. Let's do [2x plus 12y minus pi]_4. Same thing. Find the partial derivative df/dx. Of course I want the other one, del f, I say df/dx. A lot of people say df/dx, df/dy, partial derivatives. The symbol here though is truly a del, it's a little special d. This is the notation for partial. This is what we used to say, this really is the partial derivative. Here we go. What do I do? This is like the general power rule, but a little in multivariable sense. All the same rules apply. Think of it as chain rule as well. I'm treating x as the variable y is constant. The 4 comes down. I keep the inside the same. I subtract 1 from the exponent, and then I multiply by the partial derivative of the inside. This is extremely important, partial derivative with respect to x. What does that become? So 2x is 2,12y. This is with respect to x so y is a constant that's 0 minus pi, that's also 0 as well. This is like 2 plus 0 plus 0, just good old 2. You can combine that and get 8[2x plus 2y minus pi cubed]. Partial derivative with respect to y. Same thing, 4 comes down, keep the inside the same. I'm not touching anything. Subtract 1 from the numerator. Then I take a partial derivative of the inside with respect to y. This should feel like the chain rule, the general product rule. All of those things. Here we go, derivative 2x, there's no y's on it, and so 2x is a constant, so that's 0, derivative of 12y, that's just 12. Then derivative of the constant pi, that is still 0. Put them together to get 48. Then [2x plus 12, y minus pi], the whole thing cubed. Starting to get a little more advanced, use our other rules here as we compute partial derivative, all those same rules will apply. Let's do a slightly tougher one. Maybe we'll use an exponent. Let's do f of x,y is e to the xy squared. Same thing. I want the partial with respect to x, and I want the partial with respect to y. Take a second, pause the video, see if you can do it. Exponential rules are in play here. How do we take a derivative of an exponential? We repeat the exponential, and then normally we would times the derivative upstairs. We're still going to do that, but now it's times the partial derivative of what's upstairs, so it is like the Chain rule. Partial derivative upstairs, this is xy squared. We treat y squared is a constant, all of it just like 7. If it is a derivative, 7x what do you say? Hopefully 7. So what's the derivative of xy squared times y squared? Partial derivative of f with respect to y, we have e to the xy squared, same thing. We repeat the exponential times the partial derivative with respect to y of upstairs, x is a constant, comes along for the ride. So x is going to be there, and then the derivative of y squared is times 2y. Notice you don't lose it. You got to bring it all down. So this is another one with an exponential. Let's do one more. Too easy you say. Let's try one more. Let's mix it up a little bit. Let's do x over 4x plus y. Let's play around with this one for a minute. Still multi-variable function, just make sure you grade these x's and y's. So we don't take their derivative instead we take partial derivatives. So what is df, dx, partial derivative of f with respect to x is a quotient, so let's use the quotient rule. Quotient rule says, that up if you need to, bottom function times the derivative of the top. Now we're taking partial derivative, x is the variable, so that's just 1 minus the top function times the partial derivative of the bottom. Partial derivative of the bottom here, so we have 4x, that derivative is 4 and then plus y, the derivative of y is a constant because y with respect to x, this is like 4 plus 0. All over, all over, all over the bottom function, don't touch it, just square it. You can clean this up a little bit. You're going to get 4x and then there's a minus 4x over here that cancels. So your numerator's just y, and you get y over 4x plus y whole thing squared. Last but not least, let's take partial derivative of f with respect to y. Now this is interesting. You could do this a couple of ways. You could do it as a quotient, although maybe we don't have to, maybe we want to rewrite this thing because x is now a constant just like a constant upstairs. So maybe it might be easier to write it as x times 4x plus y all raised to the negative 1. Now we can do the general chain rule, remember x is a constant of front. This is not a product rule, x is a constant. This is not a quotient rule, although you can certainly do it, it'll still be longer. But here we go. Let's do the general power rule. X comes a little off to the right, I bring the minus 1 down, so I got like minus x out here. I keep the inside the same, and then I subtract 1 from minus 1 to get minus 2, and then I don't forget to times the partial derivative of the inside. That's with respect to y. The derivative 4x, they go constant, that 0, plus the derivative of y, which is just 1. Put it all together, you get minus x upstairs, and then I guess you could throw this back downstairs, 4x plus y, the negative 2 at the denominator becomes positive 2. There's a bunch of examples you can see they started using the other rules that you've seen that the single variable case. So make sure you have those handy as you go through and study these. Multi-variable function means exactly that, you can have functions with more than two variables. You can have three variables, four variables, 10 variables. Who cares? The rules still of all apply. So let's take a function of three variables, x, y, and z, and let's come up with some function here. Let's do like xy squared z to the fifth minus 4yz plus e to the z. Why not? Three variables. Now again, still no such thing as their derivative, but we have partial derivative. So I want df/dx, df/dy, and here's a new piece. What's the partial when z is treated as the variable? Again, you just pick one to be the variable and then anything else, I don't care if you have 100 variables, every other variable becomes constant and you view it as a constant and you treat it as a constant. These are really the function of single variable because everything else is held constant, and so we can take these partial derivatives. Let's do this together, df/dx, here's my x, and then the y squared z to the fifth, that's a big whole constant in front. This is like what's the derivative of 2x? You have a constant times a variable, the derivative, without being the variable is the constant in front. So this is y squared z to the fifth minus 4yz There's no x's, so its derivative is 0 and e to the z, there's also no x's, so it is in fact a constant, so both of these derivatives are 0. Final answer for partial derivative with respect to x, y squared, z to the fifth. Let's do same thing for y. What's the derivative here? xz to the fifth is a big whole constant, so it comes along for the ride. You want the derivative of y squared, that's just times 2y. The order doesn't matter how you write it, so rewrite it if you need to. Next piece, y is the variable, so it's derivative is minus 4z, 4 and z are coefficients, in front constant coefficients. e to the z, no variable y, so it is a big whole constant. Its partial derivative with respect to y is 0. Last but not least, df, dz. xy squared. They go constant in front, goes of to the right. Derivative of z to the fifth, 5z to the fourth, minus 4yz minus 4y. It's the coefficients in front of the z, and then plus e to the z. Now that one is finally, we're going to take a derivative here, and the derivative of e to the z is just itself, e to the z. This is what it looks like if they have function of three variables. Again, you could have four, five, 10, we go through the same process. As in the case of functions of one variable, we can define higher order partial derivatives for functions of more than one variable. For example, in single-variable calculus, we took second derivatives, third derivatives, and took derivatives of derivatives. We can do that here. We can take partial derivatives of partial derivatives, but now because we have more than one variable, we can mix and match our variables. For an example, just one specific one, if I want to take the second partial of a function with respect to x, so I want to take my function f of xy, I can take my partial with respect to x. Remember I just get back a new function. When you look at this, you should be, "This is another function." You can take it's partial derivatives, so think of this as taking the partial of f or something like that. Do it again. If I took the partial of the partial, this is the multivariable equivalent, now l'm taking the second derivatives. The notation for this is d squared or del squared f over del x squared. Notice where the squareds go on this thing. Again, this symbol is not a fraction, this just means the second partial derivative with respect to x. So you do treat x as the variable, take a partial, and then do it again. You can do this for y, you could do it for z, you can do whatever you want. You can also compute what are called mixed partials. A mixed partial is when I first compute a partial derivative of the function with respect to x. Now I take the partial with respect to y of the partial with respect to x. Again, you can mix and match these all day long, and you get what you call the mixed partial. First you treat x as a variable, then you treat y as the variable, and you just get a new function back. The way you write this when you combine this notation is you get dy, dx. Notice the order, you read the order from right to left, so I take the partial of x first, and then I take the partial with respect to y. It may look like order's going to matter here, which one you do. But all the functions that you're going to encounter in the applications and all the functions in this class, they will have the wonderful property. This is a property, this is also known as Clairaut's Theorem that says that the partial derivative of a multivariable function dy, dx is going to be equal to the partial derivative of dx, dy, del x, del y down. What this says in words is that mixed partials commute. This is the way that people read this. They say the order doesn't matter, which way you do this. This is a nice way actually to check if you took partial derivatives correctly. We say mixed partials commute. Sometimes this is called the mixed partials theorem or something like that. It just says the order doesn't matter when you start taking mixed partials. It says nothing about the single partial derivatives, only about mixed partial derivatives. Let's do one example, and we'll see this in action, and we'll practice this. All right, so let's see this as an example. Let's look at the function f of x, y is the natural log of xy. I want to get to this statement to show this mixed partials commute, so lets start taking partials first, df, dx. What's the rule for logarithm? How do you find the derivative of a logarithm, is just take one over the thing in parentheses. So this would be one over xy. But then chain rule kicks in, times the derivative of the inside with respect to x. This is like 5x, 7x, 9x, yx, and it's times y. The y's cancel and you get one over x. It's nice. I have a nice cancellation going on there. A similar partial derivative with respect to y, you get one over xy, and then times the partial derivative of the inside. For all the same reasons, that's just x. The x's cancel and you get one over y. Now let's start taking mixed partials. Let's take the mixed partial dy, dx. Remember the order here that says to grab the x you found and take its partial with respect to y. This is d, dy of one over x. In this case here, one over x there is, there's no variables y, so you treat it like a constant and you get zero. On the other hand, if I took the other order dx, dy that says take the partial with respect to x of the partial derivative with respect to y. This is one over y. Again, there's no x's in one over y, so one over y is a bit constant when x is treated as the variable. This gives you zero. They match, and that is what this theorem is saying, what this property is saying, is that that is not a coincidence, that will always happen. You won't always get zero, I just picked an easy example here to start off with. You'll do more problems where you'll see these things, but you won't always get zero, but they'll always match. This is a nice little, you can use this to check and determine if your partial derivatives are correct or not. All right, good job on this video, will see you all next time.