The transition from the Lagrangian to the Hamiltonian formulation can be viewed as an operation that reduces a higher-order dynamical system to a first-order one. Specifically, given the Euler–Lagrange equation
let
Then we have
We would also like to introduce an equation that describes the evolution of \( q_i \):
At this point, the reduction of order has, in essence, been accomplished. However, physicists often prefer to express formulas in a more compact and aesthetically appealing manner, ideally in the form of a higher-dimensional dynamical system (recall from control theory that such systems are mathematically more tractable).
Since we already have \( p_i = \frac{\partial L}{\partial \dot{q}_i} \), we aim to obtain a formulation of the form
where
To explore this idea, let us begin with the simplest case \( n = 1 \). If the construction does not work in the one-dimensional case, it is unlikely to generalize successfully to higher dimensions. We would like \(\nabla H\) to contain terms such as \(\frac{\partial L}{\partial q_1}\) and either \(v\) or \(\dot{q}_1\)—or at least their linear combination. This goal can be achieved easily by defining
Why not instead define
Is there any difference between these two choices? Indeed, this involves a small mathematical trick often employed by mathematicians when performing gradient detaching (see link):
After adopting \(H_1\), we can set
In practice, the Hamiltonian is defined as
which differs from the above only by a sign; the essential structure remains the same. The sign convention is chosen so that the expression aligns with the Legendre transform.
Remark 1. From a personal perspective, this viewpoint provides a more compelling motivation than the conventional approach of “directly applying the Legendre transform to the Lagrangian action and then discovering, almost miraculously, that the transformed variables \(p\) and \(q\) constitute a first-order dynamical system.” Of course, if anyone can clarify the underlying reason behind this “miracle,” I would be very grateful.