Partial derivatives
A partial derivative measures a scalar function’s rate in one independent coordinate while all other coordinates are held constant.
On this page 10 sections
01Change one input at a time#
A function can depend on several inputs even when its output is a single number. A partial derivative asks what happens locally when one input changes and the others stay fixed. This is how we isolate the effect of one model parameter on a loss.
We will use . At , its value is . That value tells us where the output is; a derivative tells us how it changes.
To study the effect of at this point, hold at . The two-input function becomes the one-input slice
Differentiate this ordinary function of : the slope is . At , the slope is . Increasing a little, while keeping , increases the output by about sixteen times that change.
02Read the partial derivative#
We write the rate with respect to as , or . The symbol is read as “partial.” In this lesson, means differentiation, not an extra input to .
Keeping symbolic but constant gives the same result:
Holding constant does not mean setting it to zero. In , it acts as a fixed coefficient, so differentiating with respect to leaves . The separate term has no changing , so its derivative is zero.
Choose the variable first. Then identify which factors are coefficients and which expressions actually change.
. Find .
Show answer and explanation
Hold fixed: .
03Take a different slice through the same point#
Now change while holding . The slice becomes , whose slope is .
In symbolic form,
The same point therefore has an -rate of and a -rate of . There is no contradiction: they describe different changes in the input.
The diagram uses a separate example, , to show a slice in the input plane. Along its highlighted horizontal path, stays fixed and varies. The resulting one-variable function is .
The vertical axis shows the input , not the function's output. The line marks which inputs we visit.
Return to at . With a small change and no change in , the derivative predicts
The actual new value is . The prediction is close, but the derivative is a local linear approximation, not an exact finite-change rule.
04Differentiate through an inner expression#
Partial derivatives still use the ordinary rules of differentiation. For , first recognize the outer square and the inner expression .
For the -partial, the outer rate is and the inner rate is . Multiply them:
For the -partial of the same function, the inner rate is , because stays fixed. This gives .
The outer operation did not change; the coordinate we allowed to vary did. Omitting that inner rate is why two apparently similar partial derivatives can be confused.
. A learner writes . Repair it.
Show answer and explanation
The inner derivative in is 2.
05Evaluate and interpret the result#
Try a new context: a scalar cost . Its partial derivatives are and .
At , these are and . A small increase in alone has a different effect from the same-sized increase in alone. Both rates were evaluated at the same starting state.
Differentiate before substituting all the coordinates. If you replace and by numbers at the beginning, is just a number; it no longer records how the cost depends on either input.
You may substitute the coordinates being held fixed to make a slice, as we did earlier. Keep the coordinate you are differentiating with respect to variable until you have taken its derivative.
Cost . At , find with fixed.
Show answer and explanation
.
A partial derivative is one piece of local information. It does not by itself describe a change in which several coordinates move together. The gradient collects all these coordinate rates, and the multivariable chain rule combines them when inputs depend on other changing quantities.
Differentiate one coordinate; keep the others fixed.
- Compute a partial derivative with other coordinates held fixed.
Further questions
Does a fixed coordinate disappear from the answer?
Sources & further reading
- [1]OpenStax Calculus Volume 3, 4.3 Partial Derivatives ↗OpenStax · Book