Clairaut's Theorem on Mixed Partials

Take a function of two variables. Differentiate first with respect to xx, then yy. Now reverse the order: differentiate first with respect to yy, then xx. Do you get the same answer? For essentially every function encountered in a first pass through calculus — polynomials, exponentials, trigonometric combinations — the answer is yes. This fact is used silently and constantly. Clairaut's Theorem (also called Schwarz's Theorem) explains exactly why. It isolates the one hypothesis that makes it true: continuity of the mixed partial derivatives themselves. This matters far beyond bookkeeping convenience. The symmetry of mixed partials is what makes the Hessian Matrix symmetric. This in turn allows the spectral theorem to diagonalize it. That lets us classify critical points as maxima, minima, or saddles. It is what makes exact differential equations exact. It is what makes a vector field conservative when its curl vanishes. It is what makes the multivariable Taylor's Theorem in Several Variables expansion collapse into a clean symmetric polynomial in the increments. Without this symmetry, second-order calculus in several variables would be a much messier subject. Then ∂x∂yf\partial_x\partial_y f and ∂y∂xf\partial_y\partial_x f would carry genuinely different information. The subtlety is that the theorem is not a triviality about swapping limits. Mixed partial derivatives can fail to agree. Concrete counterexamples exist among functions that are otherwise perfectly smooth away from one point. The proof has to actually work for this failure to be excludable. It does so through a clever double application of the Mean Value Theorem to a second difference quotient. This is followed by a careful limit argument that uses continuity of the mixed partials in an essential way. This article gives the precise statement and a complete proof via the double-difference-quotient method. It includes a worked example where the two iterated derivatives are computed independently and compared. It also gives the classical counterexample showing that continuity of the mixed partials cannot be dropped. We also address the subtlety of directional order. Finally, we cover the difference between existence and continuity of partial derivatives.

Key takeaways
  • Clairaut's Theorem says fxy=fyxf_{xy} = f_{yx} at a point, provided both mixed partials exist near that point and are continuous there.
  • The proof uses a second-order difference quotient Δ(h,k)\Delta(h,k) and the Mean Value Theorem applied twice, in two different orders.
  • Continuity of the mixed partials is the hypothesis that forces the two orders of differentiation to converge to the same limit.
  • Without continuity, mixed partials can genuinely disagree — a classical rational function built from x3y−xy3x^3y - xy^3 demonstrates this.
  • The result underlies the symmetry of the Hessian Matrix and the exactness conditions in vector calculus and differential equations.
  • Key idea: continuity of fxyf_{xy} and fyxf_{yx} near a point forces them to be equal there, via a symmetric double difference quotient.

Where this lives today

The symmetry of mixed partials is quietly load-bearing across mathematics and its applications. In multivariable calculus itself, it is what guarantees the Hessian Matrix of second partial derivatives is symmetric, which is essential for applying the spectral theorem to classify critical points via eigenvalues in optimization theory. In vector calculus, it is precisely the identity behind ∇×(∇f)=0\nabla \times (\nabla f) = 0 for any sufficiently smooth scalar potential ff, and behind the exactness test for differential equations M dx+N dy=0M\,dx + N\,dy = 0, which requires My=NxM_y = N_x. In physics, Maxwell's relations in thermodynamics (e.g., (∂T∂V)S=−(∂P∂S)V\left(\frac{\partial T}{\partial V}\right)_S = -\left(\frac{\partial P}{\partial S}\right)_V) are direct applications of Clairaut's Theorem to a thermodynamic potential's mixed partial derivatives, encoding deep physical symmetries as calculus identities. In differential geometry, the symmetry of the Hessian underlies the symmetry of the Riemann curvature tensor in special cases and the commutativity of mixed covariant derivatives on flat connections. In numerical analysis and machine learning, symmetric-Hessian assumptions justify Newton's method formulations and quasi-Newton optimization algorithms (BFGS and its relatives), where a non-symmetric approximate Hessian would signal a bug or a genuine failure of smoothness. In signal processing and PDE theory, it justifies interchanging the order of differentiation when deriving the wave equation, heat equation, and other second-order partial differential equations from physical first principles.

Ask the tutor: How does the symmetry of mixed partials generalize to the equality of higher-order partial derivatives under all permutations of differentiation order?

DefinitionMixed Partial Derivatives and the Setting for Clairaut's Theorem

Let U⊆R2U \subseteq \mathbb{R}^2 be an open set and let f:U→Rf: U \to \mathbb{R} be a function. Fix (a,b)∈U(a,b) \in U. The first-order partial derivatives of ff, when they exist, are the functions

fx(x,y)=∂f∂x(x,y)=lim⁡h→0f(x+h,y)−f(x,y)h,fy(x,y)=∂f∂y(x,y)=lim⁡k→0f(x,y+k)−f(x,y)k.f_x(x,y) = \frac{\partial f}{\partial x}(x,y) = \lim_{h \to 0} \frac{f(x+h,y) - f(x,y)}{h}, \qquad f_y(x,y) = \frac{\partial f}{\partial y}(x,y) = \lim_{k \to 0} \frac{f(x,y+k) - f(x,y)}{k}.

If fxf_x and fyf_y exist throughout a neighborhood of (a,b)(a,b), we may attempt to differentiate them again. The second-order mixed partial derivatives at (a,b)(a,b) are

fxy(a,b)=∂∂y(∂f∂x)(a,b),fyx(a,b)=∂∂x(∂f∂y)(a,b),f_{xy}(a,b) = \frac{\partial}{\partial y}\left(\frac{\partial f}{\partial x}\right)(a,b), \qquad f_{yx}(a,b) = \frac{\partial}{\partial x}\left(\frac{\partial f}{\partial y}\right)(a,b),

i.e. fxyf_{xy} means "differentiate with respect to xx first, then yy," and fyxf_{yx} means "differentiate with respect to yy first, then xx." (Notation varies: some authors use ∂2f/∂y ∂x\partial^2 f/\partial y\,\partial x for what we call fxyf_{xy} — always check the convention in context.) These two numbers, fxy(a,b)f_{xy}(a,b) and fyx(a,b)f_{yx}(a,b), are defined by entirely different limiting processes and there is no a priori reason for them to coincide.

Intuition

Think of f(x,y)f(x,y) as describing the height of a landscape. The partial derivative fxf_x measures the slope walking in the xx-direction; fyf_y measures the slope walking in the yy-direction. The mixed partial fxyf_{xy} asks: "as I move slightly in the yy-direction, how does the xx-slope change?" The other mixed partial fyxf_{yx} asks the mirror question: "as I move slightly in the xx-direction, how does the yy-slope change?" These sound like they should be measuring the same underlying "twist" in the surface, and generically they do — but each is built from a different order of limiting operations, so agreement is a genuine theorem, not a formality. The key combinatorial object in the proof is a second difference

Δ(h,k)=f(a+h,b+k)−f(a+h,b)−f(a,b+k)+f(a,b),\Delta(h,k) = f(a+h, b+k) - f(a+h, b) - f(a, b+k) + f(a,b),

built from the four corners of a small rectangle with vertices (a,b)(a,b), (a+h,b)(a+h,b), (a,b+k)(a,b+k), (a+h,b+k)(a+h,b+k). Dividing by hkhk and pushing h,k→0h,k \to 0 estimates both mixed partials simultaneously, because Δ(h,k)/(hk)\Delta(h,k)/(hk) can be analyzed as an iterated difference quotient in either order. The proof shows both orders converge to the same limit when the mixed partials are continuous.

Figure
The rectangle of four function values behind the mixed-difference quotient Δ(h,k)\Delta(h,k)
x y (a, b) (a+h, b) (a, b+k) (a+h, b+k) f(a+h,b) − f(a,b) f(a+h,b+k) − f(a,b+k) Δ(h,k) = [f(a+h,b+k) − f(a,b+k)] − [f(a+h,b) − f(a,b)]

Statement and Proof

TheoremClairaut's Theorem (Symmetry of Mixed Partials)

Let U⊆R2U \subseteq \mathbb{R}^2 be open and let (a,b)∈U(a,b) \in U. Suppose f:U→Rf : U \to \mathbb{R} satisfies: 1. The partial derivatives fxf_x and fyf_y exist at every point of some open neighborhood V⊆UV \subseteq U of (a,b)(a,b); 2. The mixed second partial derivatives fxyf_{xy} and fyxf_{yx} exist at every point of VV; 3. Both fxyf_{xy} and fyxf_{yx} are continuous at the point (a,b)(a,b). Then

fxy(a,b)=fyx(a,b).f_{xy}(a,b) = f_{yx}(a,b).
Proof

Setup. Since VV is open, choose r>0r>0 so that the closed square [a−r,a+r]×[b−r,b+r]⊂V[a-r,a+r]\times[b-r,b+r] \subset V. For h,kh,k with 0<∣h∣<r0<|h|<r and 0<∣k∣<r0<|k|<r, define the second difference

Δ(h,k):=f(a+h,b+k)−f(a+h,b)−f(a,b+k)+f(a,b).\Delta(h,k) := f(a+h,b+k) - f(a+h,b) - f(a,b+k) + f(a,b).

We will compute lim⁡(h,k)→(0,0)Δ(h,k)/(hk)\lim_{(h,k)\to(0,0)} \Delta(h,k)/(hk) in two different ways — one that produces fyx(a,b)f_{yx}(a,b) and one that produces fxy(a,b)f_{xy}(a,b) — and show both limits equal the same value. This will force fxy(a,b)=fyx(a,b)f_{xy}(a,b) = f_{yx}(a,b).

Step 1: A single-variable auxiliary function. Fix h,kh,k as above. Define φ:[a−r,a+r]→R\varphi : [a-r,a+r] \to \mathbb{R} by

φ(x)=f(x,b+k)−f(x,b).\varphi(x) = f(x, b+k) - f(x,b).

By hypothesis (1), fxf_x exists throughout VV, so φ\varphi is differentiable on (a−r,a+r)(a-r,a+r) with

φ′(x)=fx(x,b+k)−fx(x,b).\varphi'(x) = f_x(x,b+k) - f_x(x,b).

Observe that

Δ(h,k)=φ(a+h)−φ(a).\Delta(h,k) = \varphi(a+h) - \varphi(a).

Since φ\varphi is differentiable (hence continuous) on the closed interval between aa and a+ha+h, the Mean Value Theorem applies: there exists cc strictly between aa and a+ha+h (so cc depends on h,kh,k) such that

Δ(h,k)=φ′(c) h=[fx(c,b+k)−fx(c,b)]h.\Delta(h,k) = \varphi'(c)\, h = \big[f_x(c,b+k) - f_x(c,b)\big] h.

Step 2: A second application of the Mean Value Theorem. Fix this cc and define ψ:[b−r,b+r]→R\psi: [b-r,b+r] \to \mathbb{R} by

ψ(y)=fx(c,y).\psi(y) = f_x(c,y).

By hypothesis (2), fxyf_{xy} exists throughout VV (in particular at every point (c,y)(c,y) with yy between bb and b+kb+k, since c∈(a−r,a+r)⊂c \in (a-r,a+r) \subset the relevant slice of VV), so ψ\psi is differentiable with ψ′(y)=fxy(c,y)\psi'(y) = f_{xy}(c,y). Applying the Mean Value Theorem again, there is dd strictly between bb and b+kb+k such that

fx(c,b+k)−fx(c,b)=ψ(b+k)−ψ(b)=ψ′(d) k=fxy(c,d) k.f_x(c,b+k) - f_x(c,b) = \psi(b+k)-\psi(b) = \psi'(d)\,k = f_{xy}(c,d)\,k.

Combining with Step 1:

Δ(h,k)=fxy(c,d) hk,soΔ(h,k)hk=fxy(c,d),\Delta(h,k) = f_{xy}(c,d)\, h k, \qquad \text{so} \qquad \frac{\Delta(h,k)}{hk} = f_{xy}(c,d),

where c=c(h,k)c = c(h,k) lies strictly between aa and a+ha+h, and d=d(h,k)d = d(h,k) lies strictly between bb and b+kb+k. In particular, as (h,k)→(0,0)(h,k) \to (0,0), we have (c,d)→(a,b)(c,d) \to (a,b).

Step 3: Taking the limit using continuity of fxyf_{xy}. By hypothesis (3), fxyf_{xy} is continuous at (a,b)(a,b). Since (c,d)→(a,b)(c,d) \to (a,b) as (h,k)→(0,0)(h,k) \to (0,0) (squeezed because ∣c−a∣<∣h∣|c-a|<|h| and ∣d−b∣<∣k∣|d-b|<|k|), continuity gives

lim⁡(h,k)→(0,0)Δ(h,k)hk=lim⁡(h,k)→(0,0)fxy(c(h,k),d(h,k))=fxy(a,b).\lim_{(h,k)\to(0,0)} \frac{\Delta(h,k)}{hk} = \lim_{(h,k)\to(0,0)} f_{xy}(c(h,k),d(h,k)) = f_{xy}(a,b).

This limit is over (h,k)(h,k) jointly tending to (0,0)(0,0) (with h,k≠0h,k \neq 0), and the value fxy(a,b)f_{xy}(a,b) does not depend on the path of approach — this is precisely what we must exploit next by comparing with the other iterated computation.

Step 4: The symmetric computation, in the other order. Now redo Steps 1–3 with the roles of xx and yy swapped: define χ(y)=f(a+h,y)−f(a,y)\chi(y) = f(a+h,y) - f(a,y), note Δ(h,k)=χ(b+k)−χ(b)\Delta(h,k) = \chi(b+k)-\chi(b), apply the Mean Value Theorem to get some d′d' between b,b+kb,b+k with

Δ(h,k)=[fy(a+h,d′)−fy(a,d′)]k,\Delta(h,k) = \big[f_y(a+h,d') - f_y(a,d')\big] k,

then apply the Mean Value Theorem to y↦fy(x,d′)y \mapsto f_y(x,d') — wait, more precisely to x↦fy(x,d′)x \mapsto f_y(x,d') — obtaining some c′c' between a,a+ha, a+h with

fy(a+h,d′)−fy(a,d′)=fyx(c′,d′) h.f_y(a+h,d') - f_y(a,d') = f_{yx}(c',d')\, h.

Hence

Δ(h,k)hk=fyx(c′,d′),\frac{\Delta(h,k)}{hk} = f_{yx}(c',d'),

with (c′,d′)→(a,b)(c',d') \to (a,b) as (h,k)→(0,0)(h,k)\to(0,0). By continuity of fyxf_{yx} at (a,b)(a,b) (hypothesis 3),

lim⁡(h,k)→(0,0)Δ(h,k)hk=fyx(a,b).\lim_{(h,k)\to(0,0)} \frac{\Delta(h,k)}{hk} = f_{yx}(a,b).

Step 5: Conclusion. Both Step 3 and Step 4 compute lim⁡(h,k)→(0,0)Δ(h,k)/(hk)\lim_{(h,k)\to(0,0)} \Delta(h,k)/(hk) — the same quantity, since Δ(h,k)\Delta(h,k) was defined independently of any differentiation order. A limit of a function of (h,k)(h,k) as (h,k)→(0,0)(h,k) \to (0,0), when it exists, is unique. Therefore

fxy(a,b)=fyx(a,b).f_{xy}(a,b) = f_{yx}(a,b).

■\blacksquare

∎

Proof technique remark. This is the classical double mean value theorem argument (sometimes attributed to Schwarz). It is non-circular: it uses only the single-variable Mean Value Theorem (a one-variable result about differentiable functions on an interval, requiring no prior multivariable machinery) and the definition of continuity, never any fact equivalent to or built on top of the symmetry we are proving.

Worked examples

Example 1: Verifying Clairaut's Theorem directly on an asymmetric function. Let

f(x,y)=x3y2+exy−sin⁡(x)cos⁡(2y).f(x,y) = x^3 y^2 + e^{xy} - \sin(x)\cos(2y).

We compute both mixed partials at the point (a,b)=(1,π/2)(a,b) = (1, \pi/2) and confirm they agree — chosen with asymmetric exponents and mixed transcendental terms so no shortcut hides an error. Compute fxf_x then (fx)y(f_x)_y:

fx(x,y)=3x2y2+y exy−cos⁡(x)cos⁡(2y).f_x(x,y) = 3x^2 y^2 + y\, e^{xy} - \cos(x)\cos(2y).

Now differentiate with respect to yy:

fxy(x,y)=6x2y+exy+xy exy+2cos⁡(x)sin⁡(2y).f_{xy}(x,y) = 6x^2 y + e^{xy} + xy\,e^{xy} + 2\cos(x)\sin(2y).

(Using the product rule on yexyy e^{xy}: ∂y(yexy)=exy+y⋅xexy\partial_y(y e^{xy}) = e^{xy} + y\cdot x e^{xy}; and ∂y[−cos⁡xcos⁡2y]=2cos⁡xsin⁡2y\partial_y[-\cos x \cos 2y] = 2\cos x \sin 2y.) At (1,π/2)(1,\pi/2): y=π/2y = \pi/2, xy=π/2xy = \pi/2, so

fxy(1,π/2)=6(1)2(π2)+eπ/2+(1)(π2)eπ/2+2cos⁡(1)sin⁡(π)=3π+eπ/2(1+π2)+0.f_{xy}(1,\pi/2) = 6(1)^2\left(\frac{\pi}{2}\right) + e^{\pi/2} + (1)\left(\frac{\pi}{2}\right)e^{\pi/2} + 2\cos(1)\sin(\pi) = 3\pi + e^{\pi/2}\left(1 + \frac{\pi}{2}\right) + 0.

So

fxy(1,π/2)=3π+(1+π2)eπ/2.f_{xy}(1,\pi/2) = 3\pi + \left(1+\tfrac{\pi}{2}\right)e^{\pi/2}.

Compute fyf_y then (fy)x(f_y)_x:

fy(x,y)=2x3y+x exy+2sin⁡(x)sin⁡(2y).f_y(x,y) = 2x^3 y + x\,e^{xy} + 2\sin(x)\sin(2y).

Now differentiate with respect to xx:

fyx(x,y)=6x2y+exy+xy exy+2cos⁡(x)sin⁡(2y).f_{yx}(x,y) = 6x^2 y + e^{xy} + xy\, e^{xy} + 2\cos(x)\sin(2y).

(Using the product rule on xexyx e^{xy}: ∂x(xexy)=exy+x⋅yexy\partial_x(x e^{xy}) = e^{xy} + x \cdot y e^{xy}; and ∂x[2sin⁡xsin⁡2y]=2cos⁡xsin⁡2y\partial_x[2\sin x \sin 2y] = 2\cos x \sin 2y.) At (1,π/2)(1, \pi/2), this is identical term-by-term to the expression for fxy(1,π/2)f_{xy}(1,\pi/2) above:

fyx(1,π/2)=6π/2⋅...=3π+(1+π2)eπ/2.f_{yx}(1,\pi/2) = 6\pi/2\cdot... = 3\pi + \left(1+\tfrac{\pi}{2}\right)e^{\pi/2}.

Indeed fxy≡fyxf_{xy} \equiv f_{yx} as functions here (both equal 6x2y+exy(1+xy)+2cos⁡xsin⁡2y6x^2y + e^{xy}(1+xy) + 2\cos x \sin 2y everywhere), consistent with the theorem since ff is built from polynomials, exponentials, and trigonometric functions — all of whose partial derivatives of every order are continuous everywhere on R2\mathbb{R}^2. The hypotheses of Clairaut's Theorem are satisfied at every point, not just (1,π/2)(1,\pi/2), which is why equality holds identically rather than coincidentally at one point.

Example 2: Using symmetry to shortcut a computation. Suppose we are told g(x,y)=x2y31+x2+ln⁡(1+y2)⋅arctan⁡(x)g(x,y) = \dfrac{x^2 y^3}{1+x^2} + \ln(1+y^2)\cdot \arctan(x) and asked for gyx(1,−1)g_{yx}(1,-1), but computing gyg_y first (which involves the ln⁡(1+y2)\ln(1+y^2) and y3y^3 terms interacting) is more work than computing gxg_x first. Since gg is a composition/product/quotient of functions with continuous partial derivatives of all orders on the region x∈R,y∈Rx \in \mathbb{R}, y\in\mathbb{R} (the quotient x21+x2\frac{x^2}{1+x^2} has denominator never zero), Clairaut's Theorem guarantees gyx=gxyg_{yx} = g_{xy} everywhere, so we may instead compute gxyg_{xy}.

gx(x,y)=2x(1+x2)−x2⋅2x(1+x2)2 y3+ln⁡(1+y2)1+x2=2x(1+x2)2y3+ln⁡(1+y2)1+x2.g_x(x,y) = \frac{2x(1+x^2) - x^2\cdot 2x}{(1+x^2)^2}\, y^3 + \frac{\ln(1+y^2)}{1+x^2} = \frac{2x}{(1+x^2)^2}y^3 + \frac{\ln(1+y^2)}{1+x^2}.

Differentiating with respect to yy:

gxy(x,y)=6xy2(1+x2)2+2y(1+y2)(1+x2).g_{xy}(x,y) = \frac{6x y^2}{(1+x^2)^2} + \frac{2y}{(1+y^2)(1+x^2)}.

At (1,−1)(1,-1): x=1⇒(1+x2)2=4x=1 \Rightarrow (1+x^2)^2 = 4; y2=1y^2 = 1; y=−1y=-1; 1+y2=21+y^2 = 2.

gxy(1,−1)=6(1)(1)4+2(−1)2⋅2=64−24=44=1.g_{xy}(1,-1) = \frac{6(1)(1)}{4} + \frac{2(-1)}{2\cdot 2} = \frac{6}{4} - \frac{2}{4} = \frac{4}{4} = 1.

By Clairaut's Theorem, gyx(1,−1)=1g_{yx}(1,-1) = 1 as well, with no need to redo the (messier) direct computation through gyg_y.

The counterexample: why continuity of the mixed partials is essential

CounterexampleDropping continuity of fxy,fyxf_{xy}, f_{yx} at the point

Define f:R2→Rf : \mathbb{R}^2 \to \mathbb{R} by

f(x,y)={xy(x2−y2)x2+y2(x,y)≠(0,0)0(x,y)=(0,0).f(x,y) = \begin{cases} \dfrac{xy(x^2-y^2)}{x^2+y^2} & (x,y) \neq (0,0) \\ 0 & (x,y) = (0,0). \end{cases}

We show fxf_x and fyf_y exist everywhere (satisfying hypothesis 1 of the theorem globally), fxyf_{xy} and fyxf_{yx} exist everywhere including at the origin (satisfying hypothesis 2), yet

fxy(0,0)=−1≠1=fyx(0,0).f_{xy}(0,0) = -1 \neq 1 = f_{yx}(0,0).

This shows the conclusion fails at (0,0)(0,0) — exactly the point where, as we verify, fxyf_{xy} and fyxf_{yx} fail to be continuous, isolating hypothesis 3 as indispensable.

Away from the origin, ff is a quotient of polynomials with nonvanishing denominator x2+y2>0x^2+y^2 > 0, so it is smooth (all partial derivatives of all orders exist and are continuous) there by the standard quotient and product rules.

At the origin, compute directly from the definition:

fx(0,0)=lim⁡h→0f(h,0)−f(0,0)h=lim⁡h→00−0h=0,f_x(0,0) = \lim_{h\to 0} \frac{f(h,0) - f(0,0)}{h} = \lim_{h \to 0} \frac{0 - 0}{h} = 0,

since f(h,0)=h⋅0⋅(⋯ )/h2=0f(h,0) = h\cdot 0 \cdot(\cdots)/h^2 = 0. Similarly fy(0,0)=0f_y(0,0) = 0.

Computing fx(0,y)f_x(0,y) for y≠0y \neq 0 (needed to then differentiate in yy): for fixed y≠0y\neq 0,

f(x,y)=x3y−xy3x2+y2,f(x,y) = \frac{x^3y - xy^3}{x^2+y^2},

so by the quotient rule,

fx(x,y)=(3x2y−y3)(x2+y2)−(x3y−xy3)(2x)(x2+y2)2.f_x(x,y) = \frac{(3x^2y - y^3)(x^2+y^2) - (x^3y-xy^3)(2x)}{(x^2+y^2)^2}.

At x=0x=0: numerator =(−y3)(y2)−0=−y5= (-y^3)(y^2) - 0 = -y^5, denominator =y4=y^4, so

fx(0,y)=−y5y4=−y(y≠0),fx(0,0)=0.f_x(0,y) = \frac{-y^5}{y^4} = -y \quad (y\neq 0), \qquad f_x(0,0)=0.

So in fact fx(0,y)=−yf_x(0,y) = -y for all yy (including y=0y=0, checked separately above). Therefore

fxy(0,0)=ddy∣y=0fx(0,y)=ddy∣y=0(−y)=−1.f_{xy}(0,0) = \frac{d}{dy}\Big|_{y=0} f_x(0,y) = \frac{d}{dy}\Big|_{y=0}(-y) = -1.

Computing fy(x,0)f_y(x,0) for x≠0x \neq 0 by the symmetric quotient rule computation (swap roles of x,yx,y; note f(x,y)=−f(y,x)f(x,y) = -f(y,x), i.e. ff is antisymmetric under swapping its arguments, which we can exploit): since f(y,x)=−f(x,y)f(y,x) = -f(x,y), we get fy(x,0)f_y(x,0) by symmetry considerations, or directly:

f(x,y)=x3y−xy3x2+y2,fy(x,y)=(x3−3xy2)(x2+y2)−(x3y−xy3)(2y)(x2+y2)2.f(x,y) = \frac{x^3 y - xy^3}{x^2+y^2}, \qquad f_y(x,y) = \frac{(x^3 - 3xy^2)(x^2+y^2) - (x^3y - xy^3)(2y)}{(x^2+y^2)^2}.

At y=0y=0: numerator =x3⋅x2−0=x5= x^3\cdot x^2 - 0 = x^5, denominator =x4=x^4, so

fy(x,0)=x5x4=x(x≠0),fy(0,0)=0,f_y(x,0) = \frac{x^5}{x^4} = x \quad (x \neq 0), \qquad f_y(0,0)=0,

so fy(x,0)=xf_y(x,0) = x for all xx. Therefore

fyx(0,0)=ddx∣x=0fy(x,0)=ddx∣x=0(x)=1.f_{yx}(0,0) = \frac{d}{dx}\Big|_{x=0} f_y(x,0) = \frac{d}{dx}\Big|_{x=0}(x) = 1.

Conclusion of the computation:

fxy(0,0)=−1≠1=fyx(0,0).f_{xy}(0,0) = -1 \neq 1 = f_{yx}(0,0).

Where continuity fails. One can show (by converting to polar coordinates x=rcos⁡θ,y=rsin⁡θx=r\cos\theta, y=r\sin\theta away from the origin and computing the general formula for fxy(x,y)f_{xy}(x,y), fyx(x,y)f_{yx}(x,y) for (x,y)≠(0,0)(x,y)\neq(0,0)) that along the path y=x→0+y = x \to 0^+, fxy(x,x)f_{xy}(x,x) tends to a value different from fxy(0,0)=−1f_{xy}(0,0) = -1; the function fxyf_{xy} oscillates in sign depending on the direction of approach to the origin and hence is discontinuous at (0,0)(0,0) — likewise for fyxf_{yx}. This is exactly the failure of hypothesis 3, and precisely at the point where the conclusion fails. All other hypotheses (existence of fx,fyf_x, f_y everywhere; existence of fxy,fyxf_{xy}, f_{yx} everywhere) hold, isolating continuity of the mixed partials at the point in question as the indispensable assumption.

Scope, edge cases & common traps

SituationWhat happens
fxy,fyxf_{xy}, f_{yx} both exist near (a,b)(a,b) and are continuous at (a,b)(a,b)Equal: fxy(a,b)=fyx(a,b)f_{xy}(a,b)=f_{yx}(a,b) (theorem applies).
fxy,fyxf_{xy}, f_{yx} exist but are not continuous at (a,b)(a,b)May disagree — see the counterexample above.
f∈C2f \in C^2 (all second partials continuous on an open set)Equality holds at every point of that set; this is the most common sufficient hypothesis cited in practice.
Only fxyf_{xy} exists near (a,b)(a,b), and fxyf_{xy} is continuous at (a,b)(a,b); fyx(a,b)f_{yx}(a,b) is known a priori to existA stronger classical variant (due to Young) shows fyx(a,b)f_{yx}(a,b) exists and equals fxy(a,b)f_{xy}(a,b) from continuity of just fxyf_{xy} alone plus differentiability assumptions — a genuinely different, more delicate theorem, beyond our scope here.
Functions of n>2n>2 variablesApply the theorem to each pair of variables holding the others fixed; symmetry of the full Hessian follows entry by entry.
Higher-order mixed partials (e.g. fxxyf_{xxy} vs fxyxf_{xyx} vs fyxxf_{yxx})All equal under iterated CkC^k continuity hypotheses, by repeated application of Clairaut's Theorem to appropriate partial derivatives.

The mathematician behind it

Origins · 1 minAlexis Clairaut and how this was discovered
AC
Alexis Clairaut
1713–1765 · French mathematician, astronomer, and geodesist

Alexis Claude Clairaut was a prodigy of the French Enlightenment mathematical tradition, presenting a paper on space curves to the French Academy of Sciences at age thirteen and being elected to the Academy at eighteen — the youngest member ever admitted at that time. He worked extensively on differential equations, the shape of the Earth (confirming Newton's prediction of an oblate spheroid via the 1736 Lapland expedition), and celestial mechanics, notably producing an accurate prediction of the return of Halley's Comet in 1759. His 1740 memoir on the calculus of several variables contains the symmetry-of-mixed-partials result now bearing his name, though the fully general and rigorous formulation with explicit continuity hypotheses is often credited jointly to the later, more careful analysis of Hermann Schwarz in the nineteenth century — hence the theorem's alternate name, Schwarz's Theorem.

History
- 1740: Alexis Clairaut states the equality of mixed partial derivatives in work on differential equations and exact forms, in the context of what are now called exact differential equations.
- 1797: Joseph-Louis Lagrange discusses conditions on partial derivatives in his treatise on analytic functions, in a period when rigorous limit-based foundations were still being developed.
- 1873: Hermann Amandus Schwarz gives a rigorous proof with an explicit continuity hypothesis, closing the gap left by eighteenth-century treatments that assumed symmetry without full justification.
- 1909: William Henry Young proves a refinement (Young's theorem) requiring only that one mixed partial be continuous, together with the existence of the relevant one-sided partials, strengthening the classical statement.
- 20th century: The theorem becomes a standard tool in the development of Taylor's Theorem in Several Variables and the theory of the Hessian Matrix in optimization and differential geometry.
Is Clairaut's Theorem the same as saying "partial derivatives commute"?

Informally yes, but the precise statement requires care about which partial derivatives and where. The theorem says that at a given point, if the mixed partials fxyf_{xy} and fyxf_{yx} both exist in a neighborhood and are continuous at that point, then their values agree there. It does not claim that the operators ∂x∂y\partial_x \partial_y and ∂y∂x\partial_y \partial_x are identical as operators on all functions — only that they agree when applied to sufficiently regular functions and evaluated at points of continuity. For functions lacking the continuity hypothesis, as the counterexample shows, the two "orders of differentiation" genuinely disagree, so commutativity is a conditional fact, not an algebraic identity.

Do I need to check continuity of the mixed partials every time I compute a derivative in calculus homework?

In practice, no — almost every function built from polynomials, exponentials, logarithms, trigonometric functions, and their compositions, sums, products, and quotients (away from singularities of the quotient) has continuous partial derivatives of all orders on its natural domain. Such functions are called C∞C^\infty or smooth, and Clairaut's Theorem applies automatically and everywhere on the domain. You only need to worry about checking the hypothesis explicitly when a function is defined piecewise, has an isolated exceptional point (like (0,0)(0,0) in a quotient), or is constructed abstractly without an explicit closed form guaranteeing smoothness.

What is the relationship between Clairaut's Theorem and Young's Theorem?

Young's Theorem is a refinement requiring a weaker hypothesis: it assumes that fxf_x and fyf_y exist near a point and that ff is differentiable in the total-derivative sense at nearby points, together with existence of just one mixed partial (say fxyf_{xy}) continuous at the point, and concludes fyxf_{yx} exists there too and equals fxyf_{xy}. This is more delicate to prove and is typically presented after mastering the Clairaut/Schwarz version with both mixed partials assumed to exist and be continuous. The version in this article (Schwarz's form) is the standard workhorse in undergraduate multivariable calculus.

Why does the proof need two separate applications of the Mean Value Theorem rather than one?

The quantity Δ(h,k)\Delta(h,k) is a difference of differences — a genuinely two-dimensional object — so a single one-dimensional Mean Value Theorem application cannot fully linearize it. The first application (in the xx-direction) reduces Δ(h,k)\Delta(h,k) to a difference of fxf_x values in the yy-slot; this is still a difference, not a derivative, so a second application (in the yy-direction) is needed to extract fxyf_{xy} at an intermediate point. Only after both applications do we obtain a clean expression Δ(h,k)=fxy(c,d) hk\Delta(h,k) = f_{xy}(c,d)\,hk that can be compared, via continuity, to the value at (a,b)(a,b).

Does Clairaut's Theorem extend to functions of more than two variables?

Yes. For f:U⊆Rn→Rf : U \subseteq \mathbb{R}^n \to \mathbb{R}, fix any two coordinate directions xi,xjx_i, x_j and hold all other variables constant; the two-variable theorem applies directly to the resulting function of (xi,xj)(x_i,x_j), giving ∂i∂jf=∂j∂if\partial_i \partial_j f = \partial_j \partial_i f at any point where the relevant hypotheses hold. Applying this to every pair (i,j)(i,j) shows the full n×nn \times n Hessian matrix is symmetric under the analogous continuity hypotheses, which is the form of the theorem most often used in optimization theory and differential geometry.

What is the connection to conservative vector fields and curl?

If F=(P,Q)\mathbf{F} = (P,Q) is a vector field that is the gradient of some scalar potential ff, so P=fxP = f_x and Q=fyQ = f_y, then Clairaut's Theorem applied to ff gives Py=fxy=fyx=QxP_y = f_{xy} = f_{yx} = Q_x (assuming continuity of the second partials), which is exactly the statement that the two-dimensional curl of F\mathbf{F} vanishes. This necessary condition for a vector field to be a gradient (conservative) field is a direct corollary of the symmetry of mixed partials, and it underlies exactness tests for differential equations and path-independence results in vector calculus.

Can the two mixed partials be equal even when the continuity hypothesis fails?

Yes — the continuity hypothesis is sufficient, not necessary. It is entirely possible for fxy(a,b)=fyx(a,b)f_{xy}(a,b) = f_{yx}(a,b) to hold at a point where neither mixed partial is continuous; the counterexample in this article only shows that equality can fail without continuity, not that it must. Determining equality without the continuity hypothesis generally requires a direct, case-by-case computation, since the general theorem no longer guarantees the outcome.

Before this

Where this leads