Hamilton–Jacobi equation

In physics, the Hamilton–Jacobi equation, named after William Rowan Hamilton and Carl Gustav Jacob Jacobi, is an alternative formulation of classical mechanics, equivalent to other formulations such as Newton's laws of motion, Lagrangian mechanics and Hamiltonian mechanics.

The Hamilton–Jacobi equation is a formulation of mechanics in which the motion of a particle can be represented as a wave. In this sense, it fulfilled a long-held goal of theoretical physics (dating at least to Johann Bernoulli in the eighteenth century) of finding an analogy between the propagation of light and the motion of a particle. The wave equation followed by mechanical systems is similar to, but not identical with, Schrödinger's equation, as described below; for this reason, the Hamilton–Jacobi equation is considered the "closest approach" of classical mechanics to quantum mechanics. The qualitative form of this connection is called Hamilton's optico-mechanical analogy.

In mathematics, the Hamilton–Jacobi equation is a necessary condition describing extremal geometry in generalizations of problems from the calculus of variations. It can be understood as a special case of the Hamilton–Jacobi–Bellman equation from dynamic programming.

Overview
The Hamilton–Jacobi equation is a first-order, non-linear partial differential equation

for a system of particles at coordinates $\mathbf{q}$. The function $$H$$ is the system's Hamiltonian giving the system's energy. The solution of the equation is the action functional, $S$, called Hamilton's principal function in older textbooks. The solution can be related to the system Lagrangian $$\ \mathcal{L}\ $$ by an indefinite integral of the form used in the principle of least action: $$\ S = \int \mathcal{L}\ \operatorname{d}t + ~\mathsf{ some\ constant}~$$ Geometrical surfaces of constant action are perpendicular to system trajectories, creating a wavefront-like view of the system dynamics. This property of the Hamilton–Jacobi equation connects classical mechanics to quantum mechanics.

Notation
Boldface variables such as $$\mathbf{q}$$ represent a list of $$N$$ generalized coordinates, $$\mathbf{q} = (q_1, q_2, \ldots, q_{N-1}, q_N)$$

A dot over a variable or list signifies the time derivative (see Newton's notation). For example, $$\dot{\mathbf{q}} = \frac{d\mathbf{q}}{dt}.$$

The dot product notation between two lists of the same number of coordinates is a shorthand for the sum of the products of corresponding components, such as $$\mathbf{p} \cdot \mathbf{q} = \sum_{k=1}^N p_k q_k.$$

Definition
Let the Hessian matrix $H_{\cal L}(\mathbf{q},\mathbf{\dot q},t) = \left\{\partial^2 {\cal L}/\partial {\dot q}^i\partial {\dot q}^j\right\}_{ij}$ be invertible. The relation $$ \frac{d}{dt}\frac{\partial {\cal L}}{\partial{\dot q}^i} = \sum^n_{j=1}\left(\frac{\partial^2 {\cal L}}{\partial{\dot q}^i\partial{\dot q}^j} {\ddot q}^j + \frac{\partial^2 {\cal L}}{\partial{\dot q}^i\partial{q}^j}{\dot q}^j \right) +\frac{\partial^2 {\cal L}}{\partial{\dot q}^i \partial t},\qquad i=1,\ldots,n, $$ shows that the Euler–Lagrange equations form a $$n \times n$$ system of second-order ordinary differential equations. Inverting the matrix $$H_{\cal L}$$ transforms this system into $$\ddot q^i = F_i(\mathbf{q},\mathbf{\dot q},t),\ i=1,\ldots, n.$$

Let a time instant $$t_0$$ and a point $$\mathbf{q}_0 \in M$$ in the configuration space be fixed. The existence and uniqueness theorems guarantee that, for every $$\mathbf{v}_0,$$ the initial value problem with the conditions $$\gamma|_{\tau=t_0} = \mathbf{q}_0$$ and $${\dot \gamma}|_{\tau=t_0} = \mathbf{v}_0$$ has a locally unique solution $$\gamma = \gamma(\tau; t_0,\mathbf{q}_0,\mathbf{v}_0).$$ Additionally, let there be a sufficiently small time interval $$ (t_0,t_1) $$ such that extremals with different initial velocities $$\mathbf{v}_0$$ would not intersect in $$M \times (t_0,t_1).$$ The latter means that, for any $$\mathbf{q} \in M$$ and any $$t \in (t_0,t_1),$$ there can be at most one extremal $$\gamma=\gamma(\tau;t,t_0,\mathbf{q},\mathbf{q}_0)$$ for which $$\gamma|_{\tau=t_0} = \mathbf{q}_0$$ and $$\gamma|_{\tau=t} = \mathbf{q}.$$ Substituting $$\gamma=\gamma(\tau;t,t_0,\mathbf{q},\mathbf{q}_0)$$ into the action functional results in the Hamilton's principal function (HPF)

where
 * $$\gamma=\gamma(\tau;t,t_0,\mathbf{q},\mathbf{q}_0),$$
 * $$\gamma|_{\tau=t_0} = \mathbf{q}_0,$$
 * $$\gamma|_{\tau=t} = \mathbf{q}.$$

Formula for the momenta
The momenta are defined as the quantities $ p_i(\mathbf{q},\mathbf{\dot q},t) = \partial {\cal L}/\partial \dot q^i.$ This section shows that the dependency of $$p_i$$ on $$\mathbf{\dot q}$$ disappears, once the HPF is known.

Indeed, let a time instant $$t_0$$ and a point $$\mathbf{q}_0$$ in the configuration space be fixed. For every time instant $$t$$ and a point $$\mathbf{q},$$ let $$\gamma=\gamma(\tau;t,t_0,\mathbf{q},\mathbf{q}_0)$$ be the (unique) extremal from the definition of the Hamilton's principal function $S$. Call $$\mathbf{v}\, \stackrel{\text{def}}{=}\, \dot \gamma(\tau;t,t_0,\mathbf{q},\mathbf{q}_0)|_{\tau=t}$$ the velocity at $\tau = t$. Then

$$

Formula
Given the Hamiltonian $$H(\mathbf{q},\mathbf{p},t)$$ of a mechanical system, the Hamilton–Jacobi equation is a first-order, non-linear partial differential equation for the Hamilton's principal function $$S$$,

$$

Alternatively, as described below, the Hamilton–Jacobi equation may be derived from Hamiltonian mechanics by treating $$ S$$ as the generating function for a canonical transformation of the classical Hamiltonian $$H = H(q_1,q_2,\ldots, q_N;p_1,p_2,\ldots, p_N;t).$$

The conjugate momenta correspond to the first derivatives of $$S$$ with respect to the generalized coordinates $$p_k = \frac{\partial S}{\partial q_k}.$$

As a solution to the Hamilton–Jacobi equation, the principal function contains $$N+1$$ undetermined constants, the first $$N$$ of them denoted as $$\alpha_1,\, \alpha_2, \dots, \alpha_N$$, and the last one coming from the integration of $$\frac{\partial S}{\partial t}$$.

The relationship between $$\mathbf{p}$$ and $$\mathbf{q}$$ then describes the orbit in phase space in terms of these constants of motion. Furthermore, the quantities $$\beta_k=\frac{\partial S}{\partial\alpha_k},\quad k=1,2, \ldots, N $$ are also constants of motion, and these equations can be inverted to find $$\mathbf{q}$$ as a function of all the $$\alpha$$ and $$\beta$$ constants and time.

Comparison with other formulations of mechanics
The Hamilton–Jacobi equation is a single, first-order partial differential equation for the function of the $$N$$ generalized coordinates $$q_1,\, q_2, \dots, q_N$$ and the time $$t$$. The generalized momenta do not appear, except as derivatives of $$S$$, the classical action.

For comparison, in the equivalent Euler–Lagrange equations of motion of Lagrangian mechanics, the conjugate momenta also do not appear; however, those equations are a system of $$N$$, generally second-order equations for the time evolution of the generalized coordinates. Similarly, Hamilton's equations of motion are another system of 2N first-order equations for the time evolution of the generalized coordinates and their conjugate momenta $$p_1,\, p_2, \dots, p_N$$.

Since the HJE is an equivalent expression of an integral minimization problem such as Hamilton's principle, the HJE can be useful in other problems of the calculus of variations and, more generally, in other branches of mathematics and physics, such as dynamical systems, symplectic geometry and quantum chaos. For example, the Hamilton–Jacobi equations can be used to determine the geodesics on a Riemannian manifold, an important variational problem in Riemannian geometry. However as a computational tool, the partial differential equations are notoriously complicated to solve except when is it possible to separate the independent variables; in this case the HJE become computationally useful.

Derivation using a canonical transformation
Any canonical transformation involving a type-2 generating function $$G_2 (\mathbf{q}, \mathbf{P}, t)$$ leads to the relations $$ \mathbf{p} = {\partial G_2 \over \partial \mathbf{q}}, \quad \mathbf{Q} = {\partial G_2 \over \partial \mathbf{P}}, \quad K(\mathbf{Q},\mathbf{P},t) = H(\mathbf{q},\mathbf{p},t) + {\partial G_2 \over \partial t} $$ and Hamilton's equations in terms of the new variables $$\mathbf{P}, \,\mathbf{Q}$$ and new Hamiltonian $$K$$ have the same form: $$ \dot{\mathbf{P}} = -{\partial K \over \partial \mathbf{Q}}, \quad \dot{\mathbf{Q}} = +{\partial K \over \partial \mathbf{P}}. $$

To derive the HJE, a generating function $$G_2 (\mathbf{q}, \mathbf{P}, t)$$ is chosen in such a way that, it will make the new Hamiltonian $$K=0$$. Hence, all its derivatives are also zero, and the transformed Hamilton's equations become trivial $$\dot{\mathbf{P}} = \dot{\mathbf{Q}} = 0$$ so the new generalized coordinates and momenta are constants of motion. As they are constants, in this context the new generalized momenta $$\mathbf{P}$$ are usually denoted $$\alpha_1,\, \alpha_2, \dots, \alpha_N$$, i.e. $$P_m =\alpha_m$$ and the new generalized coordinates $$\mathbf{Q}$$ are typically denoted as $$\beta_1,\, \beta_2, \dots , \beta_N$$, so $$Q_m =\beta_m$$.

Setting the generating function equal to Hamilton's principal function, plus an arbitrary constant $$A$$: $$G_2(\mathbf{q},\boldsymbol{\alpha},t)=S(\mathbf{q},t)+A, $$ the HJE automatically arises $$\mathbf{p}=\frac{\partial G_2}{\partial \mathbf{q}}=\frac{\partial S}{\partial \mathbf{q}} \, \rightarrow \, H(\mathbf{q},\mathbf{p},t) + {\partial G_2 \over \partial t}=0 \, \rightarrow \, H\left(\mathbf{q},\frac{\partial S}{\partial \mathbf{q}},t\right) + {\partial S \over \partial t}=0. $$

When solved for $$ S(\mathbf{q},\boldsymbol\alpha, t) $$, these also give us the useful equations $$\mathbf{Q} = \boldsymbol\beta = {\partial S \over \partial \boldsymbol\alpha},$$ or written in components for clarity $$ Q_{m} = \beta_{m} = \frac{\partial S(\mathbf{q},\boldsymbol\alpha, t)}{\partial \alpha_{m}}. $$

Ideally, these N equations can be inverted to find the original generalized coordinates $$ \mathbf{q} $$ as a function of the constants $$ \boldsymbol\alpha, \,\boldsymbol\beta, $$ and $$ t $$, thus solving the original problem.

Separation of variables
When the problem allows additive separation of variables, the HJE leads directly to constants of motion. For example, the time t can be separated if the Hamiltonian does not depend on time explicitly. In that case, the time derivative $$\frac{\partial S}{\partial t} $$ in the HJE must be a constant, usually denoted ($$-E $$), giving the separated solution $$ S = W(q_1,q_2, \ldots, q_N) - Et $$ where the time-independent function $$W(\mathbf{q}) $$ is sometimes called the abbreviated action or Hamilton's characteristic function and sometimes   written $$S_0$$ (see action principle names). The reduced Hamilton–Jacobi equation can then be written $$ H\left(\mathbf{q},\frac{\partial S}{\partial \mathbf{q}} \right) = E. $$

To illustrate separability for other variables, a certain generalized coordinate $$q_k $$ and its derivative $$\frac{\partial S}{\partial q_k} $$ are assumed to appear together as a single function $$\psi \left(q_k, \frac{\partial S}{\partial q_k} \right)$$ in the Hamiltonian $$ H = H(q_1,q_2,\ldots, q_{k-1}, q_{k+1},\ldots, q_N; p_1,p_2,\ldots, p_{k-1}, p_{k+1},\ldots, p_N; \psi; t). $$

In that case, the function S can be partitioned into two functions, one that depends only on qk and another that depends only on the remaining generalized coordinates $$S = S_k(q_k) + S_\text{rem}(q_1,\ldots, q_{k-1}, q_{k+1}, \ldots, q_N, t). $$

Substitution of these formulae into the Hamilton–Jacobi equation shows that the function ψ must be a constant (denoted here as $$\Gamma_k $$), yielding a first-order ordinary differential equation for $$S_k (q_k), $$

$$ \psi \left(q_k, \frac{ d S_k}{ d q_k} \right) = \Gamma_k. $$

In fortunate cases, the function $$S $$ can be separated completely into $$N $$ functions $$S_m (q_m), $$ $$ S=S_1(q_1)+S_2(q_2)+\cdots+S_N(q_N)-Et. $$

In such a case, the problem devolves to $$N $$ ordinary differential equations.

The separability of S depends both on the Hamiltonian and on the choice of generalized coordinates. For orthogonal coordinates and Hamiltonians that have no time dependence and are quadratic in the generalized momenta, $$S $$ will be completely separable if the potential energy is additively separable in each coordinate, where the potential energy term for each coordinate is multiplied by the coordinate-dependent factor in the corresponding momentum term of the Hamiltonian (the Staeckel conditions). For illustration, several examples in orthogonal coordinates are worked in the next sections.

Spherical coordinates
In spherical coordinates the Hamiltonian of a free particle moving in a conservative potential U can be written $$ H = \frac{1}{2m} \left[ p_{r}^{2} + \frac{p_{\theta}^{2}}{r^{2}} + \frac{p_{\phi}^{2}}{r^{2} \sin^{2} \theta} \right] + U(r, \theta, \phi). $$

The Hamilton–Jacobi equation is completely separable in these coordinates provided that there exist functions $$ U_{r}(r), U_{\theta}(\theta), U_{\phi}(\phi) $$ such that $$U$$ can be written in the analogous form $$ U(r, \theta, \phi) = U_{r}(r) + \frac{U_{\theta}(\theta)}{r^{2}} + \frac{U_{\phi}(\phi)}{r^{2}\sin^{2}\theta}. $$

Substitution of the completely separated solution $$S = S_{r}(r) + S_{\theta}(\theta) + S_{\phi}(\phi) - Et$$ into the HJE yields $$ \frac{1}{2m} \left( \frac{ dS_{r}}{ dr} \right)^{2} + U_{r}(r) + \frac{1}{2m r^{2}} \left[ \left( \frac{ dS_{\theta}}{ d\theta} \right)^{2} + 2m U_{\theta}(\theta) \right] + \frac{1}{2m r^{2}\sin^{2}\theta} \left[ \left( \frac{ dS_{\phi}}{ d\phi} \right)^{2} + 2m U_{\phi}(\phi) \right] = E. $$

This equation may be solved by successive integrations of ordinary differential equations, beginning with the equation for $$\phi$$ $$ \left( \frac{ dS_{\phi}}{ d\phi} \right)^{2} + 2m U_{\phi}(\phi) = \Gamma_{\phi} $$ where $$\Gamma_\phi$$ is a constant of the motion that eliminates the $$\phi$$ dependence from the Hamilton–Jacobi equation $$ \frac{1}{2m} \left( \frac{ dS_{r}}{ dr} \right)^{2} + U_{r}(r) + \frac{1}{2m r^{2}} \left[ \left( \frac{ dS_{\theta}}{ d\theta} \right)^{2} + 2m U_{\theta}(\theta) + \frac{\Gamma_{\phi}}{\sin^{2}\theta} \right] = E. $$

The next ordinary differential equation involves the $$\theta$$ generalized coordinate $$ \left( \frac{ dS_{\theta}}{ d\theta} \right)^{2} + 2m U_{\theta}(\theta) + \frac{\Gamma_{\phi}}{\sin^{2}\theta} = \Gamma_{\theta} $$ where $$\Gamma_\theta$$ is again a constant of the motion that eliminates the $$\theta$$ dependence and reduces the HJE to the final ordinary differential equation $$ \frac{1}{2m} \left( \frac{ dS_{r}}{ dr} \right)^{2} + U_{r}(r) + \frac{\Gamma_{\theta}}{2m r^{2}} = E $$ whose integration completes the solution for $$S$$.

Elliptic cylindrical coordinates
The Hamiltonian in elliptic cylindrical coordinates can be written $$ H = \frac{p_{\mu}^{2} + p_{\nu}^{2}}{2ma^{2} \left( \sinh^{2} \mu + \sin^{2} \nu\right)} + \frac{p_{z}^{2}}{2m}  + U(\mu, \nu, z) $$ where the foci of the ellipses are located at $$\pm a$$ on the $$x$$-axis. The Hamilton–Jacobi equation is completely separable in these coordinates provided that $$U$$ has an analogous form $$ U(\mu, \nu, z) = \frac{U_{\mu}(\mu) + U_{\nu}(\nu)}{\sinh^{2} \mu + \sin^{2} \nu} + U_{z}(z) $$ where $$ U_\mu(\mu)$$, $$U_\nu(\nu)$$ and $$U_z(z)$$ are arbitrary functions. Substitution of the completely separated solution $$S = S_{\mu}(\mu) + S_{\nu}(\nu) + S_{z}(z) - Et$$ into the HJE yields $$ \frac{1}{2m} \left( \frac{ dS_{z}}{ dz} \right)^{2} + U_{z}(z) + \frac{1}{2ma^{2} \left( \sinh^{2} \mu + \sin^{2} \nu\right)} \left[ \left( \frac{ dS_{\mu}}{ d\mu} \right)^{2} + \left( \frac{ dS_{\nu}}{ d\nu} \right)^{2} + 2m a^{2} U_{\mu}(\mu) + 2m a^{2} U_{\nu}(\nu)\right] = E. $$

Separating the first ordinary differential equation $$ \frac{1}{2m} \left( \frac{ dS_{z}}{ dz} \right)^{2} + U_{z}(z) = \Gamma_{z} $$ yields the reduced Hamilton–Jacobi equation (after re-arrangement and multiplication of both sides by the denominator) $$ \left( \frac{ dS_{\mu}}{ d\mu} \right)^{2} + \left( \frac{ dS_{\nu}}{ d\nu} \right)^{2} + 2m a^{2} U_{\mu}(\mu) + 2m a^{2} U_{\nu}(\nu) = 2ma^{2} \left( \sinh^{2} \mu + \sin^{2} \nu\right) \left( E - \Gamma_{z} \right) $$ which itself may be separated into two independent ordinary differential equations $$ \left( \frac{ dS_{\mu}}{ d\mu} \right)^{2} + 2m a^{2} U_{\mu}(\mu) + 2ma^{2} \left(\Gamma_{z} - E \right) \sinh^{2} \mu = \Gamma_{\mu} $$ $$ \left( \frac{ dS_{\nu}}{ d\nu} \right)^{2} + 2m a^{2} U_{\nu}(\nu) + 2ma^{2} \left(\Gamma_{z} - E \right) \sin^{2} \nu = \Gamma_{\nu} $$ that, when solved, provide a complete solution for $$S$$.

Parabolic cylindrical coordinates
The Hamiltonian in parabolic cylindrical coordinates can be written $$ H = \frac{p_{\sigma}^{2} + p_{\tau}^{2}}{2m \left( \sigma^{2} + \tau^{2}\right)} + \frac{p_{z}^{2}}{2m} + U(\sigma, \tau, z). $$

The Hamilton–Jacobi equation is completely separable in these coordinates provided that $$U$$ has an analogous form $$ U(\sigma, \tau, z) = \frac{U_{\sigma}(\sigma) + U_{\tau}(\tau)}{\sigma^{2} + \tau^{2}} + U_{z}(z) $$ where $$U_\sigma (\sigma)$$, $$U_\tau (\tau)$$, and $$U_z(z)$$ are arbitrary functions. Substitution of the completely separated solution $$S = S_{\sigma}(\sigma) + S_{\tau}(\tau) + S_{z}(z) - Et + \text{constant}$$ into the HJE yields $$ \frac{1}{2m} \left( \frac{ dS_{z}}{ dz} \right)^{2} + U_{z}(z) + \frac{1}{2m \left( \sigma^{2} + \tau^{2} \right)} \left[ \left( \frac{ dS_{\sigma}}{ d\sigma} \right)^{2} + \left( \frac{ dS_{\tau}}{ d\tau} \right)^{2} + 2m U_{\sigma}(\sigma) + 2m U_{\tau}(\tau)\right] = E. $$

Separating the first ordinary differential equation $$\frac{1}{2m} \left( \frac{ dS_{z}}{ dz} \right)^{2} + U_{z}(z) = \Gamma_{z}$$ yields the reduced Hamilton–Jacobi equation (after re-arrangement and multiplication of both sides by the denominator) $$\left( \frac{ dS_{\sigma}}{ d\sigma} \right)^{2} + \left( \frac{ dS_{\tau}}{ d\tau} \right)^{2} + 2m U_{\sigma}(\sigma) + 2m U_{\tau}(\tau) = 2m \left( \sigma^{2} + \tau^{2} \right) \left( E - \Gamma_{z} \right)$$ which itself may be separated into two independent ordinary differential equations $$\left( \frac{ dS_{\sigma}}{ d\sigma} \right)^{2} + 2m U_{\sigma}(\sigma) + 2m\sigma^{2} \left(\Gamma_{z} - E \right) = \Gamma_{\sigma}$$ $$\left( \frac{ dS_{\tau}}{ d\tau} \right)^{2} + 2m U_{\tau}(\tau) + 2m \tau^{2} \left(\Gamma_{z} - E \right) = \Gamma_{\tau}$$ that, when solved, provide a complete solution for $$S$$.

Optical wave fronts and trajectories
The HJE establishes a duality between trajectories and wavefronts. For example, in geometrical optics, light can be considered either as “rays” or waves. The wave front can be defined as the surface ${\cal C}_{t}$ that the light emitted at time $t=0$  has reached at time $t$. Light rays and wave fronts are dual: if one is known, the other can be deduced.

More precisely, geometrical optics is a variational problem where the “action” is the travel time $T$ along a path,$$T = \frac{1}{c}\int_{A}^{B} n \, ds$$ where $n$  is the medium's index of refraction and $ds$  is an infinitesimal arc length. From the above formulation, one can compute the ray paths using the Euler–Lagrange formulation; alternatively, one can compute the wave fronts by solving the Hamilton–Jacobi equation. Knowing one leads to knowing the other.

The above duality is very general and applies to all systems that derive from a variational principle: either compute the trajectories using Euler–Lagrange equations or the wave fronts by using Hamilton–Jacobi equation.

The wave front at time $t$, for a system initially at $\mathbf{q}_{0}$ at time $t_{0}$ , is defined as the collection of points $\mathbf{q}$  such that $S(\mathbf{q},t)=\text{const}$. If $S(\mathbf{q},t)$ is known, the momentum is immediately deduced.$$\mathbf{p}=\frac{\partial S}{\partial\mathbf{q}}.$$

Once $\mathbf{p}$ is known, tangents to the trajectories $\dot{\mathbf{q}}$  are computed by solving the equation$$\frac{\partial{\cal L}}{\partial\dot{ \mathbf{q}}}=\boldsymbol{p}$$for $\dot{\mathbf{q}}$, where ${\cal L}$  is the Lagrangian. The trajectories are then recovered from the knowledge of $\dot{\mathbf{q}}$.

Relationship to the Schrödinger equation
The isosurfaces of the function $$S(\mathbf{q}, t)$$ can be determined at any time t. The motion of an $$S$$-isosurface as a function of time is defined by the motions of the particles beginning at the points $$\mathbf{q}$$ on the isosurface. The motion of such an isosurface can be thought of as a wave moving through $$\mathbf{q}$$-space, although it does not obey the wave equation exactly. To show this, let S represent the phase of a wave $$ \psi = \psi_{0} e^{iS/\hbar} $$ where $$\hbar$$ is a constant (the Planck constant) introduced to make the exponential argument dimensionless; changes in the amplitude of the wave can be represented by having $$S$$ be a complex number. The Hamilton–Jacobi equation is then rewritten as $$ \frac{\hbar^{2}}{2m} \nabla^2 \psi - U\psi = \frac{\hbar}{i} \frac{\partial \psi}{\partial t} $$ which is the Schrödinger equation.

Conversely, starting with the Schrödinger equation and our ansatz for $$\psi$$, it can be deduced that $$ \frac{1}{2m} \left( \nabla S \right)^{2} + U + \frac{\partial S}{\partial t} = \frac{i\hbar}{2m} \nabla^{2} S. $$

The classical limit ($$\hbar \rightarrow 0$$) of the Schrödinger equation above becomes identical to the following variant of the Hamilton–Jacobi equation, $$ \frac{1}{2m} \left( \nabla S \right)^{2} + U + \frac{\partial S}{\partial t} = 0. $$

HJE in a gravitational field
Using the energy–momentum relation in the form $$g^{\alpha\beta}P_\alpha P_\beta - (mc)^2 = 0 $$ for a particle of rest mass $$m $$ travelling in curved space, where $$g^{\alpha \beta}$$ are the contravariant coordinates of the metric tensor (i.e., the inverse metric) solved from the Einstein field equations, and $$c$$ is the speed of light. Setting the four-momentum $$P_\alpha$$ equal to the four-gradient of the action $$S $$, $$P_\alpha =-\frac{\partial S}{\partial x^\alpha}$$ gives the Hamilton–Jacobi equation in the geometry determined by the metric $$g $$: $$g^{\alpha\beta}\frac{\partial S}{\partial x^\alpha}\frac{\partial S}{\partial x^\beta} -(mc)^2 = 0,$$ in other words, in a gravitational field.

HJE in electromagnetic fields
For a particle of rest mass $$m$$ and electric charge $$e$$ moving in electromagnetic field with four-potential  $$A_i  =  (\phi,\Alpha)$$ in vacuum, the Hamilton–Jacobi equation in geometry determined by the metric tensor $$g^{ik} = g_{ik}$$ has a form $$g^{ik}\left ( \frac{\partial S}{\partial x^i} + \frac {e}{c}A_i \right ) \left ( \frac{\partial S}{\partial x^k} + \frac {e}{c}A_k \right ) = m^2 c^2$$ and can be solved for the Hamilton principal action function $$S$$ to obtain further solution for the particle trajectory and momentum: $$x = - \frac {e}{c \gamma}\int A_z \,d\xi,$$ $$y = - \frac {e}{c \gamma} \int A_y \,d\xi,$$ $$z = - \frac {e^2}{2c^2 \gamma^2}\int (\Alpha^2 - \overline {\Alpha^2 }) \, d \xi,$$ $$\xi = ct - \frac{e^2}{2 \gamma^2 c^2}\int (\Alpha^2 - \overline {\Alpha^2}) \, d \xi, $$ $$p_x = - \frac{e}{c}A_x, \quad p_y = - \frac{e}{c}A_y,$$ $$p_z = \frac{e^2}{2\gamma c}(\Alpha^2 - \overline {\Alpha^2}),$$ $$\mathcal{E} = c\gamma + \frac{e^2}{2 \gamma c}(\Alpha^2 - \overline {\Alpha^2}),$$ where $$\xi = ct - z$$ and $$\gamma^2 = m^2 c^2 + \frac{e^2}{c^2} \overline{A}^2 $$ with $$\overline{\mathbf{A}}$$ the cycle average of the vector potential.

A circularly polarized wave
In the case of circular polarization, $$E_x = E_0 \sin \omega \xi_1, \quad E_y = E_0 \cos \omega \xi_1, $$ $$A_x = \frac{ cE_0 }{\omega} \cos \omega \xi_1, \quad A_y = - \frac{ cE_0 }{\omega} \sin \omega \xi_1. $$

Hence $$x = - \frac{ecE_0} \omega \sin \omega \xi_1, $$ $$y = - \frac{ecE_0} \omega \cos \omega \xi_1, $$ $$p_x = - \frac{eE_0} \omega \cos \omega \xi_1, $$ $$p_y = \frac{eE_0}{\omega} \sin \omega \xi_1, $$ where $$\xi_1 = \xi /c $$, implying the particle moving along a circular trajectory with a permanent radius $$e cE_0 / \gamma \omega^2 $$ and an invariable value of momentum $$e E_0 / \omega^2 $$ directed along a magnetic field vector.

A monochromatic linearly polarized plane wave
For the flat, monochromatic, linearly polarized wave with a field $$E$$ directed along the axis $$y$$ $$E_y = E_0 \cos \omega \xi_1,$$ $$A_y = - \frac {cE_0}{\omega} \sin \omega \xi_1,$$ hence $$x = \text{const},$$ $$y_0 = -\frac{ecE_0}{\gamma \omega^2},$$ $$y = y_0 \cos \omega \xi_1, \quad z = C_z y_0 \sin 2\omega \xi_1,$$ $$C_z = \frac{eE_0}{8\gamma \omega}, \quad \gamma^2 = m^2 c^2 + \frac{e^2 E_0^2}{2 \omega^2}, $$ $$p_x = 0,$$ $$p_{y,0} = \frac{eE_0}{\omega},$$ $$p_y = p_{y,0} \sin \omega \xi_1, $$ $$p_z = - 2C_z p_{y,0} \cos 2\omega \xi_1 $$ implying the particle figure-8 trajectory with a long its axis oriented along the electric field $$E$$ vector.

An electromagnetic wave with a solenoidal magnetic field
For the electromagnetic wave with axial (solenoidal) magnetic field: $$E = E_\phi = \frac{\omega \rho_0}{c} B_0 \cos \omega \xi_1, $$ $$A_\phi = - \rho_0 B_0 \sin \omega \xi_1 = - \frac{L_s}{\pi \rho_0 N_s} I_0 \sin \omega \xi_1,$$ hence $$x = \text{constant},$$ $$y_0 = -\frac{e \rho_0 B_0}{\gamma \omega},$$ $$y = y_0 \cos \omega \xi_1,$$ $$z = C_z y_0 \sin 2\omega \xi_1,$$ $$C_z = \frac{e \rho_0 B_0}{8c \gamma},$$ $$\gamma^2 = m^2 c^2 + \frac{e^2 \rho_0^2 B_0^2}{2c^2},$$ $$p_x = 0,$$ $$p_{y,0} = \frac{e \rho_0 B_0}{c},$$ $$p_y = p_{y,0} \sin \omega \xi_1,$$ $$p_z = - 2C_z p_{y,0} \cos 2 \omega \xi_1,$$ where $$B_0$$ is the magnetic field magnitude in a solenoid with the effective radius $$\rho_0$$, inductivity $$L_s$$, number of windings $$N_s$$, and an electric current magnitude $$I_0$$ through the solenoid windings. The particle motion occurs along the figure-8 trajectory in $$yz$$ plane set perpendicular to the solenoid axis with arbitrary azimuth angle $$\varphi$$ due to axial symmetry of the solenoidal magnetic field.