1.2.3 · D5Calculus & Optimization Basics

Question bank — Partial derivatives

1,320 words6 min readBack to topic

Before we start, two words we lean on:

  • partial derivative = the slope of if you move ONLY and freeze every other variable.
  • residual = "prediction minus target" in a linear-regression loss.

True or false — justify

TRUE / FALSE: is itself an ordinary single-variable derivative.
TRUE — once you freeze the other variables they act like fixed numbers, so it collapses to the 1-D derivative of a function of alone.
TRUE / FALSE: If then still depends on .
FALSE — the term has no , so it vanishes; , with no in sight.
TRUE / FALSE: For any , the two partials and are always different functions.
FALSE — e.g. gives and (different), but gives both equal to . Symmetry of can make them coincide.
TRUE / FALSE: A partial derivative can be zero even though genuinely changes when both inputs move.
TRUE — only measures the pure- direction; can still change along a diagonal where both and move.
TRUE / FALSE: .
FALSE — you forgot the inner factor. The chain rule gives ; dropping the is the classic bug that mis-scales your gradient.
TRUE / FALSE: The gradient is just a list of numbers with no direction.
FALSE — it is a vector; its direction is steepest ascent and its length is the steepness there. See gradients and directional derivatives.
TRUE / FALSE: To minimise a loss you step in the direction.
FALSE — points uphill (steepest ascent). Descent follows , so you step opposite the gradient.
TRUE / FALSE: For with data fixed, is what training uses.
FALSE — is data, not a parameter; training uses and . Differentiating w.r.t. the wrong symbol is a real trap.
TRUE / FALSE: If both partials are zero at a point, must be at a minimum there.
FALSE — zero gradient marks a stationary point, which could be a maximum, minimum, or saddle. Flat slope ≠ lowest valley.

Spot the error

Someone writes . Find the mistake.
The term has no , so its -slope is , not . Correct answer is ; they wrongly differentiated as if were .
Someone writes " means we hold constant and vary the rest." Fix it.
Backwards. The subscript names the moving variable, so varies and freezes everything else.
For , someone gets . What went wrong?
They differentiated the factor too. Since is the moving variable, is a frozen constant; answer is .
Someone claims " has no chain rule because it's already an exponential." Rebut.
The exponent is an inside function, so the chain rule still applies: multiply by . "Already exponential" doesn't exempt the inner part. See multivariable chain rule.
A student computes for . What factor is missing?
The inner factor . Correct is ; forgetting silently rescales every weight update.
Someone says "the limit definition needs both and to change by ." Correct them.
Only shifts to ; appears unchanged in both and . If also moved, you'd no longer have a partial derivative.

Why questions

Why does a term with no contribute nothing to ?
Because it doesn't change when only moves — its numerator difference is for that term, so its slope in the -direction is exactly .
Why is treating as a constant legal rather than a cheat?
The limit literally holds fixed in both terms, so from the -slope's viewpoint genuinely behaves like a number such as or .
Why does ML need partials at all instead of one ordinary derivative?
A loss has many knobs; each partial tells you how to nudge one weight, and stacking them gives the gradient that gradient descent walks.
Why does the geometric picture use a slice of the surface?
Freezing const cuts the surface into a 1-D curve; the partial is just that curve's ordinary slope — the freeze becomes a slice.
Why is the gradient's direction "steepest ascent" and not some arbitrary direction?
Among all directions you could step, the vector of partials happens to point where rises fastest; its negative is therefore the fastest way down, which is why we minimise along .
Why can the same rule () be called "how linear regression learns"?
That partial is the exact quantity gradient descent multiplies by the learning rate to update ; iterating it is the training loop of linear regression.

Edge cases

At a point where has a sharp corner (kink) in the -direction, what happens to ?
The one-sided slopes disagree, so the limit doesn't exist — the partial is undefined there, even if the -partial is perfectly fine.
For a constant function , what are both partials?
Both are everywhere — nothing changes when you nudge any input, so every slope is flat.
If depends on only one variable, say , what is ?
Exactly ignores , so moving never changes the output.
Can a partial derivative exist at a point while the function is not "smooth" (not fully differentiable) there?
YES — partials existing along the axes does not guarantee the surface is differentiable; a function can have both partials yet still fail to have a proper tangent plane. Existence of partials is weaker than full differentiability.
What does reduce to when the residual (a perfect prediction)?
It becomes — a zero gradient, so gradient descent leaves unchanged, exactly what you'd want at a perfect fit.
If two variables are secretly linked (e.g. you think they're independent but they aren't), is the plain partial still valid?
The plain partial assumes the others are truly frozen and independent; if they actually move together you need the chain rule, or your "partial" measures the wrong thing.

Connections