Consider a mechanical system. The kinematics of this system is described by giving the space of states, , for this system — a point of this specifies all that can be known of the system at a given moment of time. A function on is called an observable. Think of an observable as an measuring instrument. Then the value of the observable function, at a given point of (state) represents the number that this instrument would record, when applied to the system in that state. Now consider some number, , of observables, say . Then each state gives rise to numbers, namely the values of these functions at the corresponding point of . These observables represent coordinates on the space of states provided the values of these numbers uniquely define the state. For a free particle, for example, a suitable system of coordinates on the space of states might consist of the following six observables: , i.e., the position and the velocity components of the particle.
The dynamics of this system is specified by giving a certain vector field on , called the dynamical vector field. In terms of a coordinate system, , on , is represented by functions of variables:
These functions are called the components of , i.e. is the -component of . This dynamical vector field describes the dynamics of the system, in the following manner. If the system is left to its own devices, then it evolves, i.e. it traverses some curve in , labeled by the time . Thus, is that point of representing the state of the system at . In terms of some coordinate system, , on , this curve is described by functions of one variable (the time ): . So, for example, the numbers represent the coordinates of the state of the system at time . Now, the defining property of the dynamical vector field is that the curves in describing the evolution of the system be integral curves of . This means, in more detail, that, at any point of , the tangent to this curve is precisely the value of the vector field there. In terms of a coordinate system, this means that the describing the path of the system satisfy the following system of ordinary differential equations:
Here, ranges from to , so there is a total of equations in this system. It follows that the time-rate of change, under the dynamics, of any observable , is given by , the directional derivative of in the -direction.
Now suppose we allow this system to interact with other systems, e.g. ourselves. Then, as a result of this interaction, the system will no longer have its dynamics described by — we, by pushing the system around, are capable of changing the dynamical behavior of the system. But some observables are not affected directly by such interactions. For a free particle, for example, the equations of motion (from which there can be read off the components of the dynamical vector field) are:
If we now impose an interaction, represented by a force on the particle, then the first three equations remain the same, while a force-term appears in the last three. So the observables , , and are “not affected directly” by the interaction, while the observables , , and are. Returning to the general system, we say that observable is a configuration observable provided the time-rate of change of remains unchanged when interactions are turned on between our system and its environment. Configuration observables are typically denoted “.” So, we may choose a coordinate system of consisting of . That is, the first coordinates are configuration observables, and the remaining are “other observables” (which, at the moment, may be chosen freely).
In order that a system have a Lagrangian formulation, it is necesssary, first, that it be possible to choose coordinates on consisting of . That is, the first coordinates are configuration variables, while the remaining are precisely the corresponding velcotiy-components. So, in particular, this condition requires that . A free particle, for example, satisfies this condition, while a ball rolling on a table (for which there are independent configuration observables, out of a total of observables required to specify a state) does not.
But, for a Lagrangian formulation, we require more than the necessary condition above. Let the above hold, and let us agree to use these coordinates, , for the space of states. Let be any observable of our system, so is expressed as one function of variables: . Given such an observable , nobody stops us from writing down the following equation (for ):
If this equation, together with (which is the definition of velocity), give precisely and fully the equations of motion of the system, then is said to be a Lagrangian for the system. If there exists such a Lagrangian, then we say that the system has a Lagrangian formulation. Some systems (such as a damped harmonic oscillator) have no Lagrangian formulation (i.e. there is no observable such that the equation above is exactly the dynamical equation for a damped harmonic oscillator); some systems (such as a free particle) have a number of such Lagrangians. If you can find a Lagrangian, then you have a Lagrangian formulation; if you can’t then you don’t. And, at the moment at least, we “find” Lagrangians by trial and error — pick an observable , and see if the equations above, for that , reproduce precisely and fully the equations of motion of the system. The equation above was, of course, not selected randomly. Rather, it was motivated by a certain result in the calculus of variations. (In more detail, this is precisely the equation that results from extremizing the function on paths, , that results from integrating the Lagrangian over the path.) But this motivation is not essential for the statement of what a Lagrangian formulation means. Here is a useful result about systems with a Lagrangian formulation — for any such system, the observable given by is conserved (i.e. it remains constant along each dynamical trajectory; or in other words, it has vanishing directional derivative by the dynamical vector field ). Another useful observation is that, if a system possess a Lagrangian, then the Lagrangian is never unique. Indeed, if observable is a Lagrangian, then so is , where is any smooth function of the configuration coordinates. To check this, substitute this new candidate Lagrangian in the equation of motion above.
As an example, a suitable Lagrangian for a particle in a potential is that given by
where denotes the potential. When does a system have a Lagrangian formulation, and when does it not? There seems to be no easy answer to this question. What you must do, at least in principle, is try various observables to see if they lead to the correct equations of motion. If the one you happen to try does not work, then try another. But, mostly through experience, one acquires some skill in Lagrangian-selecting. For the vast majority of practical problems, the story is the following. The system has a “kinetic energy,” , which is quadratic in the velocity-components. This means, in more detail, that there is some symmetric, -matrix function of the configuration variables, , such that is given by . Furthermore, the system has a “potential energy,” , i.e. a certain function of the configuration variables. Then “the story” is that the Lagrangian is given by . That is, in the vast majority of practical problems, this particular does indeed give the correct equations of motion of the system. For instance, this is true for a particle in a potential, for which , where is the unit matrix (so is independent of in this case); and is the potential. So, if you can identify such kinetic and potential energies, this is a good candidate for . Unfortunately, this scheme does not always work. For a particle in a magnetic field, for example, there does exist a Lagrangian, but it is not of the form above. So, at least in principle (but rarely done in practice), one must check that this candidate Lagrangian actually works.
A system is said to have a Hamiltonian formulation if there exists a coordinate system on consisitng of , where the ‘s are configuration observables and the ‘s are nonconfiguration observables, together with an observable such that the system of equations
(for ) give precisely the equations of motion of our system. Note that we have no designated the configuration observables (rather than as before) — this is just a convention. So, if you can find such coodinates and such an observable , then you have a Hamiltonian formulation; if you can not, then you do not. The ‘s are called canonical configuration observables, the ‘s canonical momentum observables, and the observable the Hamiltonian. For example, a particle in a potential has a Hamiltonian formulation. Let the new coordinates (in terms of the old) be and . Let the Hamiltonian observable be that given by . One checks that these choices do indeed lead, via the equation above, to the correct equations of motion for a particle in a potential. A damped harmonic oscillator, by contrast, does not have any Hamiltonian formulation. Note that, in order that a system have a Hamiltonian formulation, it is necessary that the dimension of the space of states be precisely twice the dimension of the space of configuration observables. Thus, for example, a ball rolling on a table is not even a candidate for a Hamiltonian formulation. If a system has a Hamiltonian formulation, then that formulation is never unique.
In principle, the method for deciding whether or not a system has a Hamiltonian formulation is, just as for the Lagrangian formulation, trial and error, ultimately augmented by some skill in Hamiltonian selection. One important result is the following — under the Hamilton equations, the observable itself is conserved (i.e., is a constant of the motion). So, it is not even worth trying, as a candidate Hamiltonian, a nonconserved observable. For example, for a free particle, “” would be a terrible try for a Hamiltonian. In the vast majority of practical problems, the Hamiltonian is the energy of the system. Unfortunately, this is not enough information to write down the Hamiltonian formulation of the system. The problem is that, for the Hamiltonian formulation, you need both the observable and the canonical coordinates, . If I just tell you (as an observable), that does not come with any instructions as to how to choose the ‘s, in order that the equations of motion take the desired form. In short, finding a Hamiltonian formulation for a system is in some ways easier than finding a Lagrangian formulation (in that you need only try conserved observables — and will try “the energy” first (if there is one)), and is in some ways harder (in that the remaining, nonconfiguration, coordinates are not handed to you on a silver platter, as in the Lagrangian formulation).
A crucial result in this subject is a construction that allows you to obtain, given a Lagrangian formulation of a system, a Hamiltonian formulation of that system. For fully ninety percent of all systems with a known Hamiltonian formulation, that formulation was obtained via this construction. Here it is. Let be the coodinates for the Lagrangian formulation of our system; and let be the Lagrangian observable. We now set, for , . This formula defines new observables, the (which are here given as functions of the old coordinates, . We also set . These — the — are our new coordinates (noting that they are indeed given as functions of the old). Now consider the observable , given by . Note that this is indeed an observable, and, in fact, that it is precisely the observable we found, earlier, to be conserved for any Lagrangian formulation). Then, we claim, these new coordinates (the ), with this new observable , is indeed a Hamiltonian formulation for our system. What we must show, to prove this, is that the Hamilton equations, for these choices of coordinates and , reduce exactly to the original (Lagrangian) equations for this system. The proof is straightforward. We essentially translate the (Lagrangian) equations of motion for the system into the coordinates , and lo and behold, discover that the result is exactly the Hamilton equations, for this Hamiltonian and these canonical variables.
Note that the construction of the paragraph above gives a particular Hamiltonian formulation of the system (given some particular Lagrangian formulation, with which we started). There may very well be other Hamiltonian formulations of this system. There could be Hamiltonian formulations that do not arise in this way from any Lagrangian formulation. Indeed, it is possible, at least in principle, that a system might have a Hamiltonian formulation but not admit any Lagrangian formulation.
In any case, we have concluded that if there exists a Lagrangian formulation for a system, then there necessarily exists a Hamiltonian formulation for that system.