Tutorials › Calculus III › A Counterexample to Equality of Mixed Partials

Computing Partial Derivatives · Tutorial 321 of 999

A Counterexample to Equality of Mixed Partials

Compute both mixed partials at the origin and see why the example does not satisfy the continuity hypothesis of Clairaut’s theorem.

Beginner 9 min read

What You'll Learn

  • Read the function’s definition at the origin and away from it
  • Compute the first partial derivatives along the coordinate axes
  • Evaluate both mixed partial derivatives at the origin from their definitions
  • Distinguish the two orders of differentiation
  • Check how the mixed partials behave near the origin
  • Identify the failed hypothesis in Clairaut’s theorem

Why Mixed Partials May Differ

Clairaut’s theorem gives a useful way to reduce computation: under suitable continuity conditions, the order of two partial differentiations can be exchanged. Those conditions matter. If they are not satisfied, the mixed partials may exist and still have different values at a point.

We will examine a function that makes this distinction explicit. Its formula is smooth away from the origin, and both mixed partials exist at the origin. Nevertheless, they are unequal there. The key is to calculate each derivative in its prescribed order and then check the continuity condition required by Clairaut’s theorem.

Convention: In this tutorial, \(f_{xy}\) means differentiate first with respect to \(x\), obtaining \(f_x\), and then differentiate with respect to \(y\). Thus \(f_{xy}=(f_x)_y\). Likewise, \(f_{yx}=(f_y)_x\).

The Function and Its Definition

Consider the function

$$ f(x,y)= \begin{cases} \dfrac{xy(x^2-y^2)}{x^2+y^2}, & (x,y)\ne(0,0),\\[6pt] 0, & (x,y)=(0,0). \end{cases} $$

The quotient formula is defined whenever \((x,y)\ne(0,0)\), since then \(x^2+y^2\ne0\). The separate value at the origin completes the definition of \(f\) on all of \(\mathbb R^2\).

A partial derivative at a point is an ordinary one-variable derivative obtained by varying one coordinate and holding the other fixed. For example, the definition of \(f_x(0,y)\) uses the limit

$$ f_x(0,y)=\lim_{h\to0}\frac{f(h,y)-f(0,y)}{h}, $$

when this limit exists. A mixed partial such as \(f_{xy}(0,0)\) is then obtained by differentiating \(f_x(0,y)\) with respect to \(y\) at \(y=0\). Keeping these stages in order is essential.

First Partials Along the Axes

We first compute the partial derivatives needed for the two mixed partials. On the \(y\)-axis, the function is zero: \(f(0,y)=0\) for every \(y\). For \(y\ne0\), the definition of the \(x\)-partial at \((0,y)\) gives

$$ \begin{aligned} f_x(0,y) &=\lim_{h\to0}\frac{f(h,y)-f(0,y)}{h}\\ &=\lim_{h\to0}\frac{1}{h} \left(\frac{hy(h^2-y^2)}{h^2+y^2}-0\right)\\ &=\lim_{h\to0}\frac{y(h^2-y^2)}{h^2+y^2}\\ &=\frac{y(0-y^2)}{0+y^2}\\ &=-y. \end{aligned} $$

At \(y=0\), \(f_x(0,0)=0\), because \(f(h,0)=0\) for every \(h\). This agrees with the formula \(-y\). Therefore, along the entire \(y\)-axis, \(f_x(0,y)=-y\).

Similarly, \(f(x,0)=0\) for every \(x\). For \(x\ne0\), the definition of the \(y\)-partial gives

$$ \begin{aligned} f_y(x,0) &=\lim_{k\to0}\frac{f(x,k)-f(x,0)}{k}\\ &=\lim_{k\to0}\frac{1}{k} \left(\frac{xk(x^2-k^2)}{x^2+k^2}-0\right)\\ &=\lim_{k\to0}\frac{x(x^2-k^2)}{x^2+k^2}\\ &=\frac{x(x^2-0)}{x^2+0}\\ &=x. \end{aligned} $$

At \(x=0\), \(f_y(0,0)=0\), since \(f(0,k)=0\) for every \(k\). Thus \(f_y(x,0)=x\) along the entire \(x\)-axis.

Worked Example: Finding the First Partials Needed at the Origin

Use the one-variable difference quotients to find \(f_x(0,2)\) and \(f_y(-3,0)\), then check them against the axis formulas.

For \(f_x(0,2)\), substitute \(y=2\) into the difference quotient before taking the limit:

$$ \begin{aligned} f_x(0,2) &=\lim_{h\to0}\frac{f(h,2)-f(0,2)}{h}\\ &=\lim_{h\to0}\frac{2(h^2-4)}{h^2+4}\\ &=\frac{2(0-4)}{0+4}\\ &=-2. \end{aligned} $$

For \(f_y(-3,0)\), use the \(y\)-difference quotient:

$$ \begin{aligned} f_y(-3,0) &=\lim_{k\to0}\frac{f(-3,k)-f(-3,0)}{k}\\ &=\lim_{k\to0}\frac{-3(9-k^2)}{9+k^2}\\ &=\frac{-3(9-0)}{9+0}\\ &=-3. \end{aligned} $$

The results agree with \(f_x(0,y)=-y\) at \(y=2\) and \(f_y(x,0)=x\) at \(x=-3\). In each calculation the coordinate not being differentiated remains fixed.

Computing the Two Mixed Partials

To compute \(f_{xy}(0,0)\), start with \(f_x(0,y)=-y\) and differentiate this function of \(y\) at \(y=0\):

$$ \begin{aligned} f_{xy}(0,0) &=\lim_{k\to0}\frac{f_x(0,k)-f_x(0,0)}{k}\\ &=\lim_{k\to0}\frac{-k-0}{k}\\ &=-1. \end{aligned} $$

For the other order, start with \(f_y(x,0)=x\) and differentiate it with respect to \(x\) at \(x=0\):

$$ \begin{aligned} f_{yx}(0,0) &=\lim_{h\to0}\frac{f_y(h,0)-f_y(0,0)}{h}\\ &=\lim_{h\to0}\frac{h-0}{h}\\ &=1. \end{aligned} $$

Both limits exist, but their values differ. This is a counterexample to the claim that the mixed partials must always be equal whenever both exist. It does not contradict Clairaut’s theorem, because that theorem requires more than existence at the point.

Worked Example: Comparing the Mixed Partials

Calculate the difference between the two mixed partials at the origin, and verify its sign using the axis formulas.

The calculations above give

$$ f_{xy}(0,0)=-1 \qquad\text{and}\qquad f_{yx}(0,0)=1. $$

Therefore, in the order \(f_{xy}(0,0)-f_{yx}(0,0)\), the difference is

$$ f_{xy}(0,0)-f_{yx}(0,0)=-1-1=-2. $$

As a check, \(f_x(0,y)=-y\) has derivative \(-1\) with respect to \(y\), while \(f_y(x,0)=x\) has derivative \(1\) with respect to \(x\). These are exactly the two values used in the subtraction, so the order and signs are consistent.

Why Clairaut’s Theorem Does Not Apply

A standard sufficient condition in Clairaut’s theorem is that the mixed second partial derivatives exist and are continuous in a neighborhood of the point. Under that condition, \(f_{xy}\) and \(f_{yx}\) agree at the point. The continuity requirement is not decorative: this example fails it.

We can verify the failure by computing the mixed partials at nearby points on the axes. Away from the origin, the quotient rule applies because \(x^2+y^2\ne0\). Differentiating the quotient with respect to \(x\) gives

$$ f_x(x,y)= \frac{y(x^4+4x^2y^2-y^4)}{(x^2+y^2)^2}, \qquad (x,y)\ne(0,0). $$

At a point \((x,0)\) with \(x\ne0\), differentiate this expression with respect to \(y\). Since the numerator has a factor \(y\), its derivative at \(y=0\) is the remaining factor evaluated there; the denominator is nonzero. Hence

$$ \begin{aligned} f_{xy}(x,0) &=\left.\frac{\partial}{\partial y} \left(\frac{y(x^4+4x^2y^2-y^4)}{(x^2+y^2)^2}\right)\right|_{y=0}\\ &=\frac{x^4}{x^4}\\ &=1,\qquad x\ne0. \end{aligned} $$

But \(f_{xy}(0,0)=-1\). Along points \((x,0)\) with \(x\ne0\), \(f_{xy}(x,0)\) is always \(1\), so its values do not approach \(-1\) as those points approach the origin. Thus \(f_{xy}\) is not continuous at the origin.

The same issue appears for the other mixed partial. Differentiating the quotient with respect to \(y\) first gives

$$ f_y(x,y)= \frac{x(x^4-4x^2y^2-y^4)}{(x^2+y^2)^2}, \qquad (x,y)\ne(0,0). $$

For \(y\ne0\), differentiate with respect to \(x\) at \((0,y)\). The factor multiplying \(x\) is evaluated at \(x=0\), giving

$$ \begin{aligned} f_{yx}(0,y) &=\left.\frac{\partial}{\partial x} \left(\frac{x(x^4-4x^2y^2-y^4)}{(x^2+y^2)^2}\right)\right|_{x=0}\\ &=\frac{-y^4}{y^4}\\ &=-1,\qquad y\ne0. \end{aligned} $$

At the origin, however, \(f_{yx}(0,0)=1\). Therefore \(f_{yx}\) is also not continuous at the origin. The theorem’s continuity hypothesis fails, so its conclusion is not available here.

Worked Example: Testing Continuity of a Mixed Partial

Use nearby points on the \(x\)-axis to test whether \(f_{xy}\) is continuous at the origin.

At the origin, the difference-quotient calculation gives \(f_{xy}(0,0)=-1\). At every point \((x,0)\) with \(x\ne0\), the quotient calculation gives \(f_{xy}(x,0)=1\). For example, along \(x=1/n\), where \(n\in\mathbb N\), the points \((1/n,0)\) approach \((0,0)\), but

$$ f_{xy}(1/n,0)=1 \qquad\text{for every }n\in\mathbb N. $$

Consequently, the values along this sequence approach \(1\), not \(f_{xy}(0,0)=-1\). This directly verifies discontinuity at the origin and identifies why the continuity condition of Clairaut’s theorem is not met.

Why the Order of Operations Matters

A common mistake is to set one coordinate equal to zero in \(f\) first, observe that the resulting function is identically zero, and then conclude that a mixed partial is zero. For instance, \(f(x,0)=0\), so it is true that \(f_x(x,0)=0\). But that fact alone does not compute \(f_{xy}(0,0)\).

To compute \(f_{xy}(0,0)\), one must first form \(f_x(0,y)\) while allowing \(y\) to vary, and then differentiate that result with respect to \(y\). The correct calculation is \(f_x(0,y)=-y\), followed by

$$ f_{xy}(0,0)=\left.\frac{d}{dy}(-y)\right|_{y=0}=-1. $$

Setting \(y=0\) before forming \(f_x(0,y)\) loses the information about how \(f_x\) changes as \(y\) varies. The two mixed partials use different first partials and different directions of variation, so each order must be evaluated from its own definition.

Key takeaway: The existence of both mixed partials at a point does not guarantee that they are equal. Clairaut’s theorem gives equality under continuity conditions; this function violates those conditions at the origin.

Check Your Understanding

Use the definitions and the order of differentiation to answer these questions.

  1. What does \(f_{xy}(0,0)\) mean under the convention used here?
  2. What is \(f_x(0,y)\), including its value when \(y=0\)?
  3. Compute \(f_{xy}(0,0)\) and \(f_{yx}(0,0)\). Why are they unequal?
  4. Which continuity condition in Clairaut’s theorem fails at the origin?
  5. Why does \(f(x,0)=0\) not imply \(f_{xy}(0,0)=0\)?