Directional Derivatives and the Gradient
Bundle the partial derivatives into one vector, the gradient . It points straight uphill, its length is how steep that is, and the slope in any other direction is just .
What the symbols mean
- Gradient
The vector of partial derivatives. Read 'del f'.
- Unit direction
Must have length 1.
- Directional derivative
The slope of f moving in the direction u.
Explanation
A directional derivative is simply the slope you feel if you walk across a hillside in some particular direction, not just due east or due north. The gradient is an arrow that points the steepest way uphill. The formula looks dense, but it's just two pieces: (the slopes east and north, packed into one arrow) and (the direction you're walking, as an arrow of length 1). Dot them together and you get your slope. It's not as bad as it looks; bear with it.
Partial derivatives only give the slope in two directions, along the axes. But you can walk across a hill at any angle. So what's the slope heading northeast?
Why a dot product. Take a small step of length in direction . That changes by and by . By the differential, changes by about . Divide by the step length to get the slope, and what's left, , is exactly . That's why the gradient shows up.
What the gradient tells you. Now bring back the other face of the dot product: , and , so , where is the angle between your direction and the gradient. That one formula tells you everything:
- It's largest when points along , where . That's steepest ascent, with slope .
- It's most negative in the opposite direction, steepest descent.
- It's zero when you walk perpendicular to . Zero slope means the height isn't changing, so you're walking along a level curve.
Putting the last point another way, the gradient is always perpendicular to the level curves, pointing toward higher values. On a hiking map, it points straight across the contour lines, uphill.
A common mistake. It's tempting to plug in whatever direction vector you're given, like , because it already points the right way. But the derivation above assumed has length , and a longer vector inflates the answer by its length. Normalize first: with , use .
See it
Worked examples
Find the rate of change of at in the direction of .
- 1
The gradient is , which is at .
Practice
Type your answer and check it. Solve them all to complete the lesson.
Find for at .
Find the directional derivative of that at in the direction .
For at , find in the direction of .
What is the maximum rate of increase of at ?
Give the unit direction of steepest descent of at .
A rover drives over terrain of height (meters). At it heads northeast, in the direction . How steep is its path there, in meters of climb per meter driven?
The hardest one here. Get it, and you've got this lesson.
For at , in which directions does increase at a rate of exactly ? Give both directions as angles from the positive -axis, in degrees.
Where it's used
Gradient descent, the algorithm that trains nearly every machine learning model, repeatedly steps in the direction of . Water running downhill and heat flowing from hot to cold follow negative gradients too.