Parent: Partial derivatives . Here we don't teach a new idea — we drill the one rule (Freeze Others, Differentiate ) against every kind of input it can meet, so no surprise catches you later.
Before we start, one promise: every symbol you see was already earned in the parent note. ∂ f / ∂ x = "nudge only x , freeze the rest, measure the output's slope". ∇ f = the list of all such slopes. If any line feels unfamiliar, re-read the parent — we build strictly on top of it.
Think of every partial-derivative problem as landing in one of these cells . If we work one clean example per cell, you have seen the whole map.
#
Case class
What makes it tricky
Covered by
A
Pure polynomial , both partials
terms with no moving variable must vanish
Ex 1
B
Product of two variables (needs product/constant-multiple care)
is it product rule or constant multiple?
Ex 2
C
Composition g ( inner ) — chain rule inside
must multiply by inner slope
Ex 3
D
Quotient / negative powers — sign of the slope flips by region
denominator can make slope positive or negative
Ex 4
E
Degenerate / zero input — evaluate at a point, incl. 0
does a "vanishing" term really vanish numerically?
Ex 5
F
Symmetry & mixed second partials
order of differentiation, does it matter?
Ex 6
G
Real-world word problem (heat / area) with units
keep track of what each slope means physically
Ex 7
H
ML payoff — a full gradient of a loss, both signs of residual
which way does each weight get pushed?
Ex 8
I
Exam twist — variable appears in the exponent AND base
you cannot treat it as a simple power
Ex 9
We now hit every cell.
Worked example Ex 1 — Cell A: pure polynomial, both partials
f ( x , y ) = 4 x 3 y − 7 x + 2 y 2 + 9 . Find f x and f y .
Forecast: Which term disappears in f x ? Guess before reading.
∂ ( 4 x 3 y ) / ∂ x = 12 x 2 y .
Why this step? y is frozen (a number), so 4 y is just a constant multiplier on x 3 ; d x d x 3 = 3 x 2 , giving 4 y ⋅ 3 x 2 .
∂ ( − 7 x ) / ∂ x = − 7 .
Why this step? Ordinary slope of a straight line.
∂ ( 2 y 2 ) / ∂ x = 0 and ∂ ( 9 ) / ∂ x = 0 .
Why this step? No x inside → zero slope in the x -direction. This is the "vanishing" rule from the parent.
So f x = 12 x 2 y − 7 .
Now freeze x : f y = 4 x 3 ( 1 ) + 0 + 4 y + 0 = 4 x 3 + 4 y .
Why this step? 4 x 3 multiplies y 1 → constant times 1 ; 2 y 2 → 4 y ; the − 7 x and 9 have no y .
Verify: At ( x , y ) = ( 1 , 1 ) : f x = 12 − 7 = 5 , f y = 4 + 4 = 8 . Both finite, both correct sign for a surface rising in both directions there. ✅
Worked example Ex 2 — Cell B: is it product rule or constant multiple?
f ( x , y ) = x 2 y 3 . Find f x .
Forecast: Do we need the product rule (like d x d [ uv ] )? Guess.
No product rule needed. When we take f x , the factor y 3 is a constant — it does not vary with x .
Why this step? Product rule is for two things that both change with the moving variable . Here only x 2 moves.
f x = y 3 ⋅ d x d ( x 2 ) = y 3 ⋅ 2 x = 2 x y 3 .
Why this step? Constant-multiple rule: pull the frozen y 3 out front.
By symmetry, f y = x 2 ⋅ 3 y 2 = 3 x 2 y 2 .
Verify: Reconstruct f from its slope in x : integrate 2 x y 3 over x → x 2 y 3 + C ( y ) . Matches the original (with C = 0 ). ✅
Worked example Ex 3 — Cell C: chain rule inside
f ( x , y ) = sin ( x 2 y ) . Find f x and f y .
Forecast: Where does the "inner factor" come from?
Let the inside be u = x 2 y . Then f = sin u .
Why this step? Naming the inside makes the chain rule visible: outer function of an inner function.
Why chain rule and not just cos ? Because u itself changes as x changes. The chain rule answers "how fast does the whole composite move" = (how fast sin moves per unit u ) × (how fast u moves per unit x ).
f x = cos ( u ) ⋅ ∂ u / ∂ x = cos ( x 2 y ) ⋅ ( 2 x y ) = 2 x y cos ( x 2 y ) .
Why this step? Inner slope ∂ ( x 2 y ) / ∂ x = 2 x y (with y frozen).
f y = cos ( u ) ⋅ ∂ u / ∂ y = cos ( x 2 y ) ⋅ x 2 = x 2 cos ( x 2 y ) .
Verify: At ( x , y ) = ( 1 , 0 ) : inner u = 0 , cos 0 = 1 . f x = 0 , f y = 1 . Since f = sin ( x 2 y ) near y = 0 looks like sin ( x 2 y ) ≈ x 2 y , its y -slope at x = 1 is x 2 = 1 . ✅
Worked example Ex 4 — Cell D: quotient, and the slope's sign flips by region
f ( x , y ) = y x (with y = 0 ). Find both partials and discuss the sign in each quadrant of y .
Forecast: Is f y positive or negative when y > 0 ?
Rewrite f = x ⋅ y − 1 .
Why this step? Turning division into a negative power lets us use the plain power rule instead of the quotient rule.
f x = y − 1 = y 1 .
Why this step? y − 1 is a frozen constant multiplier on x .
f y = x ⋅ ( − 1 ) y − 2 = − y 2 x .
Why this step? Power rule: d y d y − 1 = − y − 2 ; the frozen x stays.
Sign discussion (covering all cases):
f x = 1/ y is positive when y > 0 , negative when y < 0 — pushing x up raises f only if the divisor is positive.
f y = − x / y 2 . Since y 2 > 0 always, the sign is set by − x : negative when x > 0 , positive when x < 0 , zero when x = 0 .
Degenerate: at y = 0 the function itself is undefined, so no partials exist there — always state the domain first.
Verify: At ( x , y ) = ( 2 , − 1 ) : f x = 1/ ( − 1 ) = − 1 , f y = − 2/1 = − 2 . Sanity: f = 2/ ( − 1 ) = − 2 ; nudge y toward 0 − makes f more negative → ∂ f / ∂ y < 0 locally? Check: moving y from − 1 up toward 0 increases y , and − 2/ y 2 at x = 2 is negative, so f decreases — consistent. ✅
Worked example Ex 5 — Cell E: evaluate at a zero / degenerate point
f ( x , y ) = x 2 e y + x y . Find f x , then evaluate at ( 0 , 0 ) and at ( 0 , 5 ) .
Forecast: Will f x be 0 at ( 0 , 0 ) ? At ( 0 , 5 ) ?
f x = 2 x e y + y .
Why this step? e y is frozen → constant multiplier on x 2 giving 2 x e y ; the term x y has y frozen → slope y .
At ( 0 , 0 ) : f x = 2 ( 0 ) e 0 + 0 = 0 .
Why this step? Both terms carry a factor that is 0 here — a genuine degenerate point where the x -slope flattens.
At ( 0 , 5 ) : f x = 2 ( 0 ) e 5 + 5 = 5 .
Why this step? The first term still dies (factor x = 0 ) but the + y term survives as 5 . Lesson: "x = 0 " does not force the whole slope to zero — only terms that contain x vanish.
Verify: f x ( 0 , 0 ) = 0 and f x ( 0 , 5 ) = 5 . Cross-check f y = x 2 e y + x ; at ( 0 , 5 ) that is 0 , so the surface is momentarily flat in y but tilted in x there. ✅
Worked example Ex 6 — Cell F: symmetry and mixed second partials
f ( x , y ) = x 3 y 2 + x y . Show f x y = f y x (Clairaut's symmetry).
Forecast: Will differentiating in the two orders give the same result?
First partials: f x = 3 x 2 y 2 + y , and f y = 2 x 3 y + x .
Why this step? Standard freeze-and-differentiate, one variable at a time.
f x y = ∂ ( f x ) / ∂ y = ∂ ( 3 x 2 y 2 + y ) / ∂ y = 6 x 2 y + 1 .
Why this step? Now x is frozen; 3 x 2 ⋅ 2 y = 6 x 2 y , and y → 1 .
f y x = ∂ ( f y ) / ∂ x = ∂ ( 2 x 3 y + x ) / ∂ x = 6 x 2 y + 1 .
Why this step? Now y frozen; 2 y ⋅ 3 x 2 = 6 x 2 y , and x → 1 .
They match: f x y = f y x = 6 x 2 y + 1 .
Why it matters: for the smooth loss surfaces in ML, mixing the order of partials is safe — this underlies why the chain rule and Hessians behave nicely.
Verify: At ( 1 , 1 ) : both give 6 + 1 = 7 . ✅
Geometric read of Ex 7: the rectangle's area A = x y . The blue arrow shows growth when you push the width x ; the orange arrow shows growth when you push the height y . The slope in each direction is literally the length of the other side.
Worked example Ex 7 — Cell G: word problem with units
A rectangular metal plate has width x metres and height y metres. Area A ( x , y ) = x y (m²). At x = 3 m , y = 4 m , how fast does area grow per metre of width? Per metre of height?
Forecast: Which side controls the width-slope — the width or the height?
∂ A / ∂ x = y .
Why this step? Freeze height y ; area is y ⋅ x , a line of slope y . Adding a thin strip of width d x adds area = height × d x .
At the point, ∂ A / ∂ x = 4 m²/m = 4 m.
Why this step? Units: (m²)/(m) = m. The height number is the width-slope — pushing width by 1 m adds a strip of area equal to the current height.
∂ A / ∂ y = x = 3 m²/m at the point.
Why this step? Symmetric: freeze width, the added strip's area = current width × d y .
Verify: Grow both by a tiny 0.01 m: predicted Δ A ≈ 4 ( 0.01 ) + 3 ( 0.01 ) = 0.07 m². Exact new area 3.01 × 4.01 = 12.0701 , old = 12 , so Δ A = 0.0701 — matches to first order (the extra 0.0001 is the tiny corner square d x d y ). ✅
Worked example Ex 8 — Cell H: full ML gradient, both signs of residual
Linear model t ^ = w x + b . One data point x = 2 , t = 1 . Squared loss L ( w , b ) = ( w x + b − t ) 2 . Evaluate the gradient at (a) w = 1 , b = 0 (under-predict) and (b) w = 0 , b = 3 (over-predict).
Forecast: In which case does ∂ L / ∂ w come out negative? (Negative slope → push w up .)
Residual r = w x + b − t . From the parent: ∂ L / ∂ w = 2 r x , ∂ L / ∂ b = 2 r .
Why this step? Chain rule: ∂ L / ∂ w = 2 r ⋅ ∂ r / ∂ w = 2 r ⋅ x ; likewise ∂ r / ∂ b = 1 .
Case (a) w = 1 , b = 0 : prediction = 2 , so r = 2 + 0 − 1 = 1 (over -predict, r > 0 ).
∂ L / ∂ w = 2 ( 1 ) ( 2 ) = 4 , ∂ L / ∂ b = 2 ( 1 ) = 2 .
Why this step? Positive slopes → descent pushes w and b down , shrinking the too-big prediction. Correct.
Case (b) w = 0 , b = 3 : prediction = 3 , r = 3 − 1 = 2 (still over-predict).
∂ L / ∂ w = 2 ( 2 ) ( 2 ) = 8 , ∂ L / ∂ b = 2 ( 2 ) = 4 .
Why this step? Bigger residual → bigger slopes → bigger corrective step.
Case (c) to show a negative slope: w = 0 , b = 0 : prediction = 0 , r = − 1 (under -predict, r < 0 ).
∂ L / ∂ w = 2 ( − 1 ) ( 2 ) = − 4 .
Why this step? Negative slope → descent adds to w , raising the too-small prediction. Sign of r sets the direction; x 's sign scales/flips ∂ L / ∂ w .
Verify: In case (a), nudge w down by 0.01 : new r = 0.99 ⋅ 2 − 1 = 0.98 , new L = 0.9604 vs old L = 1 . Δ L ≈ − 0.0396 ; predicted ∂ L / ∂ w ⋅ ( − 0.01 ) = 4 ⋅ ( − 0.01 ) = − 0.04 . Match. ✅ See 1.3.01-Gradient-descent .
Worked example Ex 9 — Cell I (exam twist): the variable is in BOTH base and exponent
f ( x , y ) = x y (with x > 0 ). Find f x and f y . Warning: f x = y x y − 1 and f y = x y ln x are not both from the same rule — pick the right one for each.
Forecast: Which partial uses the power rule, which uses the exponential rule?
f x : here the base x moves, the exponent y is frozen → it's a power function x ( const ) .
So f x = y x y − 1 .
Why this step? Power rule applies precisely because the exponent is constant.
f y : here the exponent y moves, the base x is frozen → it's an exponential x y = e y l n x .
Differentiate: f y = e y l n x ⋅ ln x = x y ln x .
Why this step? When the exponent is the mover you must rewrite as e ( ⋅ ) ; that's why ln x appears — it's the inner slope ∂ ( y ln x ) / ∂ y = ln x . This is exactly the single-variable d y d a y = a y ln a with a = x .
The exam trap : writing f y = y x y − 1 (power rule on the wrong variable) is wrong — the power rule needs a constant exponent, but here the exponent is the mover.
Verify: At ( x , y ) = ( 2 , 3 ) : f x = 3 ⋅ 2 2 = 12 , f y = 2 3 ln 2 = 8 ln 2 ≈ 5.545 . Numerically nudge y up by 0.001 : 2 3.001 = 8 ⋅ 2 0.001 ≈ 8.00554 , so slope ≈ 5.545 . Match. ✅
Recall Which rule for which mover? (the whole matrix in one card)
Constant exponent, moving base ::: power rule, y x y − 1
Constant base, moving exponent ::: exponential rule, x y ln x
Term with no copy of the moving variable ::: slope is 0 , it vanishes
Division x / y , take ∂ / ∂ y ::: rewrite as x y − 1 , get − x / y 2
Composite sin ( inner ) ::: chain rule, multiply by inner's partial
Order of mixed partials f x y vs f y x ::: equal for smooth functions (Clairaut)
Mnemonic Same three questions, every cell
"What moves? What's frozen? Does this term even contain the mover?" Answer those and any scenario collapses to plain single-variable calculus.
Polynomial term - power rule
Quotient - negative power
Mover in exponent - use e to the power
No mover inside gives zero