Partial Derivatives

The derivative of a one-variable function measures one rate of change. A surface z = f(x, y) has a slope in every direction, so we begin with the two simplest: along x, and along y. The partial derivative with respect to x freezes y as a constant and differentiates the rest as an ordinary one-variable function,

\frac{\partial f}{\partial x} = \lim_{h \to 0} \frac{f(x + h,\, y) - f(x,\, y)}{h}.

The curly \partial ("partial") signals that other variables are being held fixed. Likewise \dfrac{\partial f}{\partial y} freezes x. We also write f_x and f_y for short. The rule in practice is just this: to get f_x, treat y as a number and differentiate normally.

Both partials, step by step

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. The mixed partial 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. The two mixed partials are 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 beautiful symmetry called Clairaut's theorem.

The slope of a slice

Geometrically, fixing y = b slices the surface z = f(x, y) with the vertical plane y = b. The cut edge is a one-variable curve z = f(x, b), and f_x(a, b) is just its ordinary slope at x = a. Move the slice below (change b) and watch the slice-curve — and its slope — change.

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.