The study of hamiltonian mechanics brought me to the following question.
Let $n$ be a natural number ($n>1$).
Let $A(\mathbf{x})$ be a $n\times n$ matrix consisting of functions $a_{ij}(\mathbf{x})$ ($a_{ij}:\mathbb{R}^n\to\mathbb{R}$): $$ A(\mathbf{x})= \begin{pmatrix} a_{11}(\mathbf{x})& \cdots& a_{1n}(\mathbf{x})\\ \vdots&\ddots&\vdots\\ a_{n1}(\mathbf{x})&\cdots& a_{nn}(\mathbf{x}) \end{pmatrix}. $$ Let $A(\mathbf{x})$ be so, that for any $F(\mathbf{x})$ ($F:\mathbb{R}^n\to\mathbb{R}$): $$ \begin{pmatrix} a_{11}(\mathbf{x})& \cdots& a_{1n}(\mathbf{x})\\ \vdots&\ddots&\vdots\\ a_{n1}(\mathbf{x})&\cdots& a_{nn}(\mathbf{x}) \end{pmatrix} \begin{pmatrix} \frac{\partial F}{\partial x_1}\\ \vdots\\ \frac{\partial F}{\partial x_n} \end{pmatrix} = \begin{pmatrix} g_1(\mathbf{x})\\ \vdots\\ g_n(\mathbf{x}) \end{pmatrix} = \begin{pmatrix} \frac{\partial G}{\partial x_1}\\ \vdots\\ \frac{\partial G}{\partial x_n} \end{pmatrix} $$ for some $G(\mathbf{x})$ ($G:\mathbb{R}^n\to\mathbb{R})$.
In other words, if we multiply fixed $A(\mathbf{x})$ by the gradient of any $F(\mathbf{x})$ we necessarily get the gradient of some $G(\mathbf{x})$.
Can we say anything about such $A(\mathbf{x})$? I would be glad if the only opportunity is that $A(\mathbf{x})=cE$, where $E$ is the identity matrix and $c$ is some real number. Is it correct? Is it possible to prove it?
All the functions are considered to be "good enough" ("smooth enough").
I have found the solution (with the help of Mathoverflow users).
See here: https://mathoverflow.net/questions/239275/is-there-a-matrix-that-converts-the-gradient-of-every-possible-function-to-gradi