I want to prove that for a function $f:\mathbb{R}^n\to\mathbb{R}$, if its mixed partial derivatives $D_{i,j}f$ and $D_{j,i}f$ exist and are continuous at a point $a$, then they are equal. I want to do it using Fubini's theorem (this is an excersise from Spivak's Calculus on manifolds) and I would like you to tell me if the reasoning is correct.
This is my approach:
Suppose they are not equal, then we may assume $D_{i,j}f(a)>D_{j,i}f(a)$ and hence $D_{i,j}f(x)-D_{j,i}f(x)>0$ for all $x$ in a closed rectangle $R$ containing $a$.
Let $[a,b]$ be the projection of $R$ over the $i$th coordinate axis and $[c,d]$ the projection over the $j$th coordinate axis. If we fix all the coordinates of $x$, except the $i$th and the $j$th, then $D_{i,j}f(x)$ and $D_{j,i}f(x)$ are continuous in the compact region $[a,b]×[c,d]$, so they are integrable in that region and the same for $D_{i,j}f(x)-D_{j,i}f(x)$. If we also fix the $j$th coordinate of $D_{i,j}f(x)$ and the $i$th coordinate of $D_{j,i}f(x)$ we have (because of the FTC): $$\int_{[a,b]}D_{i,j}f(x_i,x_j) d x_i=D_jf(b,x_j)-D_jf(a,x_j)$$ $$\int_{[c,d]}D_{j,i}f(x_i,x_j) d x_j=D_if(x_i,d)-D_if(x_i,c)$$ Now we can apply Fubini's theorem to obtain: $$\int\int_{[a,b]×[c,d]}D_{i,j}f(x_i,x_j)=f(b,d)-f(b,c)-f(a,d)+f(a,c)$$ $$\int\int_{[a,b]×[c,d]}D_{j,i}f(x_i,x_j)=f(b,d)-f(b,c)-f(a,d)+f(a,c) $$ So, we have: $$\int\int_{[a,b]×[c,d]}[D_{i,j}f(x_i,x_j)-D_{j,i}f(x_i,x_j)]=0$$ which contradicts the fact that $D_{i,j}f(x)-D_{j,i}f(x)>0$, so the mixed partials must be equal.
Thanks