I'm working on a problem where the goal is to find all functions $u: \mathbb{R}^n \to \mathbb{R}^n$ such that:
$$D(f)=\sum_{i,j}a_{ij}\frac{\partial^2 f}{\partial x_i \partial x_j}=0 \implies D(f\circ u)=0$$
Where $A=(a_{ij})=A^T$. In order to do that, there is a particular step where we prove that $D(f)(x)=Tr(A H_x(f))$, and $D(f\circ u)(x)=Tr(A J_x(u)^TH_{u(x)}(f)J_x(u))$.
Next, I have to prove the existence of $\lambda(x)$ such that $J_x(u)A J_x(u)^T=\lambda(x)A$.
My work so far is to have proven that:
$$\big(\forall S, Tr(A_1S)=0\implies Tr(A_2S)=0\big)\implies A_2=\lambda A_1$$
I believe this is helpful, however it doesn't really help to prove the proposition. What would be nice to prove is that $H_{u(x)}(f)=\lambda H_x(f)$, which would solve the problem, but I'm not counting on it on too much...
If we write $Q(x)=\sum_{i,j}S_{i,j}x_ix_j$ with $S$ symmetric, then $H_x(Q)=2S$. Therefore, any symmetric matrix can be written as the Hessian at any point of a smooth function.
Note that $D(f)(x)=Tr(AH_x(f))$ and $D(f\circ u)(x)=Tr(J_x(u)^T A J_x(u)H_{u(x)}(f))$.
We know that $D(f)=0\implies D(f\circ u)=0$ according to the definition of $u$, therefore using the result stated in the question above, and the fact that both $H_x(f)$ and $H_{u(x)}(f)$ can be replaced by any symmetric matrix conserving the implication, we thus obtain that there exists, for all $x$, a $\lambda(x)$ such that:
$$J_x(u)^TAJ_x(u)=\lambda(x)A$$
Given that A is symmetric, we can transpose to get wanted result.