Partial Derivatives
Every scientist knows the reflex: change one thing at a time. If you water
one tomato plant more and move it into the sun, and it thrives, you have learned
nothing — was it the water or the light? So you clamp everything else and wiggle a single
knob. Partial derivatives are that reflex, made into calculus.
A function of one variable has one knob, and its
derivative
measures the one available rate of change. But a surface
z = f(x, y) is a landscape: stand on a hillside and the slope
depends on which way you face. Walking due east (the x-direction)
might take you gently uphill while due north (the y-direction)
drops you off a cliff. "The slope of the hill" is not one number — so we start with the two
simplest directions and measure each with the other clamped.
The partial derivative of f with respect to
x freezes y at whatever value
it has, wiggles x alone, and takes the usual limit:
\frac{\partial f}{\partial x} = \lim_{h \to 0} \frac{f(x + h,\, y) - f(x,\, y)}{h}.
Look closely at the numerator: y appears in both terms,
unchanged. Only x moved. The curly
\partial — pronounced "partial", or affectionately "del" or
"dabba" depending on whose lecture you're in — is just a d with a
warning label: other variables exist, and I am holding them still. Likewise
\partial f / \partial y freezes x and
wiggles y.
The notation zoo. All of these mean exactly the same thing, and you will
meet all of them:
\frac{\partial f}{\partial x} \;=\; f_x \;=\; \partial_x f \;=\; D_x f,
with f_x(a, b) or
\left.\tfrac{\partial f}{\partial x}\right|_{(a,b)} for the value
at a specific point. Leibniz's fraction-style
\partial f/\partial x is best when you need to say which
variable moved; the subscript f_x is best when partials start
piling up (f_{xy} is far kinder than
\tfrac{\partial^2 f}{\partial y\, \partial x}). Use whichever is
clearest — they are one concept in four costumes.
The whole technique: treat the other letter as a number
Here is the good news: you already know how to compute every partial
derivative. No new rules. To find f_x, read
y as if it were the number 7 and
differentiate with the one-variable toolkit you own. Watch the discipline in action on
f(x, y) = x^2 y^3 + 3x - y.
Computing f_x — mentally replace every
y with "some constant":
-
x^2 y^3 is "x^2 times a constant" —
like x^2 \cdot 343. The
constant factor rides
along: the derivative is 2x \cdot y^3 = 2xy^3.
- 3x differentiates to 3, as always.
-
-y is "a constant" — like -7. A
constant's derivative is 0. It vanishes entirely.
f_x = 2xy^3 + 3.
Computing f_y — now the roles swap, and every
x is the frozen one:
-
x^2 y^3 is "a constant times y^3":
derivative x^2 \cdot 3y^2 = 3x^2 y^2.
-
3x has no y in it at all — it is a
constant now. Gone: 0.
- -y differentiates to -1.
f_y = 3x^2 y^2 - 1.
Notice how the same term plays two different parts:
3x was alive in the x-derivative and
dead weight in the y-derivative. Before differentiating any term,
ask one question: does the moving variable actually appear here? If not, the term is
a constant and its derivative is zero — no matter how many other letters it contains.
When the frozen variable hides inside
Freezing y does not mean y disappears —
it means y behaves like a fixed coefficient wherever it sits, even
inside a product or an exponent. Take
g(x, y) = x\, e^{xy}.
For g_x, both factors contain
x, so the
product rule
applies — exactly as in one variable:
g_x = \underbrace{1 \cdot e^{xy}}_{(x)'\, e^{xy}} + \underbrace{x \cdot e^{xy} \cdot y}_{x\,(e^{xy})'} = e^{xy}(1 + xy).
The second piece used the chain
rule: the derivative of e^{xy} in
x is e^{xy} times the derivative of the
exponent xy, and with y frozen that
inner derivative is just y.
For g_y, the leading x
is a mere constant factor — no product rule needed this time:
g_y = x \cdot e^{xy} \cdot x = x^2 e^{xy}.
Same function, two quite different-looking partials. That asymmetry is normal: the landscape
genuinely is steeper in some directions than others.
Three traps catch nearly every newcomer:
-
\partial_x of y^2 is
0 — not 2y. The reflex "see
a square, write twice the thing" fires on any letter in sight. Resist it. When
x is the mover, y^2 is as constant as
49, and constants differentiate to zero. Only the variable in
the \partial's denominator is alive; everything else is frozen
scenery.
-
The \partial symbols never cancel like a fraction.
With ordinary derivatives, \tfrac{dz}{dy}\tfrac{dy}{dx} = \tfrac{dz}{dx}
works out (that's the chain rule being kind). The partial version fails, sometimes
spectacularly: for an ideal gas one can compute
\tfrac{\partial P}{\partial V}\tfrac{\partial V}{\partial T}\tfrac{\partial T}{\partial P} = -1,
not +1 as "cancelling" would promise. Each partial holds a
different variable fixed, so they are slopes of three different slices — not
fractions sharing factors. Treat \partial f/\partial x as one
indivisible symbol.
-
Mixed partials are equal only for nice functions.
f_{xy} = f_{yx} needs the second partials to be continuous
(a "C^2" function). Every polynomial, exponential and sine you
will meet this term qualifies — but a standard counterexample exists (see below), so quote
the equality as a theorem with a hypothesis, not as a law of nature.
Both partials, then partials of partials
Time for the full workout. Take
f(x, y) = x^2 y + \sin(xy).
Step 1 — \partial f/\partial x, treating
y as constant. The first term x^2 y has
constant factor y, so it differentiates to
2xy. For \sin(xy) the
chain rule gives
\cos(xy) times the derivative of the inside
xy with respect to x, which is
y:
f_x = 2xy + y\cos(xy).
Step 2 — \partial f/\partial y, treating
x as constant. Now x^2 y has constant
factor x^2, differentiating to x^2. For
\sin(xy) the inside xy differentiates to
x in y:
f_y = x^2 + x\cos(xy).
Step 3 — go to second order. A partial is itself a function of
x and y, so we can differentiate again
— four ways: f_{xx}, f_{yy}, and the
two mixed partials. Here f_{xy} means "first
x, then y": differentiate
f_x = 2xy + y\cos(xy) with respect to y.
The first term gives 2x. The second is a product
y \cdot \cos(xy): the product rule gives
\cos(xy) + y \cdot (-\sin(xy)) \cdot x, so
f_{xy} = 2x + \cos(xy) - xy\sin(xy).
Step 4 — the other order. Now f_{yx}: differentiate
f_y = x^2 + x\cos(xy) with respect to x.
The first term gives 2x. The second is
x \cdot \cos(xy): the product rule gives
\cos(xy) + x \cdot (-\sin(xy)) \cdot y, so
f_{yx} = 2x + \cos(xy) - xy\sin(xy).
Step 5 — compare. Two genuinely different computations — different starting
expressions, different products — and yet the answers are letter-for-letter identical:
f_{xy} = f_{yx} = 2x + \cos(xy) - xy\sin(xy).
That was no accident. For any function whose second partials are continuous, the order of
differentiation does not matter — a quiet, beautiful symmetry called Clairaut's
theorem (also Schwarz's theorem; good theorems collect names).
The slope of a slice
Geometrically, fixing y = b slices the surface
z = f(x, y) with the vertical plane
y = b — a hot wire through the landscape. The cut edge is a
one-variable curve z = f(x, b), and
f_x(a, b) is nothing more exotic than its ordinary slope at
x = a: the pitch you'd feel walking due east through the point
(a, b).
Below is that slice for our function f(x, y) = x^2 y + \sin(xy).
Slide b and the whole slice-curve morphs — each height of the
cutting plane reveals a different profile of the hill. Slide a and
the tangent line rolls along the curve; its slope at every moment is exactly
f_x(a, b) = 2ab + b\cos(ab). Try b = 0:
the slice flattens to a dead-level line and f_x is zero everywhere
along it. Then push b negative and watch the parabola flip
downhill.
That flat slice is a cut through a whole landscape. Here is the same
z = f(x, y) as a rotatable surface — drag it to view the
hill from any angle. The shaded sheet is the cutting plane y = b; nudge
the very same b slider above and watch it sweep through the
surface, while the bold curve where it bites is exactly the profile drawn flat below. The
marked dot sits at (a, b), where f_x measures
the surface's east–west (the x-direction) steepness.
-
The partial derivative
f_x = \partial f / \partial x is the ordinary derivative of
f in x with all other variables held
constant; likewise f_y. Geometrically
f_x(a, b) is the slope of the slice
z = f(x, b) at x = a.
-
Higher and mixed partials iterate this:
f_{xx}, f_{yy},
f_{xy} = (f_x)_y and
f_{yx} = (f_y)_x.
-
Clairaut's theorem. If f_{xy} and
f_{yx} are continuous on a region, then they are equal there:
f_{xy} = f_{yx}.
The order of mixed differentiation does not matter.
Clairaut's theorem has a hypothesis — continuity of the second partials — and it earns its
keep. The textbook counterexample is
f(x, y) = \frac{xy(x^2 - y^2)}{x^2 + y^2} \quad (f(0,0) = 0).
Away from the origin it is a perfectly ordinary rational function, but a careful
computation of the mixed partials at the origin gives
f_{xy}(0, 0) = -1 \ne 1 = f_{yx}(0, 0).
The two orders genuinely disagree. The escape clause is precisely Clairaut's hypothesis:
here f_{xy} is discontinuous at the origin, so the
theorem never applied. The moral is the recurring one of multivariable calculus — the
symmetric, well-behaved answer is the rule, but only when a continuity condition holds, and
the pathologies hide exactly where it fails.
Here is why Clairaut's symmetry deserves a small gasp. f_{xy}
asks: as I move north, how does the eastward slope change? And
f_{yx} asks the mirror question: as I move east, how does
the northward slope change? On the face of it these are different surveys of the
terrain — one tracks an east-facing clinometer while walking north, the other a
north-facing clinometer while walking east. Clairaut says every smooth landscape returns
the same number either way: both measure the one intrinsic twist of the surface at
that point, the amount by which it wrings like a wet towel.
The symmetry quietly runs whole subjects. In thermodynamics it becomes the Maxwell
relations — swap the order of two partials of the energy and equations connecting
entropy, pressure, volume and temperature fall out for free. In economics, where
"marginal anything" is a partial derivative in disguise (marginal cost = ∂cost/∂quantity,
holding wages, rent and everything else fixed), Clairaut says the marginal effect
of labour on the productivity of capital equals the marginal effect of capital on the
productivity of labour. One theorem, many costumes — much like the
\partial itself.
A partial derivative you can feel: the ideal gas
Real formulas almost never have one input, which is why \partial
appears on every whiteboard in physics, chemistry, engineering and economics. Take the ideal
gas law, solved for pressure:
P(V, T) = \frac{nRT}{V},
with n (amount of gas) and R (the gas
constant) fixed numbers. Two knobs, two experiments, two partials:
\frac{\partial P}{\partial T} = \frac{nR}{V}, \qquad \frac{\partial P}{\partial V} = -\frac{nRT}{V^2}.
Each line is a lab procedure. \partial P/\partial T:
weld the container shut (volume clamped) and warm it — pressure climbs at the steady rate
nR/V per degree. That is why a sealed aerosol can in a bonfire is
a bad idea: fixed V, rising T, and the
partial derivative does the rest. \partial P/\partial V: hold the
temperature steady and squeeze — the minus sign says pressure moves opposite to
volume, and the V^2 downstairs says the push-back stiffens
sharply as the gas gets small, which is exactly what your thumb feels over a bicycle pump.
The habit to build: whenever you compute a partial of a real formula, say out loud what was
held fixed. "Pressure rises with temperature at constant volume" is physics;
"pressure rises with temperature" alone is ambiguous, because heating a gas that is also free
to expand (a hot-air balloon, say) needn't raise its pressure at all. The
\partial is precisely the bookkeeping of that
at-constant-what clause. The same discipline prices mortgages
(\partial(\text{payment})/\partial(\text{rate}) at fixed loan and
term — steep, as anyone refinancing knows) and runs weather models, where temperature depends
on three space coordinates and time, and the forecast is stitched together from partials in
each.
From here the story opens out: the two partials assemble into a single vector, the
gradient,
and slopes in every direction — not just east and north — follow from
directional
derivatives.
See it explained