If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Graphical understanding of partial derivatives

One of the best ways to think about partial derivatives is by slicing the graph of a multivariable function.  Created by Grant Sanderson.

Want to join the conversation?

  • blobby green style avatar for user jacobs.ivan26
    If the derivative of a constant*variable = constant how come in the first evaluation the partial derivative respect to x =>x²*y=2xy and in the second evaluation the partial derivative respect to y=>x²*y=x². I know that the power rule but don't understand why the place of the constant matters.
    (4 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Thanh To Minh
      But the place of the constant doesn't matter. In the first evaluation of partial derivative respect to x => x^2y = 2xy because we are considering y as constant, therefore you may replace y as some trivial number a, and x as variable, therefore derivative of x^2y is equivalent to derivative of x^2.a which is 2a.x , substitute trivial a with y and we have 2xy. In the latter case we considering x as trivial a and y as constant so we get 1.x^2
      (13 votes)
  • blobby green style avatar for user 魏 凡淳
    I understand the video, but for only 2 variables,how can you have 3-dimention image
    (3 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user siahranova
      not sure exactly what you mean but i'll try and answer.

      If you mean you don't understand why we have a 3d image for a problem with 2d input it's because the 3rd dimension represents your output.

      If you mean you get how this works for 2 variables but like to see how it looks for 3, we can't really graph that since our brain can't perceive a fourth dimension. I think this is what he was getting at, the graphical intuition is good but gets you only thus far with multivariable calculus because of the high dimensionality. There is still ways to represent such functions graphically, plotting input and output separately for example is what comes to mind, but I am just starting to learn calculus, so someone more advanced needs to answer.
      (9 votes)
  • blobby green style avatar for user Santhosh Kumar
    The equation in the video using only x and y but the graph also has the z-axis. So can we assume that the z was missing as part of the equation?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • male robot johnny style avatar for user klr5240
    what software are you using to make the plot? what about the plane?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • marcimus pink style avatar for user Ahmed Shawky
    I'm having hard time to visualize the partial derivative of a sphere,
    if we for example took the y-axis as our constant plane, then we would have two different (z) values for a given (x) value, each of which has different slope (derivative).
    As a representation for this part it would look like a circle, so the two different (z) values would be as follows : the upper value and the lower value; and they will have slopes that are opposite to each other in signs.
    Hence, our partial derivative function should return 2 different answers, one for the upper (z) value and one for the lower (z) value. But this simply doesn't happen, can someone explain to me. It would be great if there were a graphical representation of this situation.
    Thanks in advance :)
    (2 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user libin kaleeckal
      I don't know how well I could answer your question

      As you said ,the part would look like a circle
      Let's assume the equation of the sphere as z^2 +x^2+y^2=25
      and let our constant y plane be y=2

      So the circle's equation will be

      Now the equation of the upper half of the circle will be
      and lower part of the circle will be

      So accordingly we use these two equations

      So it doesn't return 2 different answers
      Hope it helped a bit
      (3 votes)
  • blobby green style avatar for user Hexuan Sun 9th grade
    I'm confused about the pronunciations of multi, because if it's multivariable, people pronunce multi as mult-ee. But if it's multidemensional@, he pronunced it as mult-eye.
    (1 vote)
    Default Khan Academy avatar avatar for user
  • male robot donald style avatar for user fxxjmm
    how do i know that this is the 3d graph i get before starting to solve the problem?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • leafers sapling style avatar for user ashrafkamel491
    the partial derivative with respect to X equals 2XY
    how come the graph is a shifted square At ?? shouldn't it be a straight line because Y is const?
    and although the derivative equals a negative number (-2)
    the point was in the positive Z axis
    and at the same point the Y partial derivative gives a totally different value 1.9
    then how did we draw this 3D graph?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • hopper jumping style avatar for user Yuya Fujikawa
      You are correct, that the partial derivative with respect to x is 2xy, and that y is a constant. The plane (the cross section) of the graph at is JUST how the function f, looks like, when y = +1, right? And we are saying, that indeed, the derivative of that parabolic looking cross section when y = 1 is 2xy. At , that 2xy shows up. Right? So that parabola is just THE FUNCTION F, when y = 1, and NOT the derivative. When we take the derivative OF THAT CROSS SECTION, we get 2xy, just to emphasize. Have a nice day ); ^^
      (2 votes)
  • blobby green style avatar for user vishnu balaji
    how do you actually plot this two variable function and with respect to what are you finding the derivative..? it was pretty easy to visualize in a single variable...please do answer...thanx
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Bhanu Sai Teja Marisa
    I have a doubt how x^2y+sin(y) is shown in 3d model it's a 2d right? that means function is z right! Why should it be taken like that? Since we have only 3d!
    (1 vote)
    Default Khan Academy avatar avatar for user

Video transcript

- [Voiceover] Hello everyone. So I have here the graph of a two-variable function and I'd like to talk about how you can interpret the partial derivative of that function. So specifically, the function that you're looking at is f of x, y is equal to x squared times y plus sine of y. And the question is, if I take the partial derivative of this function, so maybe I'm looking at the partial derivative of f with respect to x, and let's say I want to do this at negative one, one so I'll be looking at the partial derivative at a specific point. How do you interpret that on this whole graph? First, let's consider where the point negative one, one is. If we're looking above, this is our x-axis, this is our y-axis the point negative one, one is sitting right there. So negative one, move up one and it's the point that's sitting on the graph. And the first thing you might do is you say well, when we're taking the partial derivative with respect to x, we're going to pretend that y is a constant so let's actually just go ahead and evaluate that. When you're doing this, x squared looks like a variable, y looks like a constant, sine of y also looks like a constant. So this is going to be... We differentiate x squared and that's two times x times y which is like a constant, and then the derivative of a constant there is zero and we're evaluating this whole thing at x is equal to negative one and y is equal to one. So when we actually plug that in, it would be two times negative one multiplied by one, which is two... Negative two, excuse me. But what does that mean, right? We evaluate this, and maybe you're thinking this is kind of slight nudge in the x direction, this is the resulting nudge of f. What does that mean for the graph? Well first of all, treating y as a constant is basically like slicing the whole graph with a plane that represents a constant y value. So this is the y-axis, and the plane that cuts it perpendicularly that represents a constant y value. This one represents the constant y value one but you could imagine sliding the plane back and forth and that would represent various different y values. So for the general partial derivative, you can imagine whichever one you want but this one is y equals one and I'll go ahead and slice the actual graph at that point and draw a red line. And this red line is basically all the points on the graph where y is equal to one. So I'll emphasize that... where y is equal to one. This is y is equal to one. So, when we're looking at that we can actually interpret the partial derivative as a slope because we're looking at the point here, we're asking how the function changes as we move in the x direction. From single variable calculus, you might be familiar with thinking of that as the slope of a line and to be a little more concrete about this, I could say you're starting here, you consider some nudge over there, just some tiny step. I'm drawing it as a sizable one but you imagine it as a really small step, as your dx, and then the distance to your function here the change in the value of your function... I said dx, but I should say partial x or del x... Partial f. And as that tiny nudge gets smaller and smaller, this change here is going to correspond with what the tangent line does, and that's why you have this rise over run feeling for the slope. And you look at that value, and the line itself looks like it has a slope of about negative two so it should actually make sense that we get negative two over here given what we're looking at. But let's do this with the partial derivative with respect to y. Let's erase what we've got going on here and I'll go ahead and move the graph back to what it was, get rid of these guys, so now we're no longer slicing with respect to y, but instead let's say we slice it with a constant x value. So this here is the x-axis; this plane represents the constant value x equals negative one and we can slice the graph there. Kind of slice it, I'll draw the red line again that represents the curve and this time, that curve represents that value x equals negative one. It's all the points on the graph where x equals negative one. And now when we take the partial derivative, we're going to interpret it as a slice... As the slope of this resulting curve. So that slope ends up looking like this, that's our blue line, and let's go ahead and evaluate the partial derivative of f with respect to y. So I'll go over here, use a different color so the partial derivative of f with respect to y, partial y. So we go up here, and it says, okay. So x squared times y. It's considering x squared to be a constant now. So it looks at that and says x, you're a constant, y, you're the variable, constant times a variable, the derivative is just equal to that constant. So that x squared. And over here, sine of y, the derivative of that with respect to y is cosine y. Cosine y. And if we actually want to evaluate this at our point negative one, one what we'd get is negative one squared plus cosine of one. And I'm not sure what the cosine of one is but it's something a little bit positive, and the ultimate result that we see here is going to be one plus something, I don't know what it is, but it's something positive, and that should make sense 'cause we look at the slope here and it's a little bit more than one. I'm not sure exactly, but it's a little bit more than one. So you often hear about people talking about the partial derivative as being the slope of the slice of a graph. Which is great, if you're looking at a function that has a two-variable input and a one-variable output, so that we can think about its graph. And in other contexts, that might not be the case. Maybe it's something that has a multidimensional output, we'll talk about that later, when you have a vector-valued function, what its partial derivative looks like, but maybe it's also something that has a hundred inputs and you certainly can't visualize the graph but the general idea of saying, "Well, if you take a tiny step in a direction"-- here, I'll actually walk through it in this graph's context again. You're looking at your point here and you say we're going to take a tiny step in the y direction. And I'll call that partial y. And you say that makes some kind of change, it causes a change in the function which you'll call partial f. And as you imagine this getting really really small, and the resulting change also getting really small the rise over run of that is going to give you the slope of the tangent line. So this is just one way of interpreting that ratio, the change in the output that corresponds to a little nudge in the input. But later on we'll talk about different ways that you can do that. So I think graphs are very useful (laughs)... When I move that, the text doesn't move. I think graphs are very useful for thinking about these things, but they're not the only way and I don't want you to get too attached to graphs even though they can be handy in the context of two-variable input, one-variable output. See you next video!