Why the Order of Differentiation Matters
For a function of two variables, a mixed second partial derivative is formed by differentiating once with respect to each variable. The order is recorded in the subscripts: \(f_{xy}\) means differentiate \(f\) first with respect to \(x\), then with respect to \(y\); \(f_{yx}\) means differentiate first with respect to \(y\), then with respect to \(x\).
These two calculations often give the same result for familiar smooth functions. But that observation alone does not establish a general rule. Clairaut’s theorem gives a useful condition that guarantees equality: continuity of both mixed partial derivatives in a neighborhood of the point in question.
Thus the notation can be expanded as
The theorem is a sufficient condition for equality, not a definition that makes the two orders identical. Its hypotheses concern what happens in a neighborhood, not merely at one point.
Clairaut’s Theorem
Continuity in an open neighborhood means continuity at all points sufficiently close to \((a,b)\), not just existence or continuity at \((a,b)\) itself. The proof uses small rectangles around the point, so take their sides short enough that the whole rectangle lies in \(U\).
The key idea is to calculate the same change in \(f\) around the four corners of a rectangle in two ways. One calculation uses \(f_{xy}\); the other uses \(f_{yx}\). After dividing by the rectangle’s area and shrinking the rectangle toward the point, continuity identifies the two limiting values.
Worked Example: Comparing Mixed Partials of a Polynomial
Worked Example: Comparing Mixed Partials of a Polynomial
Let \(f(x,y)=x^2y^3+3x-y\). Compute both mixed partials and evaluate them at \((1,-1)\).
First differentiate with respect to \(x\), holding \(y\) fixed:
Now differentiate this result with respect to \(y\):
For the other order, differentiate the original function with respect to \(y\):
Then differentiate with respect to \(x\):
At \((1,-1)\), the value is
Both mixed partials are polynomials, so they are continuous everywhere. Clairaut’s theorem applies, and the computed values agree as required. Substituting \((1,-1)\) into the common formula \(6xy^2\) also gives \(6\), checking both evaluations.
Rectangular Increments
Choose nonzero, sufficiently small increments \(h\) and \(k\). The four relevant corners are \((a,b)\), \((a+h,b)\), \((a,b+k)\), and \((a+h,b+k)\). Define the rectangular increment by
This expression measures the change across one side of the rectangle minus the change across the opposite side. The signs are important, especially if \(h\) or \(k\) is negative. Integrals with reversed limits automatically account for those signs.
Proof Using the Rectangular Increment
The proof must be careful about which functions the fundamental theorem of calculus is applied to. Continuity of the mixed partials does not, by itself, assert continuity of \(f_x\) or \(f_y\) along every side of a rectangle. Instead, apply the one-variable theorem to differences whose derivatives are continuous because the mixed partials are continuous.
For fixed \(k\), define \(G(u)=f(u,b+k)-f(u,b)\). Differentiating with respect to \(u\) gives \(G'(u)=f_x(u,b+k)-f_x(u,b)\).
For each fixed \(u\), the function \(v\mapsto f_x(u,v)\) has continuous derivative \(f_{xy}(u,v)\) on the interval between \(b\) and \(b+k\). The one-variable fundamental theorem of calculus therefore gives \(G'(u)=\int_b^{b+k}f_{xy}(u,v)\,dv\).
Continuity of \(f_{xy}\) makes the displayed integral continuous as a function of \(u\). Thus \(G'\) is continuous, so applying the fundamental theorem to \(G\) from \(a\) to \(a+h\) gives one expression for \(\Delta\).
Set \(H(v)=f(a+h,v)-f(a,v)\). The same reasoning, now using the continuous mixed partial \(f_{yx}\), gives a second expression for the same \(\Delta\).
Writing out the first expression, the difference \(G(a+h)-G(a)\) is exactly \(\Delta\). Consequently,
For the other order, \(H'(v)=f_y(a+h,v)-f_y(a,v)\). For each fixed \(v\), apply the fundamental theorem to \(u\mapsto f_y(u,v)\), whose derivative \(f_{yx}(u,v)\) is continuous. This gives
The right side is continuous in \(v\). Applying the fundamental theorem to \(H\) from \(b\) to \(b+k\) yields the second expression:
Now assume \(h\ne0\) and \(k\ne0\). Dividing both expressions by \(hk\) shows that each mixed partial has the same rectangular average:
As \((h,k)\) tends to \((0,0)\), the first average tends to \(f_{xy}(a,b)\), and the second tends to \(f_{yx}(a,b)\). To see why, for either continuous function \(q\) among these mixed partials, the absolute difference between its rectangular average and \(q(a,b)\) is at most the largest value of \(|q(u,v)-q(a,b)|\) on the rectangle. Continuity makes that bound tend to zero as the rectangle shrinks. The two averages are equal for every sufficiently small nonzero \(h\) and \(k\), so their limits are equal. Therefore \(f_{xy}(a,b)=f_{yx}(a,b)\), proving the theorem.
Worked Example: Checking a Rectangular Increment
Worked Example: Checking a Rectangular Increment
Let \(f(x,y)=x^2y\), and use \(a=1\), \(b=2\), \(h=1\), and \(k=-1\). Compute the rectangular increment and the two iterated integrals.
The corners are \((1,2)\), \((2,2)\), \((1,1)\), and \((2,1)\). Their function values are
Using the definition of \(\Delta\),
Next, \(f_x=2xy\), so \(f_{xy}=2x\). Its iterated integral is
Also, \(f_y=x^2\), so \(f_{yx}=2x\). The other iterated integral is
Both integrals equal the corner calculation, \(\Delta=-3\). The negative sign is correct because \(k=-1\) reverses the direction of integration in \(y\).
Worked Example: Applying the Theorem to an Exponential
Worked Example: Applying the Theorem to an Exponential
Let \(f(x,y)=e^{xy}\). Find the two mixed partials and evaluate them at \((0,2)\).
Differentiate first with respect to \(x\):
Differentiate this with respect to \(y\), using the product rule:
In the other order,
At \((0,2)\), \(xy=0\), so
The formulas agree everywhere, and substituting the point into either formula gives \(1\). Both mixed partials are continuous, since they are built from products and compositions of continuous functions. Thus the theorem applies at \((0,2)\).
A Common Proof Error
A tempting but unjustified step is to apply the fundamental theorem directly to \(f\) along every horizontal and vertical side, as if continuity of the mixed partials guaranteed continuity of \(f_x\) and \(f_y\) on those sides. It does not. Here is a concrete illustration of the gap in that argument.
Define \(g(0)=0\), \(g(x)=x^2\sin(1/x^2)\) for \(x\ne0\), and \(F(x,y)=g(x)+y^2\). The derivative \(g'(0)\) exists because
For \(x\ne0\), differentiation gives
This derivative is unbounded near zero. Yet \(F_x=g'(x)\) is independent of \(y\), and \(F_y=2y\) is independent of \(x\), so both mixed partials exist and are identically zero. On a horizontal side through \(x=0\), \(F_x\) is not continuous. Therefore the usual fundamental-theorem argument that requires a continuous derivative cannot simply be applied to \(F\) along that side.
Why the Theorem Is Useful
For many familiar functions, the two orders can be computed and compared directly, as in the examples. Clairaut’s theorem explains when equality is guaranteed without treating each pair of calculations as an isolated coincidence. It also makes clear what must be checked: the mixed partials should exist and be continuous in a neighborhood of the point.
The neighborhood condition is substantive. Knowing only that both mixed partials exist at a point does not meet the stated theorem’s hypotheses. Likewise, checking equality in a few examples does not prove equality for an entire class of functions. The rectangular-increment argument supplies the reason the continuity condition works: it makes both descriptions of a shrinking rectangle’s average approach the respective mixed partial at the corner.
Check Your Understanding
Use the definitions and the hypotheses of the theorem to answer these questions.
- In \(f_{xy}\), which variable is differentiated first, and which is differentiated second?
- State the neighborhood continuity condition in Clairaut’s theorem.
- Why does the rectangular-increment proof use differences \(G\) and \(H\) instead of applying the fundamental theorem directly to \(f\) on the rectangle’s sides?
- For \(f(x,y)=x^2y\), compute \(f_{xy}\) and \(f_{yx}\).
- When \(k\) is negative, what accounts for the sign of an integral from \(b\) to \(b+k\)?