In Sommerfeld’s Lectures on Theoretical Physics, Vol II, Chapter 2, Section 6, Page 43 we derive an expression for the equilibrium of liquids as $$ grad ~p = \mathbf F$$ Where $p$ is the pressure and $F$ is the exertnal force. Then he writes,
[ The equation above ]includes a very remarkable Theorem: equilibrium is only possible if the external force has a potential, that is, if $\mathbf F$!can be represented as the gradient of a scalar function: $$ \mathbf F = -grad ~U$$ Where the minus sign is prompted by the relation to the potential energy. The existence of the potential function $U$is n…