# Proof: Gradient of a Hamiltonian System

I am trying to prove the following:

Given that $f \in C^1(E)$ where E is a open simply connected subsets of the plane. Show that the system $\dot x=f(x)$ is a hamiltonian if and only if $\nabla \cdot f=0$ for all $x \in E.$

So $\nabla \cdot f= \partial f/ \partial xe_x +\partial f/ \partial y e_y =0$. I am confused as to where to go from here in order to prove it is a hamiltonian...

• can you state your definition of what it means for a system to be Hamiltonian? – BaronVT Nov 19 '13 at 18:41
• $\dot x= \partial H/ \partial y$ and $\dot y =- \partial H/ \partial x$ – user75514 Nov 19 '13 at 18:48

Ok, so maybe there's some notational confusion here; in particular, since you write $\nabla \cdot f$, this seems to indicate that $f$ is a vector field, and $x$ is a vector. So maybe if we switch from $x$ to $(x,y)$, and write $f = (f_x(x,y),f_y(x,y))$ things become clearer. (the subscripts are to indicate components, not derivatives)

Then the statement is:

Show that $(\dot x,\dot y) = (f_x(x,y),f_y(x,y))$ is Hamiltonian if and only if $\nabla \cdot f = 0$ for all $(x,y) \in E$.

Then, we want to show that $f_x = \frac{\partial H}{\partial y}$ and $f_y = -\frac{\partial H}{\partial x}$ for some $H$ if and only if $\nabla \cdot f = 0$.

One direction is clear: if the system is Hamiltonian, then $$\nabla \cdot f = \partial_x f_x + \partial_y f_y = \partial_x \left(\frac{\partial H}{\partial y}\right) + \partial_y\left(-\frac{\partial H}{\partial x}\right) = 0.$$

Ok, to spell out the suggestion I made in a comment below:

Fix some $(x_0,y_0) \in E$ and define $H(x_0,y_0) = 0$ ($H$ is only determined up to a constant, so this is fine). Now, to define $H(x,y)$, let $\gamma : [0,1] \to E$ be a path such that $\gamma(0) = (x_0,y_0)$ and $\gamma(1) = (x,y)$, and define

$$H(x,y) = \oint_\gamma -f_y\,dx + f_x\,dy$$

this will automatically satisfy the conditions $\frac{\partial H}{\partial y} = f_x$ etc. What remains to be shown is that $H$ is well-defined - i.e. that this definition depends only on the endpoint $(x,y)$ and not the particular choice of path $\gamma$.

So, let $\gamma_1$ and $\gamma_2$ be two such paths, and let $C$ be the path that goes from $(x_0,y_0)$ to $(x,y)$ along $\gamma_1$, and then comes back to $(x_0,y_0)$ along $\gamma_2$ (in the reverse direction). Then $C$ is a closed curve bounding some region $D \subset E$. By Green's theorem, $$\oint_C -f_y\,dx + f_x\,dy = \int\int_D \frac{\partial (f_x)}{\partial x} -\frac{\partial (- f_y)}{\partial y}\,dxdy = \int\int_D \nabla\cdot f \,dxdy = 0$$

showing that $$\oint_{\gamma_1} -f_y\,dx + f_x\,dy = \oint_{\gamma_2} -f_y\,dx + f_x\,dy$$ and we're done.

• Yep, sorry I was vague on the clarification. I got that direction as well. It's the reverse direction that is stumping me. I think there is a way to construct the Hamiltonian system from the divergence equation by some sort of integral. – user75514 Nov 19 '13 at 19:14
• Ok, I think I figured it out, but I'm on my mobile; I'll write more when I'm back at a computer. Basically, fix some point in E, set H to 0 there, and then use a path integral starting there to define H at other points. You can use Green's theorem and the vanishing divergence to show that definition is independent of the path chosen. – BaronVT Nov 19 '13 at 20:13
• How do I use a path integral to define H at other points? – user75514 Nov 19 '13 at 20:28
• @user75514 Ok, I've written out the details now. – BaronVT Nov 19 '13 at 20:47
• Thanks! It was very clear! – user75514 Nov 19 '13 at 21:08