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

# Directional derivative

## Video transcript

hello everyone so here I'm going to talk about the directional derivative and that's a way to extend the idea of a partial derivative and partial derivatives if you'll remember have to do with functions with some kind of multi variable input and I'll just use two inputs because that's the easiest to think about and it could be some single variable output it could also deal with vector variable outputs we haven't gotten to that yet so we'll just think about a single variable ordinary real number output that's you know an expression of x and y and the partial derivative one of the ways that I said you could think about it is to take a look at the input space your x and y plane so this would be the x axis this is y and you know vaguely in your mind you're thinking that somehow this outputs to a line this outputs to just the real numbers and maybe you're thinking about a transformation that takes it there or maybe you're just thinking okay this is the input space that's the output and when you take the partial derivative at some kind of point so I'll write it out like partial derivative of F with respect to X at a point like 1/2 you think about that point you know 1 Y is equal to 2 and if you're taking with respect to X you think about just nudging it a little bit in that X direction and you see what the resulting nudge is in the output space and the ratio between the size of that resulting nudge and the original one the ratio between you know partial F and partial X is the value that you want and when you did it with respect to Y you know you were thinking about traveling in a different direction maybe you you nudge it straight up and you're wondering okay how does that influence the output and the question here with directional derivatives what if you have some vector V I'll give a little vector hat on top of it that you know I don't know let's say it's negative 1/2 is the vector so you'd be thinking about that as a step of negative 1 in the X direction and then 2 more in the Y direction so it's going to be something that ends up there this is your vector V at least if you're thinking of V is stemming from the original point and you're wondering what does it nudge in that direction due to the function itself and remember with these original you know nudges in the X Direction nudges in the Y you're not really thinking of it is you know this is kind of a large step you're really thinking of it is something eating any bitty bit of a tea you know it's not that but it's really something very very small and formally you'd be thinking about limit as this gets really really really small approaching zero and this gets really really small approaching zero what does the ratio of the two approach and similarly with the Y you're not thinking of it is something this is this is pretty sizable but it would be something really really small and the directional derivative is similar you're not thinking of the actual vector actually taking a step along that but be thinking of taking a step along say H multiplied by that vector and H might represent some really really small numbers I know maybe this here is like 0.001 and when you're doing this formula you just be thinking the limit as H goes to zero so the directional derivative is saying when you take a slight nudge in the direction of that vector what is the resulting change to the output and one way to think about this is you say well that's slight nudge of the vector if we actually expand things out and we look at the definition itself it'll be negative H negative one times that component and then to H here so it's kind of like you took negative one nudge in the X direction and then two nudges in the Y direction you know so for whatever your whatever your nudge in the V Direction there you take a negative one step by X and then 2 of them up by Y so when we actually write this out the notation by the way is you take that same nabla from the gradient but then you put the vector down here so this is the directional derivative in the direction of V and there's a whole bunch of other notations too you know I think there's like derivative of F with respect to that vector is one way people think about it some people will just write like partial with a little subscript vector there's a whole bunch of different notations but this is the one I like you think that nabla with a little little F down there with a little V for your vector of F and it's still a function of x and y and the reason I like this is it's indicative of how you end up calculating it which I'll talk about at the end of the video and for this particular example a good guess that you might have is to say well we take a negative step in the X direction so you think of it as whatever the change that's caused by such a step in the X Direction you do the negative of that and then it's two steps in the Y direction so whatever the change caused by a tiny step in the Y direction let's just take two of those two times partial F partial Y and this is actually this is Iraq is actually how you calculate it and if I was going to be more general you know let's say we've got a vector W I'm going to keep it abstract and just call it a and B as its components other than the specific numbers you would say that the directional derivative in the direction of W whatever that is of F is equal to a times the partial derivative of F with respect to X plus B times the partial derivative of F with respect to Y and this is it this is the formula that you would use for the directional derivative and again the way that you're thinking about this is you're really saying you know you take a little nudge that's a in the X direction and B in the Y direction so this should kind of make sense and sometimes you see this written not with respect to the partial derivatives themselves and the actual components a and B but with the with respect to the gradient and this is because it makes it much more compact more general if you're dealing with other dimensions so I'll just write it over here if you look at this expression it looks like a dot product if you take the dot product of the vectors a B and the one that has the partial derivatives in it so what's lined up with a is the partial derivative with respect to X partial F partial X and what's lined up with B is the partial derivative with respect to Y and you look at this and you say hey a B I mean that's that's just the original vector right that's W that's the vector W and then your dotting this with well partial derivative with respect to X and one component the other partial derivative and the other component that's the dirt that's just the gradient that is the gradient of F and here you know it's nabla without that little that little W at the bottom and this is why we use this notation because it's so suggestive of the way that you ultimately calculate it so this is this is really what you'll see in a textbook or C as the compact way of writing it and you can see how this is more flexible for dimensions so if we were talking about something that has like a five dimensional input the vector the direction you move has five different components this is flexible when you expand that the gradient would have five components and the vector itself would have five components so this is the directional derivative and how you calculate it and the way you interpret you're thinking of moving moving along that vector by a tiny nudge by a tiny you know little value multiplied by that vector and saying how does that change the output and what's the ratio of the resulting change and in the next video I'll clarify that with the formal definition of the directional derivative itself