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 \boldsymbol \psi \left ( { x, \mathbf y } \right ) = \mathbf y' \left ( { x, \mathbf y } \right)$


 * $(2): \quad \mathbf p \left [ { x, \mathbf y, \boldsymbol \psi \left ( { x, \mathbf y } \right ) } \right ] = g_{ \mathbf y } \left ( { x, \mathbf y } \right )$

where $\mathbf p$ is a momentum.

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


 * $(3): \quad \dfrac{ \partial g }{ \partial x } + H \left ( { x, \mathbf y, \dfrac{ \partial g }{ \partial \mathbf y } } \right ) = 0$

Necessary condition
Take the partial derivative of $ \left ( { 3 } \right ) $ $ x $:


 * $(4): \quad \dfrac{ \partial^2 g \left ( { x, \mathbf y } \right ) }{ \partial \mathbf y \partial x } = - \dfrac{ \partial }{ \partial \mathbf y} H \left( { x, \mathbf y, \dfrac{ \partial g }{ \partial \mathbf y } } \right )$

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


 * $(5): \quad \dfrac{ \partial^2 g \left ( { x, \mathbf y } \right ) }{ \partial \mathbf y \partial x } = \dfrac{ \partial \mathbf p \left [ { x, \mathbf y, \boldsymbol \psi \left ( { x, \mathbf y }\right ) } \right ] }{ \partial x }$

Since $g \left({x, \mathbf y}\right)$ depends on $\mathbf y$ only in a direct way:
 * $\dfrac {\partial g} {\partial \mathbf y} = g_{\mathbf y}$

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


 * $\dfrac{ \partial \mathbf p \left [ { x, \mathbf y, \boldsymbol \psi \left ( { x, \mathbf y }\right ) } \right ] }{ \partial x } = - \dfrac{ \partial }{ \partial \mathbf y}  H \left( { x, \mathbf y, \mathbf p \left [ { x, \mathbf y, \boldsymbol \psi \left ( { x, \mathbf y }\right ) } \right ] } \right )$

These are the consistency equations.