[Math] Can every differentiable scalar function be written as a divergence of some vector field

calculusmultivariable-calculusvector analysis

My question is simple: can every differentiable function $f$ defined on a bounded, connected subset of $\mathbb{R}^3$ be written as a divergence of some vector field ? That is, given the vector field $\mathbf{F}$, you can write:$$f=\nabla\cdot\mathbf{F}$$
Is this always possible? How to prove it?

Best Answer

Sure. For example, supposing the intersection of the domain with every vertical line is an interval containing zero, you could just take

$$ \mathbf F(x,y,z) = (0, 0, \int_0^z f(x,y,t)\,dt) $$

For a domain of a more complex shape it could be more tedious to patch a solution together from smaller ones, but the existence of an $\mathbf F$ isn't really at risk.