Higher-order derivatives and commutativity

Once you can find fxf_x and fyf_y for z=f(x,y)z=f(x,y), the obvious next move is to differentiate again. Differentiate fxf_x with respect to xx and you get fxxf_{xx}; differentiate it with respect to yy instead and you get the mixed partial fxyf_{xy}. But you could equally have started from fyf_y and differentiated with respect to xx, giving fyxf_{yx} — a seemingly different route to a second derivative. Do the two mixed partials, fxyf_{xy} and fyxf_{yx}, always agree? For every function you will meet in MA10001 — polynomials, exponentials, logs, trig functions and their combinations — the answer is yes, and the precise reason is Clairaut's (Schwarz's) theorem. This node builds the four second-order partials, states the theorem carefully (continuity is the hidden hypothesis), and works through both a polynomial-exponential example and a harmonic-function example that previews Laplace's equation.

The core insight

If fxyf_{xy} and fyxf_{yx} are continuous near a point, they are equal there, so for ordinary elementary functions the order of partial differentiation simply does not matter.

The core idea

For z=f(x,y)z=f(x,y), differentiating the two first partials fxf_x and fyf_y each with respect to xx and yy again produces four second-order partials. The two "straight" ones repeat the same variable, and the two "mixed" ones switch variables:

fxx=∂∂x ⁣(∂f∂x),fyy=∂∂y ⁣(∂f∂y),fxy=∂∂y ⁣(∂f∂x),fyx=∂∂x ⁣(∂f∂y).f_{xx} = \frac{\partial}{\partial x}\!\left(\frac{\partial f}{\partial x}\right), \qquad f_{yy} = \frac{\partial}{\partial y}\!\left(\frac{\partial f}{\partial y}\right), \qquad f_{xy} = \frac{\partial}{\partial y}\!\left(\frac{\partial f}{\partial x}\right), \qquad f_{yx} = \frac{\partial}{\partial x}\!\left(\frac{\partial f}{\partial y}\right).

where: fxyf_{xy} reads "differentiate w.r.t. xx first, then yy" (left to right in the subscript), which matches the operator notation ∂2f/∂y ∂x\partial^2 f/\partial y\,\partial x read right to left — the two notations describe the same order, so check which convention a given source is using rather than assuming. Two subscripted routes, xx-then-yy versus yy-then-xx, land on the same second derivative whenever the mixed partials are continuous. That equality is the content of Clairaut's theorem: if fxyf_{xy} and fyxf_{yx} both exist and are continuous in a neighborhood of (a,b)(a,b), then

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

where: continuity of the mixed partials near the point is the hypothesis that actually does the work — it is not an automatic algebraic identity, only a near-universal one for the smooth, elementary functions built from polynomials, exponentials, logs and trig functions that dominate this course. Because of this, computing one of fxy,fyxf_{xy}, f_{yx} in practice and treating the other as a free check is standard technique, not a shortcut you have to justify each time. The result extends to third and higher orders: for a function with continuous partials of the relevant order, any mixed partial is independent of the order of differentiation, e.g. fxxy=fxyx=fyxxf_{xxy}=f_{xyx}=f_{yxx}. Continuity is essential — dropping it is exactly how one can (outside routine syllabus computation) construct pathological functions with fxy(0,0)≠fyx(0,0)f_{xy}(0,0)\neq f_{yx}(0,0). It helps to keep the bookkeeping straight before diving into an example. There are always four second-order partials for a function of two variables — two "straight" (fxx,fyyf_{xx}, f_{yy}) and two "mixed" (fxy,fyxf_{xy}, f_{yx}) — and the mixed pair is the only place where order-of-operations is even a question, since fxxf_{xx} and fyyf_{yy} never involve switching variables. This is also where the topic connects forward: once you accept fxy=fyxf_{xy}=f_{yx} for well-behaved functions, quantities like fxx+fyyf_{xx}+f_{yy} (the two-dimensional Laplacian) become well-defined objects worth naming, which is exactly the bridge to harmonic functions and Euler's theorem later in this unit.

Figure
Two paths from f to the mixed partial, x then y and y then x, arriving at the same box under continuity
Commutativity of mixed partials f f_x f_y f_xy = f_yx when both continuous d/dx d/dy d/dy d/dx

Derivation

Derivation AEquality of mixed partials for f of x comma y equals x cubed y squared plus e to the xy

The goal is to compute all four second-order partial derivatives of f(x,y)=x3y2+exyf(x,y)=x^3y^2+e^{xy} directly from the two different orders of differentiation and confirm by explicit algebra, not by invoking the theorem alone, that the two mixed partials fxyf_{xy} and fyxf_{yx} come out identical term for term, which is exactly what Clairaut's theorem guarantees for a function built entirely from polynomials and an exponential.

Step 1. Find the first partials by treating the other variable as constant. Differentiating x3y2x^3y^2 with respect to xx gives 3x2y23x^2y^2, and differentiating exye^{xy} with respect to xx uses the chain rule with inner derivative yy, giving yexyye^{xy}; so fx=3x2y2+yexyf_x = 3x^2y^2+ye^{xy}. Symmetrically, fy=2x3y+xexyf_y = 2x^3y+xe^{xy}.

Step 2. Differentiate fxf_x with respect to yy to get fxyf_{xy}. The term 3x2y23x^2y^2 differentiates to 6x2y6x^2y. The term yexyye^{xy} is now a product of yy and exye^{xy}, so the product rule applies: ∂∂y(yexy)=exy+y⋅xexy=exy+xyexy\frac{\partial}{\partial y}(ye^{xy}) = e^{xy} + y\cdot xe^{xy} = e^{xy}+xye^{xy}. Adding, fxy=6x2y+exy+xyexyf_{xy} = 6x^2y+e^{xy}+xye^{xy}.

Step 3. Differentiate fyf_y with respect to xx to get fyxf_{yx}, following the mirror-image route. The term 2x3y2x^3y differentiates to 6x2y6x^2y. The term xexyxe^{xy} is a product of xx and exye^{xy}, so ∂∂x(xexy)=exy+x⋅yexy=exy+xyexy\frac{\partial}{\partial x}(xe^{xy}) = e^{xy}+x\cdot ye^{xy} = e^{xy}+xye^{xy}. Adding, fyx=6x2y+exy+xyexyf_{yx} = 6x^2y+e^{xy}+xye^{xy}.

Step 4. Compare the two results term by term. Both fxyf_{xy} and fyxf_{yx} equal 6x2y+exy+xyexy6x^2y+e^{xy}+xye^{xy} exactly, with no sign or coefficient mismatch anywhere. This is not a coincidence of this particular ff; it holds because ff is a sum of a polynomial and an exponential, both of which have continuous partial derivatives of every order everywhere, so Clairaut's theorem's hypothesis is satisfied at every point and the equality is guaranteed in advance.

Worked example

Take u(x,y)=ln⁡(x2+y2)u(x,y)=\ln(x^2+y^2), defined for (x,y)≠(0,0)(x,y)\neq(0,0), and find uxx+uyyu_{xx}+u_{yy}.

Step 1. Compute the first partials using the chain rule on ln⁡\ln: ux=2xx2+y2u_x = \dfrac{2x}{x^2+y^2} and uy=2yx2+y2u_y = \dfrac{2y}{x^2+y^2}.

Step 2. Differentiate uxu_x again with respect to xx using the quotient rule: uxx=2(x2+y2)−2x(2x)(x2+y2)2=2y2−2x2(x2+y2)2u_{xx} = \dfrac{2(x^2+y^2)-2x(2x)}{(x^2+y^2)^2} = \dfrac{2y^2-2x^2}{(x^2+y^2)^2}.

Step 3. Differentiate uyu_y again with respect to yy, the same way: uyy=2(x2+y2)−2y(2y)(x2+y2)2=2x2−2y2(x2+y2)2u_{yy} = \dfrac{2(x^2+y^2)-2y(2y)}{(x^2+y^2)^2} = \dfrac{2x^2-2y^2}{(x^2+y^2)^2}.

Step 4. Add the two results. The numerators are exact negatives of each other, (2y2−2x2)+(2x2−2y2)=0(2y^2-2x^2)+(2x^2-2y^2)=0, so uxx+uyy=0u_{xx}+u_{yy}=0 for every (x,y)≠(0,0)(x,y)\neq(0,0). Answer: uxx+uyy=0u_{xx}+u_{yy}=0 away from the origin — u=ln⁡(x2+y2)u=\ln(x^2+y^2) is a harmonic function, a preview of Laplace's equation that follows this topic.

Common traps

  • Reading the subscript order backwards. fxyf_{xy} means differentiate w.r.t. xx first, then yy; the operator form ∂2f/∂y ∂x\partial^2f/\partial y\,\partial x applies the rightmost symbol first, so the two notations agree — but only if you read each one in its own correct direction.
  • Skipping the product rule inside a mixed partial. The first partial you differentiate again is often already a product (like yexyye^{xy}), so the second differentiation needs the product rule, not a mechanical repeat of the first step's pattern.
  • Assuming fxy=fyxf_{xy}=f_{yx} with no justification. For the smooth functions in this course it always holds, but the reason is Clairaut's theorem and its continuity hypothesis, not an algebraic law — say so if asked to justify it.
  • Arithmetic slips in quotient-rule second derivatives. Cancellations like uxx+uyy=0u_{xx}+u_{yy}=0 are common and a sign error while expanding (x2+y2)(x^2+y^2) terms is the usual cause of a wrong nonzero answer.

Ask the tutor: if a mixed-partial computation with a product or quotient buried inside isn't simplifying cleanly, ask the AI tutor to walk through fxyf_{xy} and fyxf_{yx} side by side with you.

Why does the order of differentiation not matter for the functions I meet in this course?

Because Clairaut's theorem says fxy=fyxf_{xy}=f_{yx} whenever both mixed partials are continuous near the point, and every function built from polynomials, exponentials, logs and trig functions — sums, products, quotients, compositions of these — has continuous partial derivatives of every order everywhere it is defined. So the hypothesis is satisfied automatically, and the equality follows every time without you needing to prove continuity by hand.

Do I need to compute both f sub xy and f sub yx on an exam, or is one enough?

Computing one is enough to answer a typical question, and computing the other is a good self-check rather than a required step — since the theorem guarantees they agree for standard functions, a mismatch almost always signals an arithmetic slip rather than a genuinely different value. If a question explicitly asks you to verify fxy=fyxf_{xy}=f_{yx}, then of course compute both and show they match.

What goes wrong if continuity of the mixed partials fails at a point?

Then Clairaut's theorem simply does not apply there, and fxyf_{xy} and fyxf_{yx} can genuinely differ at that one point — this is how the classic pathological counterexamples are built, with a function that behaves normally everywhere except at a single point like the origin where its mixed partials disagree. This situation is outside the routine computations of this course, which use elementary functions with continuous derivatives everywhere they are defined, but it explains why the theorem states a continuity hypothesis rather than claiming the equality unconditionally.

Before this

Where this leads