Necessary and Sufficient Condition for First Order System to be Mutually Consistent

Theorem
Let $\mathbf y$, $\boldsymbol\psi$ be N-dimensional vectors.

Let $g$ be a twice differentiable mapping.

Let


 * $(1):\quad\map{\boldsymbol\psi} {x,\mathbf y}=\map{\mathbf y'} {x,\mathbf y}$


 * $(2):\quad\mathbf p\sqbrk{ x, \mathbf y, \map{\boldsymbol\psi} {x,\mathbf y} }=\map{g_{\mathbf y} } {x,\mathbf y}$

where $\mathbf p$ is a momentum.

Then the boundary conditions defined by $\paren 1$ are mutually consistent iff the mapping $\map g {x,\mathbf y}$ satisfies the Hamilton-Jacobi equation:


 * $(3):\displaystyle\quad\frac{\partial g}{\partial x}+\map H {x,\mathbf y,\frac{\partial g}{\partial\mathbf y} }=0$

Necessary condition
Take the partial derivative of $\paren 3$ $x$:


 * $(4):\displaystyle\quad\frac{\partial^2 \map g {x,\mathbf y} }{\partial\mathbf y\partial x}=-\frac{\partial}{\partial\mathbf y}\map H {x,\mathbf y,\frac{\partial g}{\partial\mathbf y} }$

By Schwarz-Clairaut Theorem, the order of partial derivatives of $ g $ can be exchanged:


 * $(5):\displaystyle\quad\frac{\partial^2 \map g {x,\mathbf y} }{\partial\mathbf y\partial x}=\dfrac{\partial\mathbf p\sqbrk{x,\mathbf y,\map{\boldsymbol\psi} {x,\mathbf y} } }{\partial x}$

Since $\map g {x,\mathbf y}$ depends on $\mathbf y$ only in a direct way:
 * $\displaystyle\frac{\partial g}{\partial\mathbf y}=g_{\mathbf y}$

Hence, from $(2)$, $(4)$ and $(5)$ it follows that:


 * $\displaystyle\frac{\partial\mathbf p\sqbrk{x,\mathbf y,\map{\boldsymbol\psi} {x,\mathbf y} } }{\partial x}=-\frac{\partial}{\partial\mathbf y}\map H {x,\mathbf y,\mathbf p\sqbrk{x,\mathbf y,\map{\boldsymbol\psi} {x,\mathbf y} } }$

These are the consistency equations.