# Can every smooth scalar function $f$ on $M$ be written as $f=\operatorname{div}(X)$?

Let $(M,g)$ be a Riemannian manifold of dimension $n$ and $X$ a vector field over it. divergence of $X$ is a real value function defined by: $$\operatorname{div}(X)=g(\nabla_{e_i}X,e_i),$$ where $\{e_1,\cdots, e_n\}$ is a local orthonormal frame on $(M,g)$. it also can be defined (see J. M. Lee, p43, Ex. 3.3) $$\mathcal{L}_XdVol_g=d(i_XdVol_g)=\operatorname{div}(X)dVol_g.$$

Question: Can every smooth scalar function $f$ on $M$ be written as $f=\operatorname{div}(X)$?

I think that this depend on the topology of $M$ by using De-Rham cohomology but I don't know how to apply it.

Note that you can identify vector fields on $M$ with $(n-1)$-forms. To see this, note that the metric provides a map from $T_pM \to (T_pM)^\ast$ since any non-degenerate symmetric bilinear form provides a map into the dual. Since vector fields are sections of the tangent bundle, we can pointwise take the dual to get a section of the cotangent bundle. However this will be a $1$-form which is not what we want (since taking the exterior derivative of this doesn’t yield what we want). We then apply Hodge duality to convert the $1$-form into an $(n-1)$-form. Taking the divergence more or less amounts to taking the exterior derivative of an $(n-1)$-form to yield an $n$-form. We can play the same trick with Hodge duality to convert this back to a $0$-form i.e. a function.
Barring all the technical duality, your question can be restated as: is every $n$-form on $M$ exact? Note that $n$-forms on $M$ are trivially closed. So $H_{DR}^n(M)$ can measure whether every function can be written as the divergence of a vector field. In particular, the answer is yes if and only if $H_{DR}^n(M) = 0$. So you can think of this cohomology group as the group of obstructions to solving this PDE.
Now for an easy criterion: if $M$ is a smooth, connected, oriented manifold, then $H_{DR}^n(M) = \mathbb{R}$ if $M$ is compact and is $0$ if $M$ is not compact.
• .. ans by Poincaré duality, it is equivalent to $H_{DR}^0(M) = 0$ that is $M$ is connected? Is this correct? – C.F.G Aug 14 '18 at 12:34
• I find this answer good enough for me not to post one of my own. However, it wouldn't hurt to add more details, such as the specific identification of vector fields with $n-1$-forms, or $n$-forms with functions. In addition, as there is a rather simple criterion to determine whether the top DR cohomology vanishes or not, I would mention it. Finally, the equation at hand is not an ODE, but a PDE. – Amitai Yuval Aug 14 '18 at 12:39
• @C.F.G not quite. Remember that Poincaré duality only applies for compact, connected, oriented manifolds (without boundary). So you’re missing spaces like $\mathbb{R}^n$ where this is true. Also $H_{DR}^0(M) = \mathbb{R}$ implies path-connectedness, not being equal to 0! – Osama Ghani Aug 14 '18 at 12:52
• It's worth adding that in the case where $H^n_{DR}(M)\ne 0$ (i.e., when $M$ is orientable and compact), there's a simple necessary and sufficient condition for a function $f$ to be a divergence: $\int_M f\, dV_g = 0$. – Jack Lee Aug 15 '18 at 16:54