Partial derivatives of a function which is constant on the diagonal Suppose that $f:\mathbb{R}^n\times \mathbb{R}^n\to \mathbb{R}_+$ is a non negative smooth function such that it vanishes only on the diagonal, i.e., $f(x,y)=0$ iff $x=y$. Is it true then that $$\left[\frac{\partial}{\partial x_i}\frac{\partial}{\partial x_j}f(x,y)\right]_{x=y}=\left[\frac{\partial}{\partial y_i}\frac{\partial}{\partial y_j}f(x,y)\right]_{y=x}?$$
 A: The statement is True, and actually we can conclude a little bit more:

Claim: Suppose that $f:\Bbb R^n\times\Bbb R^n\to [0,+\infty)$ is smooth and  $f(x,y)=0$ iff $x=y$. Then for any $x\in \Bbb R^n$ and any $1\le i, j\le n$, we have 
  $$\frac{\partial^2 f}{\partial x_i\partial x_j}(x,x)=\frac{\partial^2 f}{\partial y_i\partial y_j}(x,x) =-\frac{\partial^2 f}{\partial x_i\partial
y_j}(x,x)=-\frac{\partial^2 f}{\partial x_j\partial y_i}(x,x).$$

Proof: Define 
$$g(u,v)=f(u+v,u-v).$$
By definition, for $(x,y)=(u+v,u-v)$,
$$\frac{\partial g}{\partial u_i}(u,v)=\frac{\partial f}{\partial x_i}(x,y)+\frac{\partial f}{\partial y_i}(x,y),\quad\frac{\partial g}{\partial v_i}(u,v)=\frac{\partial f}{\partial x_i}(x,y)-\frac{\partial f}{\partial y_i}(x,y).$$ 
Denote 
$$A_{ij}=\frac{\partial^2 f}{\partial x_i\partial x_j},\quad B_{ij}=\frac{\partial^2 f}{\partial x_i\partial y_j},\quad C_{ij}=\frac{\partial^2 f}{\partial y_i\partial y_j}$$
for short. It follows that
$$\frac{\partial^2 g}{\partial u_i\partial u_j}(u,v)=A_{ij}(x,y)+B_{ij}(x,y)+B_{ji}(x,y)+C_{ij}(x,y),\tag{1}$$ 
$$\frac{\partial^2 g}{\partial u_i\partial v_j}(u,v)=A_{ij}(x,y)-B_{ij}(x,y)+B_{ji}(x,y)-C_{ij}(x,y).\tag{2}$$
From $f\ge 0$ and $f(x,y)=0$ iff $x=y$ we know that $g\ge 0$ and $g(u,v)=0$ iff $v=0$. Therefore, each point $(u,0)$ is a minimal value point of $g$, so 
$$\frac{\partial g}{\partial u_i}(u,0)=0\Longrightarrow \frac{\partial^2 g}{\partial u_i\partial u_j}(u,0)=0,\tag{3}$$
$$\frac{\partial g}{\partial v_j}(u,0)=0\Longrightarrow \frac{\partial^2 g}{\partial u_i\partial v_j}(u,0)=0.\tag{4}$$
Denote 
$$a_{ij}=A_{ij}(x,x),\quad b_{ij}=B_{ij}(x,x),\quad c_{ij}=C_{ij}(x,x)$$
for short, so we aim at proving $a_{ij}=c_{ij}=-b_{ij}=-b_{ji}$. Combining $(1)$ and  $(3)$ or combining $(2)$ and $(4)$, we have
$$a_{ij}+b_{ij}+b_{ji}+c_{ij}=a_{ij}-b_{ij}+b_{ji}-c_{ij}=0\iff a_{ij}+b_{ji}=b_{ij}+c_{ij}=0.$$
Noting that $a_{ij}=a_{ji}$ and $c_{ij}=c_{ji}$, the conclusion follows. $\qquad\square$
