The gradient points uphill
What you'll learn
Assemble the partials into ∇f — the arrow that points steepest uphill and crosses every contour at a right angle.
Stand on a hillside in fog. You can't see the summit — but you can feel which way the ground rises fastest. That felt direction is a vector, it has a formula, and it's the single most-used object in modern applied math.
Assemble the partials
The gradient of f is the vector of its partial derivatives:
For f = 4 − x²/2 − y² at (1, 1): ∇f = (−1, −2). Two slice-slopes bolted into one arrow — and the arrow knows things the slices didn't.
What the arrow knows
- Direction: ∇f points exactly the way f increases fastest — steepest ascent. Walk the opposite way (−∇f) for steepest descent.
- Length: |∇f| is that steepest slope. At (1, 1): |(−1, −2)| = √5 ≈ 2.24 — steeper than either slice suggested alone.
- Any other direction: face along a unit vector u and your slope is the dot product ∇f · u — the projection story from module 1, now with a job. Maximal when u aligns with ∇f, zero when u is perpendicular to it.
Perpendicular to the contours
That last bullet is the picture worth keeping. Walking along a contour changes nothing (that's what a contour is) — slope zero — so the contour direction must be perpendicular to ∇f. Flip it around: the gradient always crosses the contour map at right angles, pointing uphill:
Where the rings crowd, the arrow grows. A contour map with gradients drawn on it is a complete guide to the terrain.
The engine of optimization
"Compute the gradient, step against it, repeat" — that's gradient descent, the algorithm that trains essentially every neural network: the loss is a landscape over millions of weights, and the machine walks downhill in the fog. The arrow you just learned is the algorithm.
Feel it first in the surface explorer: pick a point, read ∇f and the steepest-ascent direction, then spin the surface and confirm your eye agrees.
Why this matters
The gradient turns "which way and how steep" into one computable object. The last module asks the natural follow-up: what happens where the arrow vanishes?
Check your understanding
Question 1 of 2
At a point on a surface, ∇f points: