Intuition What this page does (WHY)
The parent note built the gradient ∇ f and its three properties. Here we stress-test them. We will hit every kind of situation the gradient can throw at you: positive and negative components, a gradient that vanishes, a direction that points downhill , a level set that is not a nice circle, a real-world word problem, and an exam twist where you must work backwards. If you can do all of these, no problem on this topic can surprise you.
Before we start, three tiny reminders so every symbol is earned:
Definition The three objects we reuse
∇ f = ( f x , f y ) — a vector whose two numbers are the slopes along the x -axis and the y -axis. f x means "hold y still, ask how fast f climbs as x grows".
u ^ = ( u 1 , u 2 ) — a unit direction arrow (length exactly 1 ): u 1 2 + u 2 2 = 1 .
D u ^ f = ∇ f ⋅ u ^ = f x u 1 + f y u 2 — one number: how fast f climbs if you step in direction u ^ . The dot "⋅ " means "multiply matching pieces and add".
Every gradient problem is one of these cells. Each example below is tagged with the cell(s) it covers.
Cell
Scenario class
What is tricky about it
Example
A
All positive components, plain compute
nothing — the warm-up
Ex 1
B
Mixed signs ( + , − ) , direction points downhill
negative D u ^ f ; sign of cos θ
Ex 2
C
Degenerate: ∇ f = 0 (a flat/critical point)
every direction gives rate 0 ; steepest direction undefined
Ex 3
D
Perpendicularity to a non-circular level curve
tangent isn't obvious; must use ∇ f ⋅ ( tangent ) = 0
Ex 4
E
Non-unit vector given (the trap)
must normalise first
Ex 5
F
Real-world word problem (temperature/hill)
translate words → ∇ f , units
Ex 6
G
Limiting/extreme direction: fastest descent & the zero-change direction
signs of all three key angles 0 , π , π /2
Ex 7
H
Exam twist: work backwards — given a directional derivative, find unknown
solve for a component
Ex 8
See Partial derivatives for computing each f x , f y , and Directional derivative for the dot-product rule.
Worked example Ex 1 — Cell A: all-positive warm-up
f ( x , y ) = 3 x 2 + y 3 . Find ∇ f at ( 1 , 2 ) and the steepest-ascent rate.
Forecast: guess — will the steepest rate be bigger or smaller than 10 ?
f x = 6 x , f y = 3 y 2 . Why this step? A partial derivative freezes the other variable, so 3 x 2 differentiates like a one-variable function and y 3 is treated as a constant (its x -derivative is 0 ).
At ( 1 , 2 ) : ∇ f = ( 6 ⋅ 1 , 3 ⋅ 2 2 ) = ( 6 , 12 ) . Why? Just plug the point into each slope.
Steepest rate = ∣∇ f ∣ = 6 2 + 1 2 2 = 180 = 6 5 ≈ 13.42 . Why? Property 2: max rate equals the length of the gradient, and length = sum of squares .
Verify: both components positive, so the arrow points up-and-right into the first quadrant, and 180 > 10 as expected. Direction of climb = ( 6 , 12 ) / 180 , a unit vector: ( 6 2 + 1 2 2 ) /180 = 1 . ✓
Worked example Ex 2 — Cell B: mixed signs, stepping downhill
f ( x , y ) = x 2 − y 2 at ( 2 , 1 ) . Step in direction u ^ = ( 0 , 1 ) (straight up in y ). Find D u ^ f and say if you go up or downhill.
Forecast: the y 2 has a minus sign. Do you gain or lose height moving in + y ?
∇ f = ( 2 x , − 2 y ) , so at ( 2 , 1 ) : ∇ f = ( 4 , − 2 ) . Why the minus? − y 2 differentiates to − 2 y ; the sign carries through.
u ^ = ( 0 , 1 ) has length 0 2 + 1 2 = 1 — already unit. Why check? D u ^ f is only a true "per-step" rate for unit vectors.
D u ^ f = ( 4 , − 2 ) ⋅ ( 0 , 1 ) = 4 ⋅ 0 + ( − 2 ) ⋅ 1 = − 2 . Why? Dot product multiplies matching pieces and adds; here only the y -piece survives.
Verify: the result is negative , meaning moving in + y takes you downhill — makes sense since − y 2 decreases as ∣ y ∣ grows. Also ∣ D u ^ f ∣ = 2 ≤ ∣∇ f ∣ = 20 ≈ 4.47 , obeying "no direction beats the gradient's length". ✓
Worked example Ex 3 — Cell C: degenerate, gradient is zero
f ( x , y ) = x 2 + y 2 at the origin ( 0 , 0 ) . Find ∇ f and the steepest-ascent direction.
Forecast: the bowl's bottom is at the origin. Which way is "uphill" from the very bottom?
∇ f = ( 2 x , 2 y ) , so at ( 0 , 0 ) : ∇ f = ( 0 , 0 ) = 0 . Why? Both slopes vanish — the surface is momentarily flat at the low point.
Steepest rate = ∣ 0 ∣ = 0 . Why? The length of the zero vector is 0 .
Steepest direction is undefined . Why this step matters? Every direction gives D u ^ f = 0 ⋅ u ^ = 0 ; there is no "most uphill" way because it's equally flat everywhere here. This is exactly a critical point — the flag Gradient descent and Lagrange multipliers both hunt for.
Verify: try any u ^ = ( u 1 , u 2 ) : D u ^ f = 0 ⋅ u 1 + 0 ⋅ u 2 = 0 for all of them. Consistent — no preferred uphill. ✓
Worked example Ex 4 — Cell D: perpendicular to a non-circular level curve
f ( x , y ) = x 2 + 4 y 2 . At ( 2 , 1 ) (which lies on f = 8 , an ellipse ), show ∇ f is perpendicular to the level curve.
Forecast: the level curve is a squashed circle. Will ∇ f still point exactly across it?
∇ f = ( 2 x , 8 y ) , so at ( 2 , 1 ) : ∇ f = ( 4 , 8 ) . Why the 8 ? 4 y 2 differentiates to 8 y .
Find a tangent to the ellipse at ( 2 , 1 ) . Differentiate x 2 + 4 y 2 = 8 implicitly: 2 x + 8 y y ′ = 0 ⇒ y ′ = − 8 y 2 x = − 8 ⋅ 1 2 ⋅ 2 = − 2 1 . So a tangent direction is ( 1 , − 2 1 ) , or cleared of fractions t = ( 2 , − 1 ) . Why implicit differentiation? The curve isn't a function y ( x ) we can solve, so we differentiate the equation as-is to get the slope.
Dot the gradient with the tangent: ∇ f ⋅ t = ( 4 , 8 ) ⋅ ( 2 , − 1 ) = 8 − 8 = 0 . Why? Property 3 says ∇ f ⊥ level set; a zero dot product is exactly perpendicularity.
Verify: the dot is 0 , so the red arrow (gradient) meets the ellipse at a right angle even though the curve is stretched. See Level curves and surfaces . ✓
Worked example Ex 5 — Cell E: the non-unit trap
f ( x , y ) = x y at ( 3 , 2 ) . Find the rate of change toward the point ( 6 , 6 ) .
Forecast: the step vector to ( 6 , 6 ) is ( 3 , 4 ) , length 5 . If you skip normalising, your answer is scaled by 5 — spot the error.
∇ f = ( y , x ) , so at ( 3 , 2 ) : ∇ f = ( 2 , 3 ) . Why ( y , x ) ? ∂ ( x y ) / ∂ x = y (treat y constant), ∂ ( x y ) / ∂ y = x .
Step vector v = ( 6 , 6 ) − ( 3 , 2 ) = ( 3 , 4 ) , with ∣ v ∣ = 3 2 + 4 2 = 5 . Why? Direction = destination minus start.
Normalise: u ^ = ( 3 , 4 ) /5 = ( 0.6 , 0.8 ) . Why this step? D u ^ f is only a genuine per-unit-length rate for a length-1 arrow (mistake (a) in the parent note).
D u ^ f = ( 2 , 3 ) ⋅ ( 0.6 , 0.8 ) = 1.2 + 2.4 = 3.6 . Why? Multiply matching pieces, add.
Verify: the wrong (unnormalised) answer would be ( 2 , 3 ) ⋅ ( 3 , 4 ) = 6 + 12 = 18 = 5 × 3.6 — exactly 5 × too big, confirming the scale factor is ∣ v ∣ = 5 . ✓
Worked example Ex 6 — Cell F: real-world word problem
A metal plate has temperature T ( x , y ) = 100 − x 2 − 3 y 2 degrees, with x , y in metres. An ant sits at ( 1 , 2 ) . (a) Which way should it walk to warm up fastest, and how fast (°C per metre)? (b) Which way to keep the same temperature?
Forecast: the plate is hottest at the centre ( 0 , 0 ) ; the ant is off-centre. Will "warmest way" point toward or away from the centre?
∇ T = ( − 2 x , − 6 y ) , at ( 1 , 2 ) : ∇ T = ( − 2 , − 12 ) . Why negatives? Temperature drops as you move out, so the slopes are negative.
Fastest warming = direction of ∇ T = ( − 2 , − 12 ) ; rate = ∣∇ T ∣ = ( − 2 ) 2 + ( − 12 ) 2 = 148 = 2 37 ≈ 12.17 °C/m. Why? Property 2 again — steepest ascent is along the gradient, rate is its length. Units: (°C)/(m) since T is °C and steps are metres.
Constant-temperature direction: perpendicular to ∇ T . Swap and negate one component: ( − 12 , 2 ) (or ( 12 , − 2 ) ). Why? Property with θ = π /2 gives D u ^ T = 0 ; a vector perpendicular to ( a , b ) is ( − b , a ) .
Verify: the warming direction ( − 2 , − 12 ) points toward the hot centre — sensible. Perpendicular check: ( − 2 , − 12 ) ⋅ ( − 12 , 2 ) = 24 − 24 = 0 . ✓
Worked example Ex 7 — Cell G: all three limiting angles at once
f ( x , y ) = 2 x + y (a tilted plane) at any point. Give the fastest-ascent, fastest-descent, and zero-change directions, with rates.
Forecast: for a plane the gradient is the same everywhere . What are the three special rates?
∇ f = ( 2 , 1 ) , constant. Why constant? Partial derivatives of 2 x + y are the constants 2 and 1 .
∣∇ f ∣ = 2 2 + 1 2 = 5 ≈ 2.236 . Fastest ascent : direction ( 2 , 1 ) / 5 , rate + 5 (θ = 0 , cos θ = 1 ). Why? D u ^ f = ∣∇ f ∣ cos θ is maxed when the step aligns with ∇ f .
Fastest descent : direction − ( 2 , 1 ) / 5 , rate − 5 (θ = π , cos θ = − 1 ). Why? Opposite direction flips the sign; this is the arrow Gradient descent follows.
Zero change: any u ^ ⊥ ( 2 , 1 ) , e.g. ( 1 , − 2 ) / 5 , rate 0 (θ = π /2 , cos θ = 0 ). Why? Perpendicular to the gradient keeps you on a level line.
Verify: check the zero direction: ( 2 , 1 ) ⋅ ( 1 , − 2 ) / 5 = ( 2 − 2 ) / 5 = 0 . And ascent rate: ( 2 , 1 ) ⋅ ( 2 , 1 ) / 5 = 5/ 5 = 5 . ✓
Worked example Ex 8 — Cell H: exam twist, work backwards
At a point P , f x = 3 and f y = a is unknown . You are told the directional derivative in the direction u ^ = ( 5 3 , 5 4 ) equals 5 29 . Find a , then the steepest-ascent rate at P .
Forecast: you know the output of the dot product and must recover a missing input . One linear equation, one unknown — solvable.
Write the rule: D u ^ f = ∇ f ⋅ u ^ = 3 ⋅ 5 3 + a ⋅ 5 4 = 5 9 + 5 4 a . Why? Same dot-product formula, just with a symbolic.
Set equal to the given value: 5 9 + 5 4 a = 5 29 ⇒ 5 4 a = 5 20 = 4 ⇒ a = 5 . Why? Solve the single linear equation for a .
Now ∇ f = ( 3 , 5 ) , so steepest rate = ∣∇ f ∣ = 3 2 + 5 2 = 34 ≈ 5.83 . Why? Once the gradient is known, its length is the max rate.
Verify: put a = 5 back: ( 3 , 5 ) ⋅ ( 5 3 , 5 4 ) = 5 9 + 5 20 = 5 9 + 5 20 = 5 29 . ✓ Matches the given data.
Common mistake Cross-example pitfalls
Ex 3 trap: at a zero gradient, do NOT say "steepest direction is ( 0 , 0 ) " — a zero vector has no direction; the honest answer is undefined .
Ex 5 trap: never dot with a non-unit step vector and call it a rate. Normalise first.
Ex 4 trap: for a non-circular level curve you cannot eyeball the tangent — get it from implicit differentiation, then confirm ∇ f ⋅ t = 0 .
Recall Quick self-test (reveal after guessing)
Which cell would "find the coldest-approach direction on a temperature map" be? ::: Cell F/G — fastest descent, direction − ∇ T .
If ∇ f = ( 0 , 0 ) at P , what is D u ^ f for every u ^ ? ::: Always 0 ; the point is critical.
Given a direction to a target point, what is the FIRST thing you must do? ::: Normalise the step vector to length 1 .
Mnemonic Scenario check-list
"SNAP-Z" — check S igns of components, N ormalise the direction, A ngle (0/ π / π /2 ) for ascent/descent/level, P erpendicularity for level sets, Z ero-gradient means undefined direction.