Visual walkthrough — Gradient as direction of steepest ascent
We assume you know only this: a function gives a height for every point on the ground. Everything else — slopes, dot products, "fastest" — we earn as we go.
Step 1 — A hill is a height map
WHAT. Picture a landscape. Every spot on the flat ground has an address : how far east () and how far north (). The function hands you back one number — the height of the land at that spot.
WHY. Before we can talk about "steepest", we need a thing that has a steepness. A height map is that thing. We draw it two ways: as a 3-D surface, and as a contour map — the flat top-down view where we join up all the points at the same height with a loop, exactly like a hiking map.
PICTURE. The left panel is the 3-D hill (a bowl). The right panel is the same hill seen from directly above: each pale-blue loop is a level curve, a set of points all at one fixed height. Loops close together = steep ground; loops far apart = gentle ground.

Step 2 — "Which way is a direction?" — the unit arrow
WHAT. Standing at a point, you can walk in infinitely many directions. We label each direction with a little arrow . Here is how much of the step goes east, how much goes north.
WHY. We are going to compare directions fairly. If one arrow were long and another short, a longer arrow would seem to change the height more just because it's a bigger step — not because that direction is genuinely steeper. So we force every direction-arrow to have the same length, exactly 1. That length is written .
Here is the squared length (east-leg + north-leg, a right triangle), and the square root turns it back into a length. Setting it to pins every arrow onto a circle of radius one.
PICTURE. All candidate direction-arrows fan out from the point; their tips trace the yellow unit circle. Every arrow is a fair, equal-length step.

Step 3 — How fast does height change along one arrow?
WHAT. First, a shorthand: instead of writing the starting point as the pair every time, we bundle those two numbers into a single position vector and call it ==== — one bold letter that means the point you are standing on. Now pick one direction . Take a tiny step of size along it, so you land at the new point (start, plus worth of the direction arrow). Measure how much the height changed, then divide by how far you stepped. Shrink the step to zero. That limiting ratio is the directional derivative .
Here is the point you start at, is the point after a step of length in direction . The numerator is change in height; the denominator is distance walked. Rise over run — a slope.
WHY a limit? Because the hill curves. Over a big step the slope isn't constant, so a big-step ratio would be an average, not the true slope right here. Shrinking zooms in until the ground looks flat and the ratio settles to one honest number: the steepness in that direction, at that exact spot.
PICTURE. We slice the hill with a vertical plane containing the arrow . The cut edge is a 1-D curve; is the slope of that curve at the point (the pink tangent line).

Step 4 — Stop taking infinitely many limits: the chain rule
WHAT. Computing that limit fresh for every one of the infinitely many arrows is hopeless. Instead, walk the straight line in direction and call the height along it . Write the starting point in components as ====, so is its east-coordinate and its north-coordinate. After stepping a distance in direction , your east-coordinate is and your north-coordinate is :
Now is an ordinary one-input function of , and .
WHY. As grows, both and drift. The Multivariable Chain Rule says the total change in height is the change caused by moving, plus the change caused by moving:
Here (a partial derivative, written ) is the slope if you only moved east; because increases by for each unit of . Same story north. Setting evaluates everything at the starting point :
PICTURE. The total slope along is built from two known slopes: the east slope scaled by how much of the step is eastward (), plus the north slope scaled by .

Step 5 — Recognise the dot product
WHAT. Line up the two lists of numbers. Collect the partials into one arrow, the gradient . Then is precisely the dot product of with :
WHY it matters. A dot product is "multiply matching components, add them up". But it has a second, geometric face — and that face is what unlocks the whole answer in the next step.
PICTURE. Two arrows from the point: the ==pale-yellow gradient and the blue direction == on the unit circle, with the angle between them marked.

Step 6 — The dot product's geometric face
WHAT. First name the quantity we are about to use: let == be the angle between the two arrows and == — the amount you would have to rotate one arrow to line it up with the other (this is the angle drawn in the Step 5 picture). For any two arrows, the dot product also equals the product of their lengths times the cosine of that angle:
Since (Step 2), it drops out. So
WHY cosine? Cosine measures alignment. When two arrows point the same way (), (full agreement). At a right angle (), (no agreement). Opposite (), . It is exactly the "how much do these two arrows agree?" dial we need.
PICTURE. A single dial: as swings around the circle, the angle between it and the fixed gradient changes, and the value rides up and down. The only thing you can change is ; is a fixed property of the hill at this point.

Step 7 — Which direction wins? (the payoff)
WHAT. We want the that makes as large as possible. The only free knob is , and is biggest — equal to — when . So the winning direction is the one that points the same way as .
Here dividing by its own length shrinks it to length — a unit arrow pointing the gradient's way. The maximum rate is just itself.
WHY this settles everything. No arithmetic, no calculus of variations — the cosine simply cannot exceed , and it hits only along . That single fact is "steepest ascent = gradient direction".
PICTURE. The compass of directions colour-graded by : brightest exactly along (uphill), darkest opposite it (downhill).

Step 8 — The other cases (nothing left uncovered)
WHAT. Read the same formula at the other special angles, and at the one place it breaks.
| what happens | |||
|---|---|---|---|
| steepest ascent (up the gradient) | |||
| height unchanged → walking along a level curve | |||
| steepest descent (; this is Gradient Descent (Machine Learning)) |
The perpendicular fact. At the height doesn't change, so that direction is the level curve's tangent. Since it sits at a right angle to , the gradient is perpendicular to every level curve. That's why on a contour map the uphill arrow always crosses the contours at .
The degenerate case: . If both partials vanish, then , so for every direction — the ground is momentarily flat (a peak, a valley floor, or a saddle). There is no steepest direction, and the formula is undefined because you cannot divide by zero. This is the one input where "point uphill" has no answer, and the maths honestly refuses to give one.
PICTURE. Left: the gradient crossing the pale-blue contours at right angles. Right: a flat spot where — the arrow collapses to a dot and all directions are equally (un)steep.

The one-picture summary
WHAT. One figure ties the whole chain together: a contour map with the gradient arrow, the fan of unit directions coloured by their , and the little " dial" that decides the winner.

The logic in one breath: directional derivative (chain rule) (dot product's geometry) , with equality only when aligns with .
Recall Feynman: tell it to a friend in the fog
You're on a foggy hill and can only feel the slope underfoot. You wonder: which way is steepest up? Trying every direction and measuring the slope one by one (that's the directional derivative) would take forever. So you notice a shortcut: the slope in any direction is just the east-slope times how-much-east-you-go plus the north-slope times how-much-north-you-go. Bundle the two slopes into one arrow — the gradient — and that sum is exactly "how much your walking arrow agrees with the gradient arrow". Agreement is measured by cosine, which maxes out at when the two arrows point the same way. So the steepest way up is simply along the gradient, and how steep it is equals the gradient's length. Walk sideways at a right angle and the cosine is — the ground stays flat, which is why you're now strolling along a contour line. Turn all the way around and you get the steepest way down. And if the gradient is the zero arrow, the ground is flat in every direction and there's no "up" at all.
Connections
- Gradient as direction of steepest ascent
- Directional Derivative
- Partial Derivatives
- Multivariable Chain Rule
- Dot Product and Angle
- Level Curves and Contour Maps
- Gradient Descent (Machine Learning)
- Tangent Plane and Linearization