TITLE: Representation of smooth function
QUESTION [7 upvotes]: Is it true that any smooth function $f\colon \mathbb{R}^n \to \mathbb{R}^n$ can be represented as
$$
   f(x) = \nabla U(x) + g(x)
$$
where $U(x)$ is a scalar function and $\langle g(x), f(x) \rangle \equiv 0$? Is this representation unique?

REPLY [2 votes]: Let me summarize my comments as an answer to you original question. Given a smooth map $f$, consider a problem of existence of a pair $(U,g)$ such that $U$ is a smooth scalar function and $g$ is a smooth map and such that
$$
  f = \nabla U+g, \tag{1}
$$
$$
f\cdot g = 0. \tag{2}
$$
Multiplying both sides in $(1)$ by $f$, we obtain
$$
  \|f\|^2 - f\cdot \nabla U = f\cdot g = 0.
$$
Hence, problem $(1)+(2)$ can be reduced to the problem of existence of $U$ such that
$$
f\cdot \nabla U = \|f\|^2 \tag{3}
$$
and if the solution of the latter 1st order linear PDE exists, then $g = f - \nabla U$ is the function needed in $(1),(2)$. Unfortunately, I cannot say anything about the existence of solution of this PDE in the general case (i.e. when $f$ is smooth).
Uniqueness does not hold: take $f = 0$, then we are looking for $(U,g)$ such that
$$
  g = - \nabla U.
$$
Clearly, any $U$ smooth solves the problem.