TITLE: When is a symmetric tensor equal to gradient times gradient?
QUESTION [5 upvotes]: On a ball in $\mathbb R^n$, a vector field $v_j$ is a gradient of a function when its exterior derivative vanishes. In other words, if $$\partial_i v_j-\partial_j v_i=0$$
then there exists a function $u$ such that $v_j=\partial_j u$.
I am looking for something similar for a symmetric tensor. In particular: do you know under which conditions a symmetric tensor $A_{ij}$ can be written as $$A_{ij}=\partial_i u \partial_j u$$
where $u$ is any (smooth) function?
Written in a different way, under which conditions is $A=\nabla u \otimes \nabla u$?
Thanks.

REPLY [4 votes]: Your question is answered in Props. 1 and 2 of

Krongos, D. S.; Torre, C. G., Geometrization conditions for perfect fluids, scalar fields, and electromagnetic fields, J. Math. Phys. 56, No. 7, 072503, 17 p. (2015). ZBL1322.83005. arXiv:1503.06311.

The precise conditions are
\begin{gather*}
  A_{i[j} A_{k]l} = 0 , \\
  A_{ij} A_{k[l,m]} + A_{ik} A_{j[l,m]} + A_{jk,[l} A_{m]i} = 0 ,
\end{gather*}
where $(-)_{,k} = \partial_k (-)$ and $[ij]$ denotes antisymmetrization in the indices $i$ and $j$. The first condition implies that $A_{ij} = \pm v_i v_j$ for some vector $v_i$. Plugging that result into the left-hand side of the second condition gives $2 v_i v_j v_k v_{[l,m]}$, which obviously vanishes iff $v_{[l,m]} = 0$.
There may be a more classical source for this result or other results of this kind, but I'm not aware of it.