Intuition What this page is
The parent note built the machine: D u f = ∇ f ⋅ u , steepest ascent along ∇ f , max rate ∥∇ f ∥ . Here we stress-test it against every situation it can face — positive gradients, negative components, a zero gradient, a direction that goes downhill, a real word problem, and an exam twist. If you can do all of these, nothing on this topic can surprise you.
This page assumes you have read the parent note . We reuse three things from it, and nothing more:
Every problem this topic throws at you falls into one of these cells. Each example below is tagged with the cell it kills.
#
Case class
What makes it tricky
Example
A
Both partials positive
the "clean" textbook case
Ex 1
B
Mixed signs in ∇ f
direction points into quadrant II/IV
Ex 2
C
Direction given downhill
dot product comes out negative
Ex 3
D
Zero gradient (flat point / peak)
steepest direction is undefined
Ex 4
E
Perpendicular to a level curve
dot product must be exactly 0
Ex 5
F
Real-world word problem (units!)
translate temperature/height into f
Ex 6
G
Exam twist — "which way keeps f constant?"
must find the 9 0 ∘ direction
Ex 7
H
Limiting / degenerate ridge (partial = 0)
gradient points along an axis
Ex 8
Worked example Ex 1 (cell A) — steepest ascent, clean case
f ( x , y ) = x 2 + 3 y at the point P = ( 2 , 1 ) . Find the direction of steepest ascent and the maximum rate.
Forecast: guess before computing — will the arrow lean more towards x or towards y ? (At x = 2 the x -slope 2 x = 4 beats the constant y -slope 3 , so lean towards x .)
f x = 2 x , f y = 3 . Why this step? the gradient is the vector of partial derivatives; differentiate f in x holding y fixed, then in y holding x fixed.
∇ f ( 2 , 1 ) = ( 4 , 3 ) . Why? plug the point into each partial.
∥∇ f ∥ = 4 2 + 3 2 = 25 = 5 . Why? the max rate of increase equals the gradient's length (parent's "three big facts").
u ⋆ = 5 ( 4 , 3 ) = ( 0.8 , 0.6 ) . Why? steepest ascent is the gradient normalised to unit length.
Verify: ∥ u ⋆ ∥ = 0. 8 2 + 0. 6 2 = 0.64 + 0.36 = 1 ✓, and ∇ f ⋅ u ⋆ = 4 ( 0.8 ) + 3 ( 0.6 ) = 3.2 + 1.8 = 5 = ∥∇ f ∥ ✓ — dotting the gradient with its own unit direction returns its length, exactly as steepest ascent demands. The arrow does lean towards x (0.8 > 0.6 ), matching the forecast.
The figure shows the amber gradient arrow ( 4 , 3 ) at P , its cyan unit version, and the two white component slopes it is built from.
Worked example Ex 2 (cell B) — a gradient pointing into quadrant IV
f ( x , y ) = x 2 − y 2 at P = ( 3 , 2 ) . Direction of steepest ascent?
Forecast: f grows as x grows but grows as y shrinks (because of − y 2 ). So the uphill arrow should point right and down .
f x = 2 x , f y = − 2 y . Why? differentiate; the minus sign on y 2 carries through.
∇ f ( 3 , 2 ) = ( 6 , − 4 ) . Why? substitute P . The negative y -component means "go downward in y to climb."
∥∇ f ∥ = 6 2 + ( − 4 ) 2 = 36 + 16 = 52 = 2 13 . Why? magnitude uses squares, so signs vanish — the length is still well-defined.
u ⋆ = 2 13 ( 6 , − 4 ) = 13 ( 3 , − 2 ) . Why? normalise; factor of 2 cancels.
Verify: ∥ u ⋆ ∥ 2 = 13 9 + 4 = 1 ✓. The arrow points into quadrant IV (right, down), matching the forecast — a common trap is to ignore the sign and point up-right.
The figure shows P = ( 3 , 2 ) with the amber gradient ( 6 , − 4 ) leaning down-right into quadrant IV, and its cyan unit version.
Worked example Ex 3 (cell C) — negative directional derivative
With f ( x , y ) = x 2 + 3 y at P = ( 2 , 1 ) (same as Ex 1, so ∇ f = ( 4 , 3 ) ), how fast does f change if you walk towards Q = ( − 2 , − 2 ) ?
Forecast: Q is down-and-left of P , roughly opposite the uphill arrow ( 4 , 3 ) . Expect a negative rate (you're descending).
Raw direction v = Q − P = ( − 2 − 2 , − 2 − 1 ) = ( − 4 , − 3 ) . Why? tip minus tail gives the direction of travel.
∥ v ∥ = 16 + 9 = 5 , so u = 5 ( − 4 , − 3 ) = ( − 0.8 , − 0.6 ) . Why? you must normalise, or the rate is scaled by ∥ v ∥ and no longer "per unit distance" (parent's headline mistake).
D u f = ∇ f ⋅ u = 4 ( − 0.8 ) + 3 ( − 0.6 ) = − 3.2 − 1.8 = − 5 . Why? apply D u f = ∇ f ⋅ u .
Verify: u = − u ⋆ from Ex 1, i.e. exactly the steepest-descent direction, so we should get − ∥∇ f ∥ = − 5 ✓. A negative directional derivative simply means "f decreases as you step" — the sign is information, not an error.
The figure shows the amber uphill gradient at P and the cyan walk-direction pointing the opposite way towards Q — the 18 0 ∘ between them is why the rate is − 5 .
Worked example Ex 4 (cell D) — every direction is equally steep
f ( x , y ) = x 2 + y 2 at the origin P = ( 0 , 0 ) . Which way is steepest ascent?
Forecast: the origin is the bottom of a bowl. Every direction goes uphill equally — so is there a unique steepest way? (No.)
f x = 2 x , f y = 2 y ⇒ ∇ f ( 0 , 0 ) = ( 0 , 0 ) . Why? both partials vanish at the centre of the bowl.
∥∇ f ∥ = 0 . Why? max rate of increase is zero to first order — the surface is flat at the very bottom.
u ⋆ = 0 ( 0 , 0 ) cannot be formed. Why? you cannot normalise the zero vector, so the formula gives no single preferred direction.
Verify: check any unit direction, say u = ( 1 , 0 ) : D u f = ∇ f ⋅ u = 0 ( 1 ) + 0 ( 0 ) = 0 . Repeat for ( 0 , 1 ) , ( 2 1 , 2 1 ) , anything — you always get 0 ✓.
The nuance: "undefined" is a statement about the formula ∇ f /∥∇ f ∥ (division by zero). Geometrically the honest reading is "every direction is equally steep" — the first-order rate is 0 in all of them, so no direction wins and no direction loses. This is a critical point ; report it as "∇ f = 0 , all directions tie at rate 0 ."
Common mistake "I'll just pick
( 1 , 0 ) as steepest since the formula broke."
Why it's wrong: the formula didn't break — it told you ∥∇ f ∥ = 0 , meaning every direction ties at rate 0 ; none beats another at first order. Report "critical point, all directions equal," don't fabricate a winner.
Worked example Ex 5 (cell E) — the
9 0 ∘ fact, checked with a figure
f ( x , y ) = x y at P = ( 2 , 3 ) ; the level curve through it is x y = 6 . Show ∇ f is perpendicular to that curve.
Forecast: the parent note claims the gradient is ⊥ to level curves, so the dot product of ∇ f with the tangent should be exactly 0 .
∇ f = ( y , x ) = ( 3 , 2 ) at P . Why? ∂ x ( x y ) = y , ∂ y ( x y ) = x .
Tangent to x y = 6 : differentiate implicitly, y + x y ′ = 0 ⇒ y ′ = − 2 3 . Why? along a level curve f is constant, so its total change is zero; y ′ is the curve's slope. A tangent vector reads its components as ( run , rise ) = ( 1 , y ′ ) = ( 1 , − 2 3 ) . To clear the fraction we scale by 2 (scaling a direction by a positive number does not change the direction), giving the tidy integer form ( 2 , − 3 ) .
∇ f ⋅ ( 2 , − 3 ) = 3 ( 2 ) + 2 ( − 3 ) = 6 − 6 = 0 . Why? if the dot product is 0 , the angle between them is 9 0 ∘ .
Verify: cos θ = ∥∇ f ∥ ∥ tangent ∥ ∇ f ⋅ tangent = 13 ⋅ 13 0 = 0 ⇒ θ = 9 0 ∘ ✓. Along the tangent the directional derivative is 0 (you stay on x y = 6 ), so f doesn't change — precisely why the uphill arrow must leave the curve at a right angle.
The figure shows the hyperbola x y = 6 , its cyan tangent at P , and the amber gradient stabbing off it at exactly 9 0 ∘ .
Worked example Ex 6 (cell F) — a hiker on a temperature field
On a metal plate, temperature is T ( x , y ) = 20 + 4 x − 3 y degrees Celsius, with x , y in metres . A bug sits at ( 5 , 5 ) . (a) Which way should it crawl to warm up fastest? (b) At what rate (°C per metre)? (c) It instead crawls east, direction ( 1 , 0 ) — how fast does its temperature change?
Forecast: T rises with x and falls with y , so "warmest way" points east-and-south. Rate per metre should be around 4 2 + 3 2 = 5 .
T x = 4 , T y = − 3 , so ∇ T = ( 4 , − 3 ) everywhere (linear field). Why? differentiate; the field is planar, so the gradient is constant. Units: ∘ C / m .
Warmest direction u ⋆ = 16 + 9 ( 4 , − 3 ) = 5 ( 4 , − 3 ) = ( 0.8 , − 0.6 ) . Why? normalise the gradient — steepest ascent of T .
Max rate = ∥∇ T ∥ = 5 ∘ C/m . Why? magnitude of the gradient is the fastest possible rate of increase.
Crawling east: D ( 1 , 0 ) T = ∇ T ⋅ ( 1 , 0 ) = 4 ( 1 ) + ( − 3 ) ( 0 ) = 4 ∘ C/m . Why? dot the gradient with the given (already unit) direction.
Verify: u ⋆ is a unit vector (0. 8 2 + 0. 6 2 = 1 ) ✓. East gives 4 < 5 ✓ — nothing beats the gradient direction, and the units stay ∘ C per metre throughout, confirming we normalised correctly (a non-unit direction would have given nonsense units).
The figure shows the bug at ( 5 , 5 ) , the amber warmest-way arrow ( 4 , − 3 ) pointing east-south, and the cyan "east" arrow whose slower rate 4 < 5 you can read from its shorter projection.
Worked example Ex 7 (cell G) — the direction of zero change
f ( x , y ) = 3 x + 4 y at P = ( 1 , 1 ) . Find a unit direction along which f does not change, and confirm it is a valid answer.
Forecast: "no change" means perpendicular to ∇ f . There should be two such directions (opposite each other along the level line).
∇ f = ( 3 , 4 ) . Why? partials of a linear field are its coefficients.
A vector perpendicular to ( 3 , 4 ) is ( 4 , − 3 ) (swap and negate one). Why? ( 3 ) ( 4 ) + ( 4 ) ( − 3 ) = 0 , so it makes a 9 0 ∘ angle — the flat direction.
Normalise: u = 16 + 9 ( 4 , − 3 ) = 5 ( 4 , − 3 ) = ( 0.8 , − 0.6 ) . Its opposite ( − 0.8 , 0.6 ) works equally. Why? the direction must be unit length; both signs lie along the level curve.
Verify: D u f = ∇ f ⋅ u = 3 ( 0.8 ) + 4 ( − 0.6 ) = 2.4 − 2.4 = 0 ✓. Zero rate means you walk along a level line of the plane, so f is genuinely constant — the twist is just the 9 0 ∘ fact read backwards.
The figure shows the amber gradient ( 3 , 4 ) and the two cyan level directions ± ( 0.8 , − 0.6 ) crossing it at 9 0 ∘ — walk either way and f stays constant.
Worked example Ex 8 (cell H) — gradient along an axis
f ( x , y ) = x 2 + cos y at P = ( 1 , 0 ) . Steepest ascent direction and rate?
Forecast: cos y is at its peak at y = 0 , so its slope there is 0 . Expect the uphill arrow to point purely along x .
f x = 2 x , f y = − sin y . Why? d y d cos y = − sin y .
At P = ( 1 , 0 ) : ∇ f = ( 2 , − sin 0 ) = ( 2 , 0 ) . Why? sin 0 = 0 , so the y -slope vanishes — a ridge running in the y -direction.
∥∇ f ∥ = 2 2 + 0 2 = 2 . Why? magnitude with a zero component is just the surviving component.
u ⋆ = 2 ( 2 , 0 ) = ( 1 , 0 ) . Why? normalise; the arrow points purely along + x , confirming the forecast.
Verify: D ( 1 , 0 ) f = ∇ f ⋅ ( 1 , 0 ) = 2 = ∥∇ f ∥ ✓, and the perpendicular direction ( 0 , 1 ) gives D ( 0 , 1 ) f = 2 ( 0 ) + 0 ( 1 ) = 0 ✓ — moving along the ridge keeps f momentarily flat, exactly as a zero partial predicts.
The figure shows P = ( 1 , 0 ) with the amber gradient ( 2 , 0 ) pointing purely along + x and the cyan ridge direction ( 0 , 1 ) along which f stays flat.
Recall Which cell was which?
A positive-clean ::: Ex 1
B mixed signs ::: Ex 2
C downhill (negative D u f ) ::: Ex 3
D zero gradient (all directions tie) ::: Ex 4
E perpendicular to level curve ::: Ex 5
F word problem with units ::: Ex 6
G "stay level" twist ::: Ex 7
H degenerate ridge (a partial = 0 ) ::: Ex 8
Mnemonic The universal recipe
1. Partials → gradient. 2. Length = max rate. 3. Normalise = direction. Then read the sign: + up, − down, 0 level. If ∇ f = 0 , the answer is "critical point, every direction ties at rate 0 ."