### Hamiltonian function

Classical mechanics |
---|

Formulations |

Core topics |

**Hamiltonian mechanics** is a theory developed as a reformulation of classical mechanics and predicts the same outcomes as non-Hamiltonian classical mechanics. It uses a different mathematical formalism, providing a more abstract understanding of the theory. Historically, it was an important reformulation of classical mechanics, which later contributed to the formulation of quantum mechanics.

Hamiltonian mechanics was first formulated by William Rowan Hamilton in 1833, starting from Lagrangian mechanics, a previous reformulation of classical mechanics introduced by Joseph Louis Lagrange in 1788.

## Contents

- 1 Overview
- 2 Deriving Hamilton's equations
- 3 As a reformulation of Lagrangian mechanics
- 4 Geometry of Hamiltonian systems
- 5 Generalization to quantum mechanics through Poisson bracket
- 6 Mathematical formalism
- 7 Riemannian manifolds
- 8 Sub-Riemannian manifolds
- 9 Poisson algebras
- 10 Charged particle in an electromagnetic field
- 11 Relativistic charged particle in an electromagnetic field
- 12 See also
- 13 References
- 14 External links

## Overview

In Hamiltonian mechanics, a classical physical system is described by a set of canonical coordinates $\backslash boldsymbol\{r\}=(\backslash boldsymbol\{q\},\backslash boldsymbol\{p\})$, where each component of the coordinate $q\_i,p\_i$ is indexed to the frame of reference of the system.

The time evolution of the system is uniquely defined by Hamilton's equations:^{[1]}

Template:Equation box 1{dt} = -\frac{\partial \mathcal{H}}{\partial \boldsymbol{q}}\\ & \frac{d\boldsymbol{q}}{dt} = +\frac{\partial \mathcal{H}}{\partial \boldsymbol{p}} \end{align} |cellpadding= 5 |border |border colour = #0073CF |background colour=#F5FFFA}}

where $\backslash mathcal\{H\}=\backslash mathcal\{H\}(\backslash boldsymbol\{q\},\backslash boldsymbol\{p\},t)$ is the Hamiltonian, which corresponds to the total energy of the system. For a closed system, it is the sum of the kinetic and potential energy in the system.

In classical mechanics, the time evolution is obtained by computing the total force being exerted on each particle of the system, and from Newton's second law, the time-evolutions of both position and velocity are computed. In contrast, in Hamiltonian mechanics, the time evolution is obtained by computing the Hamiltonian of the system in the generalized coordinates and inserting it in the Hamiltonian equations. It is important to point out that this approach is equivalent to the one used in Lagrangian mechanics. In fact, as will be shown below, the Hamiltonian is the Legendre transform of the Lagrangian, and thus both approaches give the same equations for the same generalized momentum. The main motivation to use Hamiltonian mechanics instead of Lagrangian mechanics comes from the symplectic structure of Hamiltonian systems.

While Hamiltonian mechanics can be used to describe simple systems such as a bouncing ball, a pendulum or an oscillating spring in which energy changes from kinetic to potential and back again over time, its strength is shown in more complex dynamic systems, such as planetary orbits in celestial mechanics.^{[2]} Naturally, the more degrees of freedom the system has, the more complicated its time evolution is and, in most cases, becomes chaotic.

### Basic physical interpretation

A simple interpretation of the Hamilton mechanics comes from its application on a one-dimensional system consisting of one particle of mass *m* under no external forces applied. The Hamiltonian represents the total energy of the system,
which is the sum of kinetic and potential energy, traditionally denoted *T* and *V*, respectively. Here *q* is the coordinate and *p* is the momentum, *mv.* Then

- $\backslash mathcal\{H\}\; =\; T\; +\; V\; ,\; \backslash quad\; T\; =\; \backslash frac\{p^2\}\{2m\}\; ,\; \backslash quad\; V\; =\; V(q).$

Note that *T* is a function of *p* alone, while *V* is a function of *q* alone.

In this example, the time-derivative of the momentum *p* equals the *Newtonian force*, and so the first Hamilton equation means that the force equals the negative gradient of potential energy. The time-derivative of *q* is the velocity, and so the second Hamilton equation means that the particle’s velocity equals the derivative of its kinetic energy with respect to its momentum divided by *m*.

### Calculating a Hamiltonian from a Lagrangian

Given a Lagrangian in terms of the generalized coordinates $q\_i$ and generalized velocities $\backslash dot\; q\_i$ and time:

- The momenta are calculated by differentiating the Lagrangian with respect to the (generalized) velocities: $p\_i(q\_i,\; \backslash dot\; q\_i,\; t)\; =\; \backslash frac\{\backslash partial\; \backslash mathcal\{L\}\}\{\backslash partial\; \{\backslash dot\; q\_i\}\}\; \backslash ,.$
- The velocities $\backslash dot\; q\_i$ are expressed in terms of the momenta $p\_i$ by inverting the expressions in the previous step.
- The Hamiltonian is calculated using the usual definition of $\backslash mathcal\{H\}$ as the Legendre transformation of $\backslash mathcal\{L\}$: $\backslash mathcal\{H\}\; =\; \backslash sum\_i\; \{\backslash dot\; q\_i\}\; \backslash frac\{\backslash partial\; \backslash mathcal\{L\}\}\{\backslash partial\; \{\backslash dot\; q\_i\}\}-\; \backslash mathcal\{L\}\; =\; \backslash sum\_i\; \{\backslash dot\; q\_i\}\; p\_i\; -\; \backslash mathcal\{L\}\; \backslash ,.$ Then the velocities are substituted for using the previous results.

## Deriving Hamilton's equations

Hamilton's equations can be derived by looking at how the total differential of the Lagrangian depends on time, generalized positions $q\_i\backslash ,$ and generalized velocities $\backslash dot\{q\}\_i:$^{[3]}

- $$

\mathrm{d} \mathcal{L} = \sum_i \left ( \frac{\partial \mathcal{L}}{\partial q_i} \mathrm{d} q_i + \frac{\partial \mathcal{L}}{\partial {\dot q_i}} \mathrm{d} {\dot q_i} \right ) + \frac{\partial \mathcal{L}}{\partial t} \mathrm{d}t \,.

Now the generalized momenta were defined as

- $p\_i\; =\; \backslash frac\{\backslash partial\; \backslash mathcal\{L\}\}\{\backslash partial\; \{\backslash dot\; q\_i\}\}\; \backslash ,.$

If this is substituted into the total differential of the Lagrangian, one gets

- $\backslash mathrm\{d\}\; \backslash mathcal\{L\}\; =\; \backslash sum\_i\; \backslash left(\; \backslash frac\{\backslash partial\; \backslash mathcal\{L\}\}\{\backslash partial\; q\_i\}\; \backslash mathrm\{d\}\; q\_i\; +\; p\_i\; \backslash mathrm\{d\}\; \{\backslash dot\; q\_i\}\; \backslash right)\; +\; \backslash frac\{\backslash partial\; \backslash mathcal\{L\}\}\{\backslash partial\; t\}\backslash mathrm\{d\}t$

\,.

We can rewrite this as

- $$

\mathrm{d} \mathcal{L} = \sum_i \left( \frac{\partial \mathcal{L}}{\partial q_i} \mathrm{d}q_i + \mathrm{d}\left ( p_i {\dot q_i} \right ) - {\dot q_i} \mathrm{d} p_i \right) + \frac{\partial \mathcal{L}}{\partial t}\mathrm{d}t \,

and rearrange again to get

- $$

\mathrm{d} \left ( \sum_i p_i {\dot q_i} - \mathcal{L} \right ) = \sum_i \left( - \frac{\partial \mathcal{L}}{\partial q_i} \mathrm{d} q_i + {\dot q_i} \mathrm{d}p_i \right) - \frac{\partial \mathcal{L}}{\partial t}\mathrm{d}t \,.

The term on the left-hand side is just the Hamiltonian that we have defined before, so we find that

- $$

\mathrm{d} \mathcal{H} = \sum_i \left( - \frac{\partial \mathcal{L}}{\partial q_i} \mathrm{d} q_i + {\dot q_i} \mathrm{d} p_i \right) - \frac{\partial \mathcal{L}}{\partial t}\mathrm{d}t .

Similarly to the total differential $\backslash mathrm\{d\}\backslash mathcal\{L\}$ with respect to time of the Lagrangian $\backslash mathcal\{L\}$ (with which we started above), independently from the above derivations the total differential $\backslash mathrm\{d\}\backslash mathcal\{H\}$ of the Hamiltonian $\backslash mathcal\{H\}$ is equal to

- $$

\mathrm{d} \mathcal{H} =\sum_i \left( \frac{\partial \mathcal{H}}{\partial q_i} \mathrm{d} q_i + \frac{\partial \mathcal{H}}{\partial p_i} \mathrm{d} p_i \right) + \frac{\partial \mathcal{H}}{\partial t}\mathrm{d}t .

It follows from the previous two independent equations that their right-hand sides are equal with each other. Thus we obtain the equation

- $$

\sum_i \left( - \frac{\partial \mathcal{L}}{\partial q_i} \mathrm{d} q_i + {\dot q_i} \mathrm{d} p_i \right) - \frac{\partial \mathcal{L}}{\partial t}\mathrm{d}t =\sum_i \left( \frac{\partial \mathcal{H}}{\partial q_i} \mathrm{d} q_i + \frac{\partial \mathcal{H}}{\partial p_i} \mathrm{d} p_i \right) + \frac{\partial \mathcal{H}}{\partial t}\mathrm{d}t .

Since this calculation was done off-shell, we can associate corresponding terms from both sides of this equation to yield:

- $\backslash frac\{\backslash partial\; \backslash mathcal\{H\}\}\{\backslash partial\; q\_i\}\; =\; -\; \backslash frac\{\backslash partial\; \backslash mathcal\{L\}\}\{\backslash partial\; q\_i\}\; \backslash ,,\; \backslash quad\; \backslash frac\{\backslash partial\; \backslash mathcal\{H\}\}\{\backslash partial\; p\_i\}\; =\; \backslash dot\{q\}\_i\; \backslash ,,\; \backslash quad\; \backslash frac\{\backslash partial\; \backslash mathcal\{H\}\}\{\backslash partial\; t\; \}\; =\; -\; \{\backslash partial\; \backslash mathcal\{L\}\; \backslash over\; \backslash partial\; t\}\; \backslash ,.$

On-shell, Lagrange's equations tell us that

- $\backslash frac\{\backslash mathrm\{d\}\}\{\backslash mathrm\{d\}t\}\; \backslash frac\{\backslash partial\; \backslash mathcal\{L\}\}\{\backslash partial\; \{\backslash dot\; q\_i\}\}\; -\; \backslash frac\{\backslash partial\; \backslash mathcal\{L\}\}\{\backslash partial\; q\_i\}\; =\; 0\; \backslash ,.$

We can rearrange this to get

- $\backslash frac\{\backslash partial\; \backslash mathcal\{L\}\}\{\backslash partial\; q\_i\}\; =\; \{\backslash dot\; p\}\_i\; \backslash ,.$

Thus Hamilton's equations hold on-shell:

- $\backslash frac\{\backslash partial\; \backslash mathcal\{H\}\}\{\backslash partial\; q\_j\}\; =-\; \backslash dot\{p\}\_j\; \backslash ,,\; \backslash quad\; \backslash frac\{\backslash partial\; \backslash mathcal\{H\}\}\{\backslash partial\; p\_j\}\; =\; \backslash dot\{q\}\_j\; \backslash ,,\; \backslash quad\; \backslash frac\{\backslash partial\; \backslash mathcal\{H\}\}\{\backslash partial\; t\; \}\; =\; -\; \{\backslash partial\; \backslash mathcal\{L\}\; \backslash over\; \backslash partial\; t\}\; \backslash ,.$

## As a reformulation of Lagrangian mechanics

Starting with Lagrangian mechanics, the equations of motion are based on generalized coordinates

- $\backslash left\backslash \{\; q\_j\; \backslash \; |\backslash \; j=1,\; \backslash ldots,\; N\; \backslash right\backslash \}$

and matching generalized velocities

- $\backslash left\backslash \{\; \backslash dot\{q\}\_j\backslash \; |\backslash \; j=1,\; \backslash ldots,\; N\; \backslash right\backslash \}.$

We write the Lagrangian as

- $\backslash mathcal\{L\}(q\_j,\; \backslash dot\{q\}\_j,\; t)$

with the subscripted variables understood to represent all *N* variables of that type. Hamiltonian mechanics aims to replace the generalized velocity variables with generalized momentum variables, also known as *conjugate momenta*. By doing so, it is possible to handle certain systems, such as aspects of quantum mechanics, that would otherwise be even more complicated.

For each generalized velocity, there is one corresponding conjugate momentum, defined as:

- $p\_j\; =\; \{\backslash partial\; \backslash mathcal\{L\}\; \backslash over\; \backslash partial\; \backslash dot\{q\}\_j\}.$

In Cartesian coordinates, the generalized momenta are precisely the physical linear momenta. In circular polar coordinates, the generalized momentum corresponding to the angular velocity is the physical angular momentum. For an arbitrary choice of generalized coordinates, it may not be possible to obtain an intuitive interpretation of the conjugate momenta.

One thing which is not too obvious in this coordinate dependent formulation is that different generalized coordinates are really nothing more than different coordinate patches on the same symplectic manifold (see *Mathematical formalism*, below).

The *Hamiltonian* is the Legendre transform of the Lagrangian:

- $\backslash mathcal\{H\}\backslash left(q\_j,p\_j,t\backslash right)\; =\; \backslash sum\_i\; \backslash dot\{q\}\_i\; p\_i\; -\; \backslash mathcal\{L\}(q\_j,\backslash dot\{q\}\_j,t).$

If the transformation equations defining the generalized coordinates are independent of *t*, and the Lagrangian is a sum of products of functions (in the generalized coordinates) which are homogeneous of order 0, 1 or 2, then it can be shown that *H* is equal to the total energy *E* = *T* + *V*.

Each side in the definition of *$\backslash mathcal\{H\}$* produces a differential:

- $\backslash begin\{align\}$

\mathrm{d}\mathcal{H} &= \sum_i \left[ \left({\partial \mathcal{H} \over \partial q_i}\right) \mathrm{d}q_i + \left({\partial \mathcal{H} \over \partial p_i}\right) \mathrm{d}p_i \right] + \left({\partial \mathcal{H} \over \partial t}\right) \mathrm{d}t\qquad\qquad\quad\quad \\ \\

&= \sum_i \left[ \dot{q}_i\, \mathrm{d}p_i + p_i\, \mathrm{d}\dot{q}_i - \left({\partial \mathcal{L} \over \partial q_i}\right) \mathrm{d}q_i - \left({\partial \mathcal{L} \over \partial \dot{q}_i}\right) \mathrm{d}\dot{q}_i \right] - \left({\partial \mathcal{L} \over \partial t}\right) \mathrm{d}t.

\end{align}

Substituting the previous definition of the conjugate momenta into this equation and matching coefficients, we obtain the equations of motion of Hamiltonian mechanics, known as the canonical equations of Hamilton:

- $$

\frac{\partial \mathcal{H}}{\partial q_j} = - \dot{p}_j, \qquad \frac{\partial \mathcal{H}}{\partial p_j} = \dot{q}_j, \qquad \frac{\partial \mathcal{H}}{\partial t } = - {\partial \mathcal{L} \over \partial t}.

Hamilton's equations consist of 2n first-order differential equations, while Lagrange's equations consist of n second-order equations. However, Hamilton's equations usually don't reduce the difficulty of finding explicit solutions. They still offer some advantages, since important theoretical results can be derived because coordinates and momenta are independent variables with nearly symmetric roles.

Hamilton's equations have another advantage over Lagrange's equations: if a system has a symmetry, such that a coordinate does not occur in the Hamiltonian, the corresponding momentum is conserved, and that coordinate can be ignored in the other equations of the set. Effectively, this reduces the problem from n coordinates to (n-1) coordinates. In the Lagrangian framework, of course the result that the corresponding momentum is conserved still follows immediately, but all the generalized velocities still occur in the Lagrangian - we still have to solve a system of equations in n coordinates.^{[4]}

The Lagrangian and Hamiltonian approaches provide the groundwork for deeper results in the theory of classical mechanics, and for formulations of quantum mechanics.

## Geometry of Hamiltonian systems

A Hamiltonian system may be understood as a fiber bundle *E* over time *R*, with the fibers *E*_{t}, *t* ∈ *R*, being the position space. The Lagrangian is thus a function on the jet bundle *J* over *E*; taking the fiberwise Legendre transform of the Lagrangian produces a function on the dual bundle over time whose fiber at *t* is the cotangent space *T*^{*}*E*_{t}, which comes equipped with a natural symplectic form, and this latter function is the Hamiltonian.

## Generalization to quantum mechanics through Poisson bracket

Hamilton's equations above work well for classical mechanics, but not for quantum mechanics, since the differential equations discussed assume that one can specify the exact position and momentum of the particle simultaneously at any point in time. However, the equations can be further generalized to then be extended to apply to quantum mechanics as well as to classical mechanics, through the deformation of the Poisson algebra over *p* and *q* to the algebra of Moyal brackets.

Specifically, the more general form of the Hamilton's equation reads

- $\backslash frac\{\backslash mathrm\{d\}f\}\{\backslash mathrm\{d\}t\}\; =\; \backslash \{f,\; \backslash mathcal\{H\}\backslash \}\; +\; \backslash frac\{\backslash partial\; f\}\{\backslash partial\; t\}$

where *f* is some function of *p* and *q*, and *H* is the Hamiltonian. To find out the rules for evaluating a Poisson bracket without resorting to differential equations, see Lie algebra; a Poisson bracket is the name for the Lie bracket in a Poisson algebra. These Poisson brackets can then be extended to Moyal brackets comporting to an **inequivalent** Lie algebra, as proven by H. Groenewold, and thereby describe quantum mechanical diffusion in phase space (See the phase space formulation and Weyl quantization). This more algebraic approach not only permits ultimately extending probability distributions in phase space to Wigner quasi-probability distributions, but, at the mere Poisson bracket classical setting, also provides more power in helping analyze the relevant conserved quantities in a system.

## Mathematical formalism

Any smooth real-valued function *H* on a symplectic manifold can be used to define a Hamiltonian system. The function *H* is known as the **Hamiltonian** or the **energy function**. The symplectic manifold is then called the phase space. The Hamiltonian induces a special vector field on the symplectic manifold, known as the Hamiltonian vector field.

The Hamiltonian vector field (a special type of symplectic vector field) induces a Hamiltonian flow on the manifold. This is a one-parameter family of transformations of the manifold (the parameter of the curves is commonly called the **time**); in other words an isotopy of symplectomorphisms, starting with the identity. By Liouville's theorem, each symplectomorphism preserves the volume form on the phase space. The collection of symplectomorphisms induced by the Hamiltonian flow is commonly called the **Hamiltonian mechanics** of the Hamiltonian system.

The symplectic structure induces a Poisson bracket. The Poisson bracket gives the space of functions on the manifold the structure of a Lie algebra.

Given a function *f*

- $\backslash frac\{\backslash mathrm\{d\}\}\{\backslash mathrm\{d\}t\}\; f=\backslash frac\{\backslash partial\; \}\{\backslash partial\; t\}\; f\; +\; \backslash \{\backslash ,f,\backslash mathcal\{H\}\backslash ,\backslash \}.$

If we have a probability distribution, ρ, then (since the phase space velocity ($\{\backslash dot\; p\_i\}\; ,\; \{\backslash dot\; q\; \_i\}$) has zero divergence, and probability is conserved) its convective derivative can be shown to be zero and so

- $\backslash frac\{\backslash partial\}\{\backslash partial\; t\}\; \backslash rho\; =\; -\; \backslash \{\backslash ,\backslash rho\; ,\backslash mathcal\{H\}\backslash ,\backslash \}.$

This is called Liouville's theorem. Every smooth function *G* over the symplectic manifold generates a one-parameter family of symplectomorphisms and if { *G*, *H* } = 0, then *G* is conserved and the symplectomorphisms are symmetry transformations.

A Hamiltonian may have multiple conserved quantities *G*_{i}. If the symplectic manifold has dimension 2*n* and there are *n* functionally independent conserved quantities *G*_{i} which are in involution (i.e., { *G*_{i}, *G*_{j} } = 0), then the Hamiltonian is Liouville integrable. The Liouville-Arnold theorem says that locally, any Liouville integrable Hamiltonian can be transformed via a symplectomorphism in a new Hamiltonian with the conserved quantities *G*_{i} as coordinates; the new coordinates are called *action-angle coordinates*. The transformed Hamiltonian depends only on the *G*_{i}, and hence the equations of motion have the simple form

- $\backslash dot\{G\}\_i\; =\; 0,\; \backslash qquad\; \backslash dot\{\backslash varphi\}\_i\; =\; F(G),$

for some function *F* (Arnol'd et al., 1988). There is an entire field focusing on small deviations from integrable systems governed by the KAM theorem.

The integrability of Hamiltonian vector fields is an open question. In general, Hamiltonian systems are chaotic; concepts of measure, completeness, integrability and stability are poorly defined. At this time, the study of dynamical systems is primarily qualitative, and not a quantitative science.

## Riemannian manifolds

An important special case consists of those Hamiltonians that are quadratic forms, that is, Hamiltonians that can be written as

- $\backslash mathcal\{H\}(q,p)=\; \backslash frac\{1\}\{2\}\; \backslash langle\; p,p\backslash rangle\_q$

where $\backslash langle\backslash cdot,\backslash cdot\backslash rangle\_q$ is a smoothly varying inner product on the fibers $T\_q^*Q$, the cotangent space to the point *q* in the configuration space, sometimes called a cometric. This Hamiltonian consists entirely of the kinetic term.

If one considers a Riemannian manifold or a pseudo-Riemannian manifold, the Riemannian metric induces a linear isomorphism between the tangent and cotangent bundles. (See Musical isomorphism). Using this isomorphism, one can define a cometric. (In coordinates, the matrix defining the cometric is the inverse of the matrix defining the metric.) The solutions to the Hamilton–Jacobi equations for this Hamiltonian are then the same as the geodesics on the manifold. In particular, the Hamiltonian flow in this case is the same thing as the geodesic flow. The existence of such solutions, and the completeness of the set of solutions, are discussed in detail in the article on geodesics. See also Geodesics as Hamiltonian flows.

## Sub-Riemannian manifolds

When the cometric is degenerate, then it is not invertible. In this case, one does not have a Riemannian manifold, as one does not have a metric. However, the Hamiltonian still exists. In the case where the cometric is degenerate at every point *q* of the configuration space manifold *Q*, so that the rank of the cometric is less than the dimension of the manifold *Q*, one has a sub-Riemannian manifold.

The Hamiltonian in this case is known as a **sub-Riemannian Hamiltonian**. Every such Hamiltonian uniquely determines the cometric, and vice-versa. This implies that every sub-Riemannian manifold is uniquely determined by its sub-Riemannian Hamiltonian, and that the converse is true: every sub-Riemannian manifold has a unique sub-Riemannian Hamiltonian. The existence of sub-Riemannian geodesics is given by the Chow–Rashevskii theorem.

The continuous, real-valued Heisenberg group provides a simple example of a sub-Riemannian manifold. For the Heisenberg group, the Hamiltonian is given by

- $\backslash mathcal\{H\}(x,y,z,p\_x,p\_y,p\_z)=\backslash frac\{1\}\{2\}\backslash left(\; p\_x^2\; +\; p\_y^2\; \backslash right).$

$p\_z$ is not involved in the Hamiltonian.

## Poisson algebras

Hamiltonian systems can be generalized in various ways. Instead of simply looking at the algebra of smooth functions over a symplectic manifold, Hamiltonian mechanics can be formulated on general commutative unital real Poisson algebras. A state is a continuous linear functional on the Poisson algebra (equipped with some suitable topology) such that for any element *A* of the algebra, *A*² maps to a nonnegative real number.

A further generalization is given by Nambu dynamics.

## Charged particle in an electromagnetic field

A good illustration of Hamiltonian mechanics is given by the Hamiltonian of a charged particle in an electromagnetic field. In Cartesian coordinates (i.e. $q\_i\; =\; x\_i$), the Lagrangian of a non-relativistic classical particle in an electromagnetic field is (in SI Units):

- $\backslash mathcal\{L\}\; =\; \backslash sum\_i\; \backslash tfrac\{1\}\{2\}\; m\; \backslash dot\{x\}\_i^2\; +\; \backslash sum\_i\; e\; \backslash dot\{x\}\_i\; A\_i\; -\; e\; \backslash phi,$

where e is the electric charge of the particle (not necessarily the electron charge), $\backslash phi$ is the electric scalar potential, and the $A\_i$ are the components of the magnetic vector potential (these may be modified through a gauge transformation). This is called minimal coupling.

The generalized momenta are given by:

- $p\_i\; =\; \backslash frac\{\backslash partial\; \backslash mathcal\{L\}\}\{\; \backslash partial\; \backslash dot\{x\}\_i\}\; =\; m\; \backslash dot\{x\}\_i\; +\; e\; A\_i.$

Rearranging, the velocities are expressed in terms of the momenta:

- $\backslash dot\{x\}\_i\; =\; \backslash frac\{\; p\_i\; -\; e\; A\_i\; \}\{m\}.$

If we substitute the definition of the momenta, and the definitions of the velocities in terms of the momenta, into the definition of the Hamiltonian given above, and then simplify and rearrange, we get:

- $\backslash mathcal\{H\}\; =\; \backslash sum\_i\; \backslash dot\{x\}\_i\; p\_i\; -\; \backslash mathcal\{L\}\; =\; \backslash sum\_i\; \backslash frac\{\; (p\_i\; -\; e\; A\_i)^2\; \}\; \{2\; m\; \}\; +\; e\; \backslash phi.$

This equation is used frequently in quantum mechanics.

## Relativistic charged particle in an electromagnetic field

The Lagrangian for a relativistic charged particle is given by:

- $\backslash mathcal\{L\}[t]\; =\; -\; m\; c^2\; \backslash sqrt\; \{1\; -\; \backslash frac[t]\}^2\}\{c^2\}\}\; -\; e\; \backslash phi\; [\backslash vec\{x\}[t],t]\; +\; e\; \backslash dot\{\backslash vec\{x\}\}[t]\; \backslash cdot\; \backslash vec\{A\}\; [\backslash vec\{x\}[t],t]\; \backslash ,.$

Thus the particle's canonical (total) momentum is

- $\backslash vec\{P\}\backslash ,[t]\; =\; \backslash frac\{\backslash partial\; \backslash mathcal\{L\}[t]\}\{\backslash partial\; \backslash dot\{\backslash vec\{x\}\}[t]\}\; =\; \backslash frac\{m\; \backslash dot\{\backslash vec\{x\}\}[t]\}\{\backslash sqrt\; \{1\; -\; \backslash frac[t]\}^2\}\{c^2\}\}\}\; +\; e\; \backslash vec\{A\}\; [\backslash vec\{x\}[t],t]\; \backslash ,,$

that is, the sum of the kinetic momentum and the potential momentum.

Solving for the velocity, we get

- $\backslash dot\{\backslash vec\{x\}\}[t]\; =\; \backslash frac\{\backslash vec\{P\}\backslash ,[t]\; -\; e\; \backslash vec\{A\}\; [\backslash vec\{x\}[t],t]\}\{\backslash sqrt\; \{m^2\; +\; \backslash frac\{1\}\{c^2\}\{\backslash left(\; \backslash vec\{P\}\backslash ,[t]\; -\; e\; \backslash vec\{A\}\; [\backslash vec\{x\}[t],t]\; \backslash right)\; \}^2\}\}\; \backslash ,.$

So the Hamiltonian is

- $\backslash mathcal\{H\}[t]\; =\; \backslash dot\{\backslash vec\{x\}\}[t]\; \backslash cdot\; \backslash vec\{P\}\backslash ,[t]\; -\; \backslash mathcal\{L\}[t]\; =\; c\; \backslash sqrt\; \{m^2\; c^2\; +\; \{\backslash left(\; \backslash vec\{P\}\backslash ,[t]\; -\; e\; \backslash vec\{A\}\; [\backslash vec\{x\}[t],t]\; \backslash right)\; \}^2\}\; +\; e\; \backslash phi\; [\backslash vec\{x\}[t],t]\; \backslash ,.$

From this we get the force equation (equivalent to the Euler–Lagrange equation)

- $\backslash dot\{\backslash vec\{P\}\}\; =\; -\; \backslash frac\{\backslash partial\; \backslash mathcal\{H\}\}\{\backslash partial\; \backslash vec\{x\}\}\; =\; e\; (\backslash vec\{\backslash nabla\}\; \backslash vec\{A\})\; \backslash cdot\; \backslash dot\{\backslash vec\{x\}\}\; -\; e\; \backslash vec\{\backslash nabla\}\; \backslash phi\; \backslash ,$

from which one can derive

- $\backslash frac\{d\}\{d\; t\}\backslash left(\backslash frac\{m\; \backslash dot\{\backslash vec\{x\}\}\}\; \{\backslash sqrt\; \{1\; -\; \backslash frac\{\backslash dot\{\backslash vec\{x\}\}^2\}\{c^2\}\}\}\backslash right)\; =\; e\; \backslash vec\{E\}\; +\; e\; \backslash dot\{\backslash vec\{x\}\}\; \backslash times\; \backslash vec\{B\}\; \backslash ,.$

An equivalent expression for the Hamiltonian as function of the relativistic (kinetic) momentum, $\backslash vec\{p\}=\backslash gamma\; m\; \backslash dot\{\backslash vec\{x\}\}[t]\; \backslash ,,$ is

- $\backslash mathcal\{H\}[t]\; =\; \backslash dot\{\backslash vec\{x\}\}[t]\; \backslash cdot\; \backslash vec\{p\}\backslash ,[t]\; +\backslash frac\{mc^2\}\{\backslash gamma\}\; +\; e\; \backslash phi\; [\backslash vec\{x\}[t],t]=\backslash gamma\; mc^2+\; e\; \backslash phi\; [\backslash vec\{x\}[t],t]=E+V\; \backslash ,.$

This has the advantage that $\backslash vec\{p\}$ can be measured experimentally whereas $\backslash vec\{P\}$ cannot. Notice that the Hamiltonian (total energy) can be viewed as the sum of the relativistic energy (kinetic+rest), $E=\backslash gamma\; mc^2\; \backslash ,,$ plus the potential energy, $V=e\; \backslash phi\; \backslash ,.$

## See also

- Canonical transformation
- Classical field theory
- Covariant Hamiltonian field theory
- Classical mechanics
- Dynamical systems theory
- Hamilton–Jacobi equation
- Hamilton–Jacobi–Einstein equation
- Lagrangian mechanics
- Maxwell's equations
- Hamiltonian (quantum mechanics)
- Quantum Hamilton's equations
- Quantum field theory
- Hamiltonian optics
- De Donder–Weyl theory

## References

### Footnotes

### Other

## External links

Template:Physics-footer