Hamilton-Jacobi equation

There are three equivalent formalisms used in classical mechanics: Lagrangian, Hamiltonian and Hamilton-Jacobi equation.  I listed their main results as below:

  • Lagrangian $L(q, \dot{q})$: \begin{equation}\frac{d}{dt}\frac{\partial L}{\partial \dot{q}}-\frac{\partial L}{\partial q}=0\,.\tag{1}\end{equation}
  • Hamiltonian  $H(q, p)$: \begin{eqnarray} \dot{q}=\frac{\partial H}{\partial p}\,,\tag{2.1}\\ \dot{p}=-\frac{\partial H}{\partial q}\,.\tag{2.2}\end{eqnarray}
  • Hamilton-Jacobi equation is about the "action" $S(t, q)$: \begin{equation}\frac{\partial S}{\partial t}+H\left(q, \frac{\partial S}{\partial q}\right)=0\,.\tag{3}\end{equation}
This post is mainly about the derivation of Hamiltonian-Jacobi equation since it is less well known compared to the Lagrangian and Hamiltonian mechanics.

A few words on the Lagrangian

The Lagrangian $L(x, v, t)$ is a function of a coordinate $x$ and a velocity $v$ at a single time $t$. For example, in Newtonian mechanics, we have $L(x, v, t)=\frac{1}{2}mv^2 - V(x)$ for some potential $V(x)$.

It is worth to emphasis that in $L(x, v, t)$, $x$ and $v$ are two independent variables: 
  • Only given $x$ at a single time $t$, it is impossible to determine $v$ at the time $t$. To compute $v$, we need at least one additional $x'$ at different but sufficiently close time $t+\Delta t$: $v \approx (x'-x)/\Delta t$.
  • We need both $x$ and $v$ to characterize a state of motion at a single time $t$. $x$ is the position at $t$ and $v$ indicates the position $x'$ afterward at $t+\Delta t$: $x'\approx x + v\Delta t$.
In most textbooks, the Lagrangian is usually denoted by $L(q, \dot{q}, t)$. First-time learners often make the mistake that $\dot{q}$ is redundant and can be deduced from $q$ as $\dot{q}=\frac{d}{dt}q$. As emphasized above, $q$ in the Lagrangian is just a number (the coordinate at a single time) and there is no way to perform $d/dt$ on $q$.

Action    

The action in the principle of least action is a functional on any trajectory $q(t)$: \begin{equation} {\mathbb{S}}[q(t); t_f, t_i] \equiv \int_{t_i}^{t_f} L\Big(q(t), \dot{q}(t), t\Big) dt\,. \tag{4}\end{equation} Remarks:
  • For fixed $t_i$ and $t_f$, given any trajectory $q(t)$, not necessarily a true trajectory (the one satisfying the equation of motion), one can plug it into the action (4) and obtain a number (The so-called the principle of least action, as we will show later, says that among all trajectories with the same endpoints at $t_i$ and $t_f$, the true trajectory posses the smallest number).
  • Given a trajectory $q(t)$, we can take derivative on $q(t)$ and obtain the velocity $\dot{q}(t)=\frac{d}{dt}q(t)$. In the action (4), we substitute $q(t)$ and $\dot{q}(t)$ for the respective $x$ and $v$ in the Lagrangian $L(x, v, t)$. This should not be confused with the fact that in the original definition of $L(q, \dot{q}, t)$, $\dot{q}$ is independent from $q$.

To demonstrate the principle of least action, we need the following two preparations:

  • For the Lagrangian $L(x, v, t)$, we denote its partial derivatives by \begin{equation} F(x, v, t)\equiv\frac{\partial}{\partial x}L(x, v, t)\,,\quad P(x, v, t)\equiv \frac{\partial}{\partial v} L(x, v, t)\,.\tag{4.1}\end{equation} By multivariable calculus, we have \begin{equation} L(x+dx, v+dv, t)=L(x, v, t) + F(x, v, t)dx + P(x, v, t)dv\,.\tag{4.2}\end{equation} Note that just as $L(x, v, t)$, $x$ and $v$ are also independent in $F(x, v, t)$ and $P(x, v,t)$.
  • Consider two sufficiently close trajectories $q_1(t)$ and $q_2(t)$. The equal time variation between two trajectories for each time $t$ is $\delta q(t)\equiv q_2(t)-q_1(t)$ and the equal time variation between the velocities of two trajectories is $\delta \dot{q}(t)\equiv \dot{q}_2(t)-\dot{q}_1(t)$. We can verify that \begin{eqnarray}\frac{d}{dt}\delta q(t)& = & \lim_{\Delta t\rightarrow 0}\frac{\delta q(t+\Delta t) - \delta q(t) }{\Delta t} = \lim_{\Delta t\rightarrow 0}\frac{q_2(t+\Delta t)-q_1(t+ \Delta t) - (q_2(t)-q_1(t))}{\Delta t}\\ &=& \lim_{\Delta t\rightarrow 0}\frac{q_2(t+\Delta t) - q_2(t)}{\Delta t} - \lim_{\Delta t\rightarrow 0}\frac{q_1(t+\Delta t) - q_1(t)}{\Delta t} = \dot{q}_2(t)- \dot{q}_1(t)=\delta \dot{q}(t)\,, \end{eqnarray} that is \begin{equation}\frac{d}{dt}\delta q(t)=\delta \frac{d}{dt}q(t)\,.\tag{4.3}\end{equation} The order of variation $\delta$ and time derivative $d/dt$ can be exchanged.

Now we are ready to compute the action variation between two sufficiently close trajectories $q(t)$ and $q(t)+\delta q(t)$: \begin{eqnarray} \delta \mathbb{S}[q(t); t_f, t_i] &=&{\mathbb{S}}[q(t)+\delta q(t); t_f, t_i] - {\mathbb{S}}[q(t); t_f, t_i]  \\ &=& \int_{t_i}^{t_f}\bigg(L\Big(q(t)+\delta q(t), \dot{q}(t)+\delta \dot{q}(t), t\Big)-L\Big(q(t), \dot{q}(t), t\Big)\bigg)dt \\ &=&\int_{t_i}^{t_f}\bigg(F\Big(q(t), \dot{q}(t), t\Big) \delta q(t)+ P\Big(q(t), \dot{q}(t), t\Big) \delta \dot{q}(t) \bigg)dt \\ &=& \int_{t_i}^{t_f} \bigg(F\Big(q(t), \dot{q}(t), t\Big) \delta q(t)+ P\Big(q(t), \dot{q}(t), t\Big)\frac{d}{dt} \delta q(t) \bigg)dt \\ &=&P(q(t), \dot{q}(t), t)\delta q(t)\bigg|_{t=t_i}^{t=t_f}   + \int_{t_i}^{t_f}\bigg(F\Big(q(t), \dot{q}(t), t\Big)-\frac{d}{dt}P\Big(q(t), \dot{q}(t), t\Big)\bigg)\delta q(t)\,dt\,, \tag{4.4}\end{eqnarray} where we apply the relations (4.2) and (4.3) in the third and forth lines. In the fifth line, we use the integration by parts $P\frac{d}{dt}\delta q = \frac{d}{dt}\left(P\delta q\right)-\left(\frac{d}{dt}P\right)\delta q$.

When $\delta q(t_i)=\delta q(t_f)=0$, the first terms on the R.H.S of (4.4) vanish. As a result, $\delta \mathbb{S}[q(t); t_f, t_i]=0$ implies the equation of motion \begin{equation}\frac{d}{dt}P\Big(q(t), \dot{q}(t), t\Big)-F\Big(q(t), \dot{q}(t), t\Big)=0\,.\tag{4.5}\end{equation} This is the principle of least action: among all trajectories $q(t)$ with fixed boundary conditions, the trajectory that makes $\delta {\mathbb{S}}[q(t); t_f, t_i]=0$ is the true trajectory that satisfies the equation of motion (4.5).

In most textbooks, the result (4.4) as well as its derivation are often written in short as follows: \begin{eqnarray}\delta \mathbb{S}&=&\int_{t_i}^{t_f}\delta L(q, \dot{q}, t)dt = \int_{t_i}^{t_f}\left(\frac{\partial L}{\partial q}\delta q + \frac{\partial L}{\partial \dot{q}}\delta\dot{q}\right)dt= \cdots \\ &=& \left.\frac{\partial L}{\partial \dot{q}}\delta q\right|_{t_i}^{t_f} +\int_{t_i}^{t_f}\left(\frac{\partial L}{\partial q}-\frac{d}{dt}\frac{\partial L}{\partial \dot{q}}\right)\delta q \,dt\,.\tag{5}\end{eqnarray} Our notations (4.1) and (4.4) provide the accurate description of all the short notations as in Eq. (5):

  • $q, \delta q, \dot{q}, \delta \dot{q}$ in Eq. (5) are functions $q(t), \delta q(t), \dot{q}(t), \delta \dot{q}(t)$ for short. 
  • $\frac{\partial L}{\partial q}$ and $\frac{\partial L}{\partial \dot{q}}$ in Eq. (5) should be understood exactly as $F(q(t), \dot{q}(t), t)$ and $P(q(t), \dot{q}(t), t)$ with our notation (4.1). 
  • In terms of the short notations in Eq. (5), our equation of motion (4.5) becomes the standard form of Euler-Lagrange equation (1). Compared to the form in Eq. (1), the form in Eq. (4.5) reveals more explicitly how to apply the Euler-Lagrange equation in practice: for some trajectory $q(t)$, we first substitute $q(t)$ and its derivative $\dot{q}(t)$ for the respective $x$ and $v$ in partial derivatives defined in (4.1), and then we can solve $q(t)$ from the ordinary differential equation (4.5).

The relation between Lagrangian and Hamiltonian

The canonical equations (2.1) and (2.2) in Hamiltonian mechanics implies that \begin{equation} dH(q, p)=\frac{\partial H}{\partial q}dq + \frac{\partial H}{\partial p}dp=-\dot{p}dq+\dot{q}dp\,.\end{equation}
While the Hamiltonian is in terms of $p$ and $q$, the Lagrangian is in terms of $q, \dot{q}$. So we need to change the variables from $(q, p)$ to $(q, \dot{q})$. This can be achieved by the Legendre transformation (integration by parts): \begin{equation} dH(q, p)=\frac{\partial H}{\partial q}dq + \frac{\partial H}{\partial p}dp=-\dot{p}\,dq+d(p\dot{q})-p\,d\dot{q}\,,\end{equation} that is, \begin{equation} d(p\dot{q}-H) = \dot{p}\,dq + p\,d\dot{q}\,.\end{equation}
As a result, we can define the Lagrangian from the Hamiltonian as \begin{equation} L \equiv  p\,\dot{q}-H\,,\tag{6}\end{equation} and have the relations $p=\frac{\partial L}{\partial \dot{q}}$ and $\dot{p}=\frac{\partial L}{\partial q}$ . Indeed, in the Lagrangian mechanics, the first relation is the definition of $p$ and the second relation is then the Euler-Lagrangian equation (1).

In practice, 

  • Given a Hamiltonian $H(q, p)$, we express $p$ in terms of $(q, \dot{q})$ using the canonical equation (2.1), which is denoted by the function $p(q, \dot{q})$. The Lagrangian is simply $L(q, \dot{q})=p(q, \dot{q})\,\dot{q}-H(q, p(q, \dot{q}))$. 
  • Given a Lagrangian $L(q, \dot{q})$, we express $\dot{q}$ in terms of $(q, p)$ using the definition of $p\equiv \frac{\partial L}{\partial \dot{q}}$, which is denoted by the function $\dot{q}(q, p)$. The Hamiltonian is simply $H(q,  p)= p\,\dot{q}(q, p)-L(q, \dot{q}(q, p))$.

Hamilton's principal function

In the principle of least action, we consider the action along all the trajectories and proves that the true trajectory minimize the action. In contrast, now we only focus the action of true trajectories $q_{\text{cl}}(t)$: $\mathbb{S}[q_{\text{cl}}(t); t_f, t_i]$. Furthermore, note that a true trajectory $q_{\text{cl}}(t)$ is uniquely determined by its endpoints $q_i$ and $q_f$ at time $t_i$ and $t_f$, so we only need specify the endpoints $(t_f, q_f)$ and $(t_i, q_i)$ instead of an entire function $q_{\text{cl}}(t)$ when computing $\mathbb{S}[q_{\text{cl}}(t); t_f, t_i]$, which then reduces the functional on the true trajectory $q_{\text{cl}}(t)$ to a function only on its two endpoints: \begin{equation}{\cal{S}}(t_f, q_f, t_i, q_i )=\int_{t_i, q_i}^{t_f, q_f} L\left(q_{\text{cl}}(t), \dot{q}_{\text{cl}}(t)\right) dt\,,\tag{7}\end{equation} which is called the Hamilton's principal function. 

When discussing the Hamilton-Jacobi equation, we fix the start point $(t_i, q_i)$ and consider the case that the Hamilton's principal function ${\cal{S}}(t_f, q_f, t_i, q_i )$ only changes as the end point $t_f, q_f$. This motivates us to introduce a simpler form of the Hamilton's principal function (7) as \begin{equation}S(t, q)=\int_{t_i, q_i}^{t, q} L\left(q_{\text{cl}}(\tau), \dot{q}_{\text{cl}}(\tau)\right) d\tau\quad \text{ for fixed } (t_i, q_i)\,. \tag{8}\end{equation}  Remarks:
  • Action (4) is a functional. In contrast, the Hamilton's principal function (8) is just a function of some time $t$ and some coordinate $q$.
  • Given any $(t, q)$, there exists a unique true trajectory connecting $(t_i, q_i)$ to $(t, q)$ and the Hamilton's principal function (8) is the action evaluated along this particular true trajectory.
  • $q$ is independent of $t$. For fixed $t$, different values of $q$ in the function (8) determines to different true trajectories.
Finally, we consider an equal-time variation to a true trajectory $q_{\text{cl}}(t)\rightarrow q_{\text{cl}}(t)+\delta q(t)$ with no constraints on the endpoints. Since the true trajectory $q_{\text{cl}}(t)$ satisfies the Euler-Lagrange's equation (1), the second term in the second line of  Eq. (5) vanishes and we \begin{equation}\delta {\mathbb{S}}[q_{\text{cl}}(t); t_f, t_i] = \left.\frac{\partial L}{\partial \dot{q}_{\text{cl}}}\delta q \right|_{t=t_f}-\left.\frac{\partial L}{\partial \dot{q}_{\text{cl}}}\delta q \right|_{t=t_i}\,.\end{equation} This implies that the Hamilton's principle function (8) satisfies the relation \begin{equation}\frac{\partial S(t, q)}{\partial q}= \frac{\partial L(q, \dot{q})}{\partial \dot{q}} = p \tag{9}\,.\end{equation} The statement of Eq. (9) in plain language is as follows: Suppose the true trajectory ending at $(t, q)$ has the momentum $p$ at the endpoint. There is another true trajectory with the same start point but a sufficiently close endpoint $(t, q+\Delta q)$. Then the difference between the actions of these two true trajectories is $\Delta S = p \Delta q$.

Hamilton-Jacobi equation

Note that in Hamilton's principal function (8) and its relation (9), $q$ is independent of $t$, i.e., different $q$ specifies different true trajectory. In order to use the function (8) to describe an object's motion, we limit $q$ to only be the end point of the object's true trajectory we want to solve. As the object moves, the end point of the trajectory keeps extending. As a result, $q$ becomes a function of time $t$ denoted by $q(t)$, which is the object's true trajectory. In this particular case, the differential form of Eq. (8) is \begin{equation} dS(t, q(t)) = L(q(t), \dot{q}(t)) dt\,. \tag{10}\end{equation}

The general $S(t, q)$ as in Eq. (8) is not necessarily associated with an object's motion, $S(t, q(t))$ satisfying Eq. (10) is. By making the total derivative on $S(t, q(t))$ with respect to $t$, we have \begin{equation} \frac{dS}{dt}=\frac{\partial S}{\partial t} + \frac{\partial S}{\partial q}\dot{q}\,.\end{equation} Finally, using equations (6), (9) and (10), we finally derive the Hamilton-Jacobi equation \begin{equation} \frac{\partial S}{\partial t} + H\left(q, \frac{\partial S}{\partial q} \right) = 0\,.\tag{3}\end{equation} The Hamilton-Jacobi equation (3) is a partial differential equation on $S(t, q)$. The general $S(t, q)$ as in Eq. (8) must be a solution of the Hamilton-Jacobi equation (3) in order to describe an object's motion. After all, we used Eq. (10) when deriving Eq. (3).  

After solving $S(t, q)$ from Eq. (3), How to get the trajectory $q(t)$? For this purpose, note that only the partial derivatives of $S(t, q)$ appear in Eq. (3), so the solution of Eq. (3) must be of the form \begin{equation} S(t, q) = f(t, q, \alpha) + C\,,\tag{11}\end{equation} where $\alpha$ and $C$ are the constants of motion. Because $S(t, q)$ is the solution of Eq. (3), we have 
\begin{equation}\frac{\partial^2 f}{\partial t\partial \alpha }=\frac{\partial}{\partial \alpha}\left(\frac{\partial S}{\partial t}\right)=-\frac{\partial}{\partial \alpha}H\left(q,  \frac{\partial S}{\partial q}\right) = -\frac{\partial H}{\partial p}\frac{\partial^2 S}{\partial\alpha\partial q}\end{equation}, where we exchange the order of $\partial_t$ and $\partial_\alpha$ in the first step, use the Eq. (3) in the second step and note that only $p=\frac{\partial S}{\partial q}$ in $H(q, p)$ depends on $\alpha$ in the last step. So for $f(t, q(t), \alpha)$,  \begin{equation}\frac{d}{dt}\frac{\partial f}{\partial \alpha}=\frac{\partial^2 f}{\partial t\partial \alpha }+ \frac{\partial^2 f}{\partial q\partial \alpha }\dot{q}=-\frac{\partial H}{\partial p}\frac{\partial^2 S}{\partial\alpha\partial q}+\frac{\partial^2 S}{\partial q\partial \alpha }\dot{q}=0\,,\end{equation} that is \begin{equation} \frac{\partial f(t, q, \alpha)}{\partial \alpha} = \text{ const.}\tag{12}\end{equation} In practice, we first solve the partial differential equation (3) and then plug the solution (11) into Eq. (12) to solve $q(t)$. The form of $\partial f(t, q, \alpha) /\partial \alpha$ is more important than $f(t, q, \alpha)$ itself.

What are the benefits of the Hamilton-Jacobi equation compared to the Lagrangian or Hamiltonian mechanics? Technically, the Hamiltonian-Jacobi is especially useful when describing a periodic motion. More theoretically,  the Hamiltonian-Jacobi equation can directly yield the constant of motions. These constant of motions, including energy, momentum, or angular momentum, also hold beyond the classical mechanics while the concept of trajectory does not. In this view, it is less straight that the Schrodinger equation in quantum mechanics becomes the Hamilton-Jacobi equation in the classical limit (see details in this post). 

(Optional) In physics, the constants of integration $\alpha$ and $C$ are the constants of motion that are solely determined by the initial boundary conditions, i.e. the coordinate $q_i$ and the momentum $p_i$ at the start time $t_i$. Moreover, $p_i$ is completely determined once the two endpoints of the trajectory are specified, which leads to a function $p_i(t_f, q_f, t_i, q_i)$. Therefore, we can then relate the solution (11) with the Hamilton's principal function (7) as \begin{equation}{\cal{S}}(t_f, q_f, t_i, q_i ) = f\bigg(t_f, q_f, \alpha\Big(q_i, p_i(t_f, q_f, t_i, q_i)\Big)\bigg) +C\Big(q_i, p_i(t_f, q_f, t_i, q_i)\Big)\,.\end{equation} There is also a similar relation to Eq. (9) but on the start point as \begin{equation} p_i = -\frac{\partial {\cal{S}}(t_f, q_f, t_i, q_i )}{\partial q_i} =- \frac{\partial f}{\partial \alpha}\left(\frac{\partial \alpha}{\partial q_i}+\frac{\partial \alpha}{\partial p_i}\frac{\partial p_i}{\partial q_i}\right)-\left(\frac{\partial C}{\partial q_i}+\frac{\partial C}{\partial p_i}\frac{\partial p_i}{\partial q_i}\right)\,.\tag{13}\end{equation}

Example

As a simple example, we now show how to use Hamilton-Jacobi equation to solve the motion in one dimensional space with a uniform gravitation. The Hamiltonian in this case is \begin{equation} H(z, p_z)=\frac{p_z^2}{2m} + mg z \,.\end{equation}
The Hamilton-Jacobi equation Eq. (3) in this case reads \begin{equation}\frac{\partial S}{\partial t}+ \frac{1}{2m}\left(\frac{\partial S}{\partial z}\right)^2 + mgz = 0\,.\end{equation} Let $S(t, z)=W(z)-Et$, we can solve \begin{equation}W(z)=\int \sqrt{2m(E-mgz)}dz=-\frac{2\sqrt{2}}{3\sqrt{m}g}\left(E-mgz\right)^{3/2}+C\,.\end{equation} The equation of motion (13) in this case is $\tau = \partial S / \partial E$:\begin{equation}\tau = -\frac{\sqrt{2}}{\sqrt{m}g}\sqrt{E-mgz}-t\,,\end{equation} which gives the trajectory \begin{equation}z(t) =\frac{E}{mg} -\frac{1}{2}g(t+\tau)^2\,.\end{equation} The calculation ends if it is an exam problem. Here, let's do a few more checks: 
  1. We know in high school that the trajectory in this problem is $z_{\text{hs}}(t) = z_0+v_0 (t-t_0)-\frac{1}{2}g (t-t_0)^2$ with the initial position $z_0$ and initial velocity $v_0$ at time $t_0$. By matching it to the trajectory from Hamilton-Jacobi equation $z(t)$, we can identify the constants of motion with the initial conditions as \begin{equation} E = \frac{1}{2}mv_0^2+mgz_0\,,\quad \tau = -\frac{v_0}{g}-t_0\,.\end{equation}
  2. We can evaluate the action (4) along $z_{\text{hs}}(t)$ as \begin{eqnarray}\mathbb{S}[z_{\text{hs}}(t);t, t_0]&=&\int_{t_0}^t \left(\frac{1}{2}m \dot{z}^2_{\text{hs}}(t) - mg z_{\text{hs}}(t) \right)dt \\ &=&\frac{1}{3}mg^2\left(t-t_0\right)^3 -mgv_0\left(t-t_0\right)^2+\left(\frac{1}{2}mv_0^2-mgz_0\right)\left(t-t_0\right)\,.\end{eqnarray} The solved Hamilton's principal function along $z_{\text{hs}}(t)$ is \begin{eqnarray} S(t, z_{\text{hs}}(t))&=&W(z_{\text{hs}}(t))-Et \\ &=& -\frac{m}{3g}\left(v_0-g(t-t_0)\right)^3-\left( \frac{1}{2}mv_0^2+mgz_0\right) t + C\,. \end{eqnarray} Indeed, $\mathbb{S}[z_{\text{hs}}(t);t, t_0]$ and $S(t, z_{\text{hs}}(t))$ have the exactly the same form with \begin{equation} C=\left(\frac{1}{2}mv_0^2+mgz_0\right)t_0+\frac{mv_0^3}{3g}\,.\end{equation}   
  3. Given an end point $z_f$ at $t_f$, the initial velocity $v_0$ in $E$ and $C$ is $v_0=\frac{z_f-z_0}{t_f-t_0}+\frac{1}{2}g(t_f-t_0)$. We can verify the relation (13) explicitly in this case: \begin{eqnarray} \text{R.H.S}&=&-\tau\left(\frac{\partial E}{\partial z_0}+ \frac{\partial E}{\partial v_0}\frac{\partial v_0}{\partial z_0}\right) - \left(\frac{\partial C}{\partial z_0}+\frac{\partial C}{\partial v_0}\frac{\partial v_0}{\partial z_0}\right)\\ &=& \left(\frac{v_0}{g}+t_0\right)\left(mg+mv_0 \frac{\partial v_0}{\partial z_0}\right) -\left[mgt_0+\left(mv_0t_0+\frac{mv_0^2}{g}\right)\frac{\partial v_0}{\partial z_0}\right]=mv_0\,.\end{eqnarray}

Comments

  1. The relation between Lagrangian and Hamiltonian

    the equation dH(p,q) = .... , one sign should be +d(p,qdot), right?

    ReplyDelete
  2. do we have real example that alpha does not depend on qi

    ReplyDelete

Post a Comment

Popular posts from this blog

529 Plan

How to offset W2 tax

Health Saving Account (HSA)