So let's say I have some multivariable function like f of xy, so it'll have a two variable input is equal to, I don't know, x squared times y plus sine of y. So it'll output just a single number, it's a scalar valued function. Question is, how do we take the derivative of an expression like this?
And there's a certain method called a partial derivative which is very similar to ordinary derivatives and I kinda wanna show how they're secretly the same thing. So to do that, let me just remind ourselves of how we interpret the notation for ordinary derivatives. So if you have something like f of x is equal to x squared, and let's say you want to take its derivative, and I'll use the Leibniz notation here, df dx, and let's evaluate it at two, let's say. I really like this notation because it's suggestive of what's going on. If we sketch out a graph, so you know this axis represents our output, this over here represents our input, And x squared has a certain parabolic shape to it, something like that.
Then we go to the input, x equals one, two. This little dx here, I like to interpret as just a little nudge in the x direction, and it's kind of the size of that nudge. And then df, df, is the resulting change in the output after you make that initial little nudge.
So it's this resulting change. And when you're thinking in terms of graphs, this is slope, you kind of have this rise over run. for your ratio between the tiny change of the output that's caused by a tiny change in the input. And of course this is dependent on where you start. Over here we have x equals two.
But you could also think about this without graphs if you really wanted to. You might just think about, you know, your input space is just a number line and your output space also is just a number line, the output of f over here. And really you're just thinking of somehow mapping numbers from here onto the second line. And in that case, your initial nudge, your initial little dx, would be some nudge on that number line, and you're wondering how that influences the function itself. So maybe that causes a nudge that's four times as big, and that would mean your derivative is four at that point.
So the reason that I'm talking about this is because over in the multivariable world, we can pretty much do the same thing. You know, you could write df dx and interpret that as saying, hey, how does a tiny change in the input in the x direction influence the output? But this time, the way that you might visualize it, you'd be thinking of your input space, here I'll draw it down here, as the xy plane. So this time, this is not gonna be graphing the function, this is every point on the plane is an input. And let's say you were evaluating this at a point like one, two, okay?
In that case, so you'd go over to the input that's one and then two. And then you'd say, okay, so this tiny nudge in the input, this tiny change dx, how does that influence the output? And in this case, the output, I mean, it's still just a number, so maybe we go off to the side here, and we draw just like a number line as our output, and somehow we're thinking about the function as mapping points on the plane to the number line.
So you'd say, okay, that's your dx, how much does it change the output? And, you know, maybe this time it changes it negatively. It depends on your function. and that would be your df.
And you can also do this with the y variable, right? There's no reason that you can't say df dy and evaluate at that same point, one, two, and interpret totally the same way, except this time your dy would be a change in the y direction. So maybe I should really emphasize here that that dx, that that dx is a change in the x direction here, and that dy is a change in the y direction.
And maybe when you change your f according to y, it does something different, right? Maybe, you know, the output increases and it increases by a lot. It's more sensitive to y. Again, it depends on the function.
And I'll show you how you can compute something like this in just a moment here, but first, there's kind of an annoying thing associated with partial derivatives where we don't write them with d's in dx, df. People came up with this new notation mostly just to emphasize to the reader of your equation that it's a multivariable function involved. And what you do is you say, you write a d but it's got kind of a curl at the top.
It's this new symbol, and people will often read it as partial. So you might read like partial f, partial y. If you're wondering, by the way, why we call these partial derivatives, it's sort of like this doesn't tell the full story of how f changes, because it only cares about the x direction.
Neither does this. This only cares about the y direction. So each one is only a small part of the story. So let's actually evaluate something like this. I'm gonna go ahead and clear the board over here.
I think the one-dimensional analogy is something we probably have already. So, little remnants. So if you're actually evaluating something like this, here I'll write it again up here, partial derivative of f with respect to x, and we're doing it at one, two, it only cares about movement in the x direction, so it's treating y as a constant. It doesn't even care about the fact that y changes.
As far as it's concerned, y is always equal to two. So we can just plug that in ahead of time. So I'm gonna say partial partial x, this is another way you might write it, put the expression in here, and I'll say x squared, but instead of writing y, I'm just gonna plug in that constant ahead of time, because when you're only moving in the x direction, this is kind of how how the multivariable function sees the world.
And I'll just keep a little note that we're evaluating this whole thing at x equals one. And here, this is actually just an ordinary derivative. This is an expression that's an x. You're asking how it changes as you shift around x.
And you know how to do this. This is just taking the derivative. The derivative of x squared times two is gonna be four x, because x squared goes to two x.
And then the derivative of a constant, sine of two is just a constant, is zero. And of course we're evaluating this at x equals one, so your overall answer is gonna be four. And just for practice, let's also do that with the derivative with respect to y.
So we look over here, I'm gonna write the same thing. You're taking the partial derivative of f with respect to y, we're evaluating it at the same point, one, two. This time it doesn't care about movement in the x direction, so as far as it's concerned, that x just stays constant at one, so we'd write one squared, times y plus sine of y, sine of y. And you're saying, oh, I'm keeping track of this at y equals two. So that's kind of your evaluating at y equals two.
When you take the derivative, this is just one times y, so the derivative is one. This over here, the derivative is cosine, cosine of y. Again, we're evaluating this whole thing at y equals two.
So your overall answer, it would be, you know, one plus cosine of two. I'm not sure what the value of cosine of two is off the top of my head, but that would be your answer. And this is a partial derivative at a point. But a lot of times, you're not asked to just compute it at a point. What you want is a general formula that tells you, hey, plug in any point x, y, and it should spit out the answer.
So let me just kind of go over how you would do that. It's actually very similar, but this time, instead of plugging in the constant ahead of time, We just have to pretend that it's a constant. So let me make a little bit of space for ourselves here. Really, we don't need any of this anymore. I'm gonna leave the partial partial f, partial partial y.
We want this as a more general function of x and y. Well, we kind of do the same thing. We're gonna say that this is, you know, derivative with respect to x, and I'm using partials just to kind of emphasize that it's a partial derivative.
But now we'd write x squared, and then kind of emphasize that it's a constant value of y, plus the sine, and again, I'll say y, and here, I'm writing the variable y, but we have to pretend like it's a constant. You're pretending that you plug in two or something like that and you still just take the derivative. So in this case, the derivative of x squared times a constant is just two x times that constant. Two x times that constant. And over here, the derivative of a constant is always zero.
So that's just always gonna be zero. So this is your partial derivative as a more general formula. If you plugged in one two, To this, you'd get what we had before. And similarly, if you're doing this with f of, partial f, partial y, we write down all of the same things, now you're taking it with respect to y, and I'm just gonna copy this formula here, actually. But this time we're considering all of the x's to be constants.
So in this case, when you take the derivative with respect to y of some kind of constant, you know, constant squared is a constant, times y, it's just gonna equal that constant. So this is gonna be x squared. And over here, you're taking the derivative of sine of y, there's no x's in there, so that remains the sine of y.
If we can clear it. And now this is a more general formula. If you plugged in one, two, you would get one, oh sorry, that's cosine of y.
Cosine of y. because we're taking a derivative. So if you plugged in one, two, you know, you would get one plus the cosine of one, which is what we had before. So this, this is really what you'll see for how to compute a partial derivative. You pretend that one of the variables is constant, and you take an ordinary derivative.
And in the back of your mind, you're thinking this is because you're just moving in one direction for the input, and you're seeing how that influences things, and then, you know, you might move in one direction for another input and see how that influences things. In the next video, I'll show you what this means in terms of graphs and slopes, but it's important to understand that graphs and slopes are not the only way to understand derivatives, because as soon as you start thinking about vector-valued functions, or functions with inputs of higher dimensions than just two, you can no longer think in terms of graphs, but this idea of nudging the input in some direction, seeing how that influences the output, and then taking the ratio, you know, the ratio of that output nudge to the input nudge, that's a more general way of viewing things, and that's gonna be very helpful. Moving forward in multivariable caps.