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.

## Multivariable calculus

### Course: Multivariable calculus>Unit 2

Lesson 2: Gradient and directional derivatives

# Directional derivatives and slope

The directional derivative can be used to compute the slope of a slice of a graph, but you must be careful to use a unit vector.  Created by Grant Sanderson.

## Want to join the conversation?

• Can someone further explain the reason for switching from [1 1} to [sqrt2/2 sqrt2/2]? Can you just do that for any problem and if so how? In other words: Why is the unit vector [sqrt2/2 sqrt2/2]? And how does one determine the unit vector for a given problem? •  You simply divide both part of that vector with its absolute value. If v=ai+bj then unit vector is (a / sqrt(a^2+b^2) i + (b / sqrt(a^2+b^2) j. In this case it results in 1/sqrt(2) i + 1/sqrt(2) j . But what he doesn't mention is that he uses some algebra to transform 1/sqrt(2) into sqrt(2)/2 . Those two are basically the same ( just multiply both parts of the fraction with sqrt(2)
• I dont get why directional vector has to be a unit vector. It still shows direction why it has to be a unit vector. Could someone clarify please? thanks • First imagine two non-unit vectors with the same direction like [5,5] and [10,10], now plug in those values into the formula and it will become obvious the magnitude of the derivative of [10,10] vector will be larger even its direction is the same as the one of [5,5]. What the directional derivative calculates is how much an output function changes with respect to the DIRECTION you're going, NOT MAGNITUDE. If it's still not clear, imagine that you have a function f(x,y) = | a(x),g(y) | ,and you have a vector V which is equal to [5,5]. So to find the directional derivative of f(x,y) with respect V ,you would multiply ∇f(x,y) by the unit vector of V(which is[1/sqrt(2),1/sqrt(2)). But if you multiplied ∇f(x,y) by [5,5], then your result would be larger just because of the magnitude. Another way to think of unit vector is that it shows how much x and y change with respect to its length like if your vector is [1,0] then your direction is towards x axis only, so you would only consider a(x) because you are not moving in y direction, but vector [9999,0] has the same direction, however if you plug it expect for the unit vector, your result will be larger just as you multiplied your derivative by 9999. What unit vector does is showing how many % of a meter you go on x and y as you go one meter forth on your vector, so it would be illogical to have something larger than 1.
• While the partial derivatives tells us how the value of the function changes when we change in x or y alone, the directional derivative tells us how the function would change if change both x and y at the same time. That is if we change the input by a vector which has components both in x and y directions.

So the directional derivative is like generalizing the concept of the partial derivative to all directions?

Am I correct? • Sure you could look at it that way.

I feel a better way to look at it is that partial derivatives actually tell us the "directional derivate" along the î vector (for x derivative) and j vector (for y derivative). And now we're generalizing this to any arbitrary vector v.
• In my textbook the definition of directional derivative is: ∇Ƒ(a,b) • u (any unit vector)
Why you don't like the normalized vector definition? • at , I m lost why instead of saying [1 1], it is changed to [ sqrt(2)/2 sqrt(2)/2)]? • He wants a vector with unit length, that is length 1. The vector <sqrt(2)/2, sqrt(2)/2> has length one. You can can imagine this vector on a 2d plane - it is sqrt(2)/2 long in the x-axis, and sqrt(2)/2 long in the y axis. We can then use pythagoras to find the length of the vector = sqrt((sqrt(2)/2)^2) + (sqrt(2)/2)^2) = sqrt(2/4 + 2/4) = 1.
• How did you get ((2)^0.5)/2? • How come when we find the gradient of a function, it return a vector, but with the partial derivative, it only return a value? • Just by definition, the gradient is the vector comprised of the two partial derivatives, while each partial derivative is just the derivative that focuses on one variable.

It might help to think of it as the partials each focus on one while the gradient is taking into account both variables , so to describe both variables we need one "thing" that has both at once. A vector can have as many elements as we like so it works out.

More technically, a partial derivative gives the derivative with respect to one variable while holding the other constant. The gradient meanwhile describes what direction you want to face, so that a point on the surface graphed, you move in the direction of steepest ascent. I don't know if this video is after that particular detail was discussed. Basically though the gradient will tell you a vector int he xy plane and you imagine a pont on the surface f(x,y) that has a "forward" direction, then you twist it so the forward direction is in line with that vector.

I really hope this made sense. Let me know if not though.
• So... the directional vector doesn't have to an unit vector? Doesn't that affect the result?
And doesn't the gradient have to be unit length too?
I am confused about how the length of a vector affects its direction...   