---
tag: 01NN8NY497
kind: counterexample
name: Function with unequal mixed partial derivatives
msc: [26B05]
uses: [0NNQY8WCW6, 02RSXVM1ZN]
sources:
  - url: https://en.wikipedia.org/wiki/Symmetry_of_second_derivatives
    locator: Requirement of continuity
---

## Counterexample

One could guess that the mixed [[partial derivatives|02RSXVM1ZN]] $f_{xy}$ and $f_{yx}$ are equal at each point where both exist.
This is false.
Let $f \colon \mathbb{R}^2 \to \mathbb{R}$ be given by
$$f(x, y) = \frac{x y (x^2 - y^2)}{x^2 + y^2} \text{ for } (x, y) \ne (0, 0), \qquad f(0, 0) = 0.$$
Both mixed second partial derivatives of $f$ exist at $(0, 0)$, but $\dfrac{\partial}{\partial y}\left(\dfrac{\partial f}{\partial x}\right)(0, 0) = -1$ and $\dfrac{\partial}{\partial x}\left(\dfrac{\partial f}{\partial y}\right)(0, 0) = 1$.

## Remarks

From the definition, $\partial f / \partial x (0, y) = \lim_{h \to 0} f(h, y) / h = -y$ for each $y$, and $\partial f / \partial y (x, 0) = \lim_{k \to 0} f(x, k) / k = x$ for each $x$. Differentiate these once more at $0$.
The function is of class $C^1$ on $\mathbb{R}^2$, but its second partial derivatives are not continuous at the origin. So [[Schwarz's theorem|0NNQY8WCW6]] does not apply.
This example is due to Peano.

## Explanations

### L1 human

Schwarz's theorem needs continuous second partial derivatives, and this function shows why.
Away from the origin everything is smooth, but at the origin the two orders of differentiation see different limits.
