Module 7 · Lesson 7.2
The Gradient — Finding the Steepest Direction
Bundle the partial derivatives together into a single vector that points directly toward the steepest uphill direction.
Intuition
Knowing the slope along x and the slope along y separately is useful, but neither one alone tells you the single best direction to walk if you want to climb as fast as possible. Combine them into one vector, and that vector does exactly that: it points in the steepest uphill direction, and its length tells you just how steep that climb is.
Core concept
The gradient $\nabla f$ is simply the two partial derivatives packaged together as a vector, $\left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}\right)$. On a contour map, this vector always points perpendicular to the contour lines, straight toward higher elevation — which is exactly why hiking trails that hug a single elevation always run perpendicular to the gradient at every point.
Interactive Lab
The dashed ellipses are contour lines of the same terrain, each one a constant-elevation ring. Slide the point along $y = 2$ and watch the gradient arrow — it always points inward, perpendicular to the local contour, straight toward the peak.
Key Idea
The gradient is nothing more than the two partial derivatives, bundled into a vector. Its direction is the steepest way uphill at that point; its magnitude is exactly how steep that climb is.
Think Further
- On a contour map, hiking trails that run exactly perpendicular to the gradient arrows stay at constant elevation. Why does moving perpendicular to the gradient never change your height?
- Predict: at a point where the gradient vector has magnitude 0, what does that say about the terrain there? (Connect this back to Lesson 7.1's peak example.)
- If you always walked in the exact direction the negative gradient points, rather than the gradient itself, where would you eventually end up on this lesson's terrain?
Show suggested answers
- The gradient points in the direction of maximum increase, so any direction perpendicular to it has zero component along that increase — moving along a contour line, by definition, keeps your height exactly unchanged.
- A magnitude of 0 means every partial derivative is 0 at that point too, so the terrain is flat in every direction — exactly matching Lesson 7.1's peak, where both partials vanished at the local maximum.
- Walking against the gradient always moves you downhill as steeply as possible, so you'd eventually settle at the lowest point in that region — moving away from the peak rather than toward it.