TITLE: Why can partial derivatives be exchanged?
QUESTION [12 upvotes]: In the Equality of mixed partial derivatives
 post in this stack exchange, one of the answers to the questions of do partial derivatives commute is: Second order partial derivatives commute if f is $C^2$ (i.e. all the second partial derivatives exist and are continuous). This is sometimes called Schwarz's Theorem or Clairaut's Theorem. This theorem is in my textbooks, yet I cannot seem to find the proof in them. I have tried proving the theorem yet I have gotten stuck. So, what is the proof of Clairaut's Theorem, or why do partial derivatives commute? If the proof is too long, a link to the proof with an intuitive explanation will be sufficient.

REPLY [16 votes]: There's this little proof, which uses differentiation under the integral sign. $$\begin{align} \frac{\partial f}{\partial x}(x,y) &= \frac{\partial f}{\partial x}(x,y_0) + \int_{y_0}^y \frac{\partial^2f}{\partial x \partial y}(x,t)\,{\rm d}t \\ \frac{\partial^2f}{\partial y \partial x}(x,y) &= \frac{\partial}{\partial y}\int_{y_0}^y \frac{\partial^2f}{\partial x \partial y}(x,t)\,{\rm d}t \\  \frac{\partial^2f}{\partial y \partial x}(x,y) &=  \frac{\partial^2f}{\partial x \partial y}(x,y)\end{align}$$

Another one ("TVM" stands for "mean value theorem"):
 
Note that this second proof also shows that we only need that both partial derivatives exist, with only one of them being continuous. It is a stronger version.