Derivation of Hamilton-Jacobi Equation

Theorem
Let $S \left({ x_0, x_1, \mathbf y } \right)= S \left({ x, \mathbf y } \right)$ be the geodetic distance, where $x_0$ is fixed and $x_1=x$.

Let $H$ be Hamiltonian.

Then the following equation holds:


 * $ \displaystyle \frac{ \partial S}{ \partial x} + H \left({ x, \mathbf y, \nabla_{ \mathbf y}S } \right)=0$

and is known as the Hamilton-Jacobi Equation.

Proof
Consider the increment $ \Delta S$:


 * $ \Delta S= S \left({ x+ \Delta x, \mathbf y + \mathbf h } \right)- S \left({ x, \mathbf y  } \right)$

Note that the change of function $ \mathbf y$ denoted by $ \mathbf h$ is dependent on the manner $ \Delta x$ is chosen through the definition of geodetic distance.

For sufficiently smooth $S$, $ \left\vert \mathbf h \right \vert \to 0$ as $ \left \vert \Delta \mathbf x \right \vert \to 0$.

By definition of the geodetic distance,


 * $ \Delta S= J[ \gamma^*] - J[ \gamma]$

where $\gamma$ and $\gamma^*$ are extremal curves, connecting the fixed initial point with points $\left({ x, \mathbf y } \right)$ and $\left({ x+ \Delta x, \mathbf y+ \mathbf h } \right)$ respectively.

By definition of increment of functional:


 * $ \mathrm d S= \delta J$

The variation of $J$ is expressible as


 * $ \delta J= \sum_{i=1}^n p_i \mathrm d y_i - H \mathrm d x$

Partial derivatives of $S$ yield


 * $ \frac{ \partial S}{ \partial x}= -H, \quad \nabla_{ \mathbf y} S= - \mathbf p$

Since $H=H \left({ x, \mathbf y, \mathbf p } \right)$, using the second relation to replace $ \mathbf p$ together with the first one proves the formula.