# Mixed successive partial derivatives: On the statement of Schwarz's theorem

I have seen many "variations" of Schwarz's theorem on mixed partial derivatives. I found one in a lecture note that states that:

Given f: $$A \subseteq \mathbb{R}^n \longrightarrow \mathbb{R}$$. A is an open set. $$x \in A$$

If the following statements are true:

1. f is differentiable at x.
2. Given $$i, j = 1,2,...,n$$ (i,j are fixed now). These two derivatives: $$\frac{\partial f^2}{\partial x_i\partial x_j}$$ and $$\frac{\partial f^2}{\partial x_j\partial x_i}$$ exist at any point in a neighborhood of x, and they are continuous at x.

then $$\frac{\partial f^2}{\partial x_i\partial x_j} = \frac{\partial f^2}{\partial x_j\partial x_i}$$

I want to know if the theorem above is correct. Is the existence at all points in a neightborhood of x and the continuity at x of all second derivatives a necessary condition for the theorem to hold?

If you want $$\frac{\partial f^2}{\partial x_i \partial x_j}(x) = \frac{\partial f^2}{\partial x_j \partial x_i}(x)$$ for a fixed point $$x \in A$$, it is sufficient for $$\frac{\partial f^2}{\partial x_i \partial x_j}$$ and $$\frac{\partial f^2}{\partial x_j \partial x_i}$$ to exist in an open neighborhood about $$x$$ and for them to be continuous at $$x$$. Note that the mixed partial derivatives only commute at the point $$x$$, and not necessarily at any other point. If you want $$\frac{\partial f^2}{\partial x_i \partial x_j}(y) = \frac{\partial f^2}{\partial x_j \partial x_i}(y)$$ for all $$y$$ in an open neighborhood about $$x$$, then the prior reasoning says that it suffices to have $$\frac{\partial f^2}{\partial x_i \partial x_j}$$ and $$\frac{\partial f^2}{\partial x_j \partial x_i}$$ exist in that open neighborhood about $$x$$ and for them to be continuous at each point in the neighborhood.
Here is the proof for $$\mathbb{R}^2$$, although the proof generalizes. Note that the statement of the theorem in this source says "continuous near $$(a, b)$$" but continuity is only used at the point $$(a,b)$$ specifically. Continuity at $$(a,b)$$ is used only in the very last line of the proof.