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.