What I’m about to tell you is not something new. These ideas have been around for many years already (since classical mechanics was still a thing). Moreover, I have been bothering my friends, students, teachers and some angry chemists with this for the last four or five years, ever since a student in San Luis Potosi made the mistake of saying the word “Hamiltonian” in front of me. This let another professor to reveal me one of the most guarded treasures for the physicist: the all-mighty Lagrangian.

This post is not about an advanced subject, but it is neither for the initiated, nor for the ones that ignore the subject completely. If you have never seen the Lagrangian formalism before, maybe it is not the bet place to start, but I will take you by the hand. The reason I’m doing this is because I like this a lot, and I don’t usually find the treatment as I will present it here in many course. Moreover, I you get familiar with this I will be easier for me to share with you one of the subject I’m more passionate about… Symmetries.

I’ll go a bit axiomatic at the beginning, but I assure all of this is kinda justified. I will quickly enunciate the minimum-action principle, Lagrangian formalism, Hamiltonian formalism, Poisson bracket and a small example (harmonic oscillator of course). This post is not necessarily about beautiful things, but I wanted to include it here so I can use some of this tools in later posts. Lets start with the action.

The idea is that for every physical system, we can assign a function called Lagrangian. This little monster allows us to study the behavior of systems, its symmetries, their time evolution, etc. For “regular” mechanical systems as we are use to in classical mechanics we can write this quantity as

The first term corresponds to the kinetic energy, while the second is the potential energy. We would like to use this to predict the movement of a particle between two points . The usual prescription is to take the following integral

This curious object is referred as the action integral, or simply the action. Depending on which trajectory we choose, it will give a different value. This kind of assignation between functions and number is called a functional. However, not all trajectories are useful; in fact, classically we are only interested in one, the one that actually is followed by the system. The usual prescription is to study the variations of the action when varying the trajectory, having boundaries fixed. The particle will follow the path that renders a null-variation. This is the **minimum-action principle**. In practice this fairly similar to taking some kind of differential of S:

From the construction above, we see that depends both on position and velocities. Also, note that time only works as a parametrization of the trajectory, meaning that the variation operator and the integral commute:

A common trick on this procedures is to find a way to factorize stuff, usual way to do so is by performing a integration by parts on the second term:

Some details are to be marked:

If this is your first time doing this procedures, it may look a bit informal, but I assure you every step is well justified… somewhere else… Also, you may notice this weird term . This looks weird, but if you have had a healthy approach to calculus, you know this is only the term in the usual integration by parts formula. It is a common practice among physicist to get read of this term under some boundary condition argument. For example, here we said that we are fixing the boundaries when performing the variation i . e. . However, remember that this term is there and we don’t always have a good reason to neglect it; actually there are some nice physics behind it.

For now we will get rid of these boundary terms. The stationary condition is then written as:

This has to be the case regardless of the variation , which is only possible if the argument in parenthesis is equal to zero everywhere in the interval:

Here I present you the **Euler-Lagrange equation**. This was a nice accomplishment for physics many years ago. It has many variations and can be generalized to deal with more modern theories. One of the main points of this result is that , this is a “covariant” equation, meaning that it looks the same in different coordinate system, as long as the change of coordinates behaves correctly, which is usually the case for coordinates used in physics. The idea is that if we know the correct Lagrangian associated to a physical system, we can use it to derive what are know as equations of motion. In fact, a big part of modern theoretical physics consist in finding the Lagrangian that would describe more accurately a system. To be honest, in many cases we are guessing the correct Lagrangian, but these are “informed” ansatz based on physical arguments or symmetries of systems.

Lets fine the physics hidden in this equation. I told you before that, in classical mechanics, we usually write . It is to be notice that the kinetic energy in Cartesian coordinates depends only on the velocity and the potential energy depends on position. This allows us to do the following association:

Notice that this corresponds to the usual linear momentum. In Lagrangian formalism we define a generalized momentum conjugated to a coordinate as . This association is done regardless on the coordinate chose used to express the Lagrangian; whenever there is no confusion, we drop the subindex. With this assignation, the E-L equation can be rewritten as:

but… this looks unsettling familiar. Once again, consider in the right-hand side:

But, from your Physics 101 you recall that this last term corresponds to the force resulting from a potential energy . Then, for this particular kind of Lagrangian, the equation of motion is:

This is ye good olde Newton’s second law! See? I was not inventing stuff completely out of nowhere. Now we can start with the really interesting part: Conservation and symmetric stuff.

We first write a version of this for more than one coordinate:

Here the index can refer to coordinate , , or to a many-particles system. As we like to derivate stuff, it would be interesting to see the time evolution for the Lagrangian along a trajectory. Lets do it:

for the second equality we use directly the momentum definition and the E-L equation. The last term can be easily seen as the derivative of a product:

Putting the time derivative together we obtain an interesting identity:

The thing inside the derivative is of great importance; it is so important that we will give it a letter and a name:

This is the Hamiltonian. And it will whose to have a great deal of relevance. The signs used are a convention, thus arbitrary, but it is better to keep them like that so people don’t start getting confused. A first interesting thing to notice is that if the Lagrangian does not depends explicitly on time, we can set its partial derivative to zero:

This means that the Hamiltonian will have the same value everywhere along the trajectory. Whenever a function on the trajectory takes a constant value along it we refer to this value as a constant of motion. If we go back to the sample Lagrangian we have been working with, we notice the following:

This last terms is the total mechanical energy as you have seen in other physics courses. Then we can associate the Hamiltonian function to the classical energy. A point to stress here is this association is not an identity. The Hamiltonian is function depending on the coordinates and momenta; the space formed with this variables is referred as phase space. The energy are the values that this function takes when it behaves as a constant of motion. From this a straightforward observation:

*Observation 1: **If the Lagrangian describing a system does not depends explicitly on time, the trajectory described by the system is such that the generalized coordinates and momenta lie on the level curves of the Hamiltonian function.*

This may sound a bit cryptic now, but here I give you a rephrasing that may sound more…. physical: The fact that your Lagrangian does not depend on time means that it does not matter when do you start studying your system, you will alway find the same equations of motion. If you change in time, the particulars of your system, such as positions and velocities, may look different, but the physics behind it will be the same, i. e. same differential equations. We then say that the system is symmetric in time:

*Observation 1 (Rephrased): **If the Lagrangian describing a system is symmetric in time, the trajectory described by the system will have a constant energy given by the Hamiltonian function.*

This one is a first taste of a marvelous thing called Noether’s theorem, but we are going to talk about that later.

There is another utility involving the Hamiltonian. To see this, let’s replace it directly in the action integral:

and once again we perform a variation with fixed boundaries now in both momentum and position space to find the stationary action:

Using again integration by parts with fixed ends we obtain:

Since this variation should be null for every variation on the momentum and position space, the terms in parenthesis should vanish identically. This yields two sets of first order differential equations:

These are the **Hamilton’s equations**. We can use those to describe the dynamic of the system and a straight-forward calculation shows that this are equivalent to the equations of motion obtained either by Euler-Lagrange or by Newton’s second law.

Finally we violently introduce the notion of Poisson brackets. Consider a function of phase space that does not depend on time explicitly. Using the chain rule and the Hamilton’s equation we obtain the following identity:

Inspired on this structure we introduce the Poisson bracket of two functions of phase space as:

Which allow us to rewrite the previous expression as:

Of course, for those versed in quantum mechanics, this is awfully similar to the Ehrenfest theorem. I invite you to also check that . Furthermore, this object have the same behavior as the commutator:

- Anticommutativity:
- Bilinearity:
- Leibniz’s rule:

With this notation, Hamilton’s equation are written as follows:

Now this equations of motion look symmetric as fuck. Moreover, if H is a nice analytic function on phase space (which for classical mechanics tends to be a reasonable assumption) it admits a series expansion on powers of the generalized coordinates and momentum. It is therefore not hard to convince ourselves that the equation of motion can be directly calculated using the Poisson bracket of the coordinates with the momenta ().

The last observation raise the interest on the following question: What happens if we change coordinates ? Well, we can show that, as long as the new coordinates have the same Poisson bracket behavior (), the equations of motion derived for the Hamilton’s equations in the Poisson bracket form, will be consistent. Such coordinate changes are named “canonical transformations”.

We need an example:

Start with a 1D classical harmonic oscillator; its kinetic energy is given by , while the potential energy is . Under the above prescription , the Lagrangian of the system is:

Simple calculation tells us that the generalized momentum coincides with the usual momentum . We could directly write Euler-Lagrange equation from this and get an equation of motion:

This is the expected Newton’s second law for a spring-mass configuration in 1D, but… a bit boring and not that insightful. However, if you already read my post on the harmonic oscillator, I bet you know there is a bit more to it. Lets first write the Lagrangian in terms of the momentum variable:

Then we obtain the Hamiltonian:

I guess you see where are we going. We change variables . With those, our Hamiltonian has a more aesthetic view:

And those trivially preserves the Poisson bracket:

This is already fairly interesting, because, due to the observation 1, the trajectory followed in phase space is level curve of this Hamiltonian, meaning that, for this particular case, it describes a circle with radius . This hints to another canonical transformation: Circles imply polar coordinates; set

Why to keep the squares and the one half? Honestly that’s just because I know already the answer and we want to have certain similarities with the quantum version of this system. If I don’t keep the half and similar stuff I would get a Poisson bracket that is off by some multiplicative constant, keeping everything guarantees us to have the correct brackets; you can try and do it with the square root, removing the one half, but for my it is plainly annoying to deal with the derivative of square roots. Well, before using it, let me just show you that the Poisson bracket are consistent:

There you have it, our coordinate transformation is one we can trust; now we can see why is this beautiful. First of all, of Hamiltonian ow is much nicer:

Also, the equations of motion are fairly trivial:

Which allow us to see much more easily that the Hamiltonian yields a constant value in the trajectory. For the second coordinate:

In the last one we made, direct use of the Poisson bracket between the coordinate and its momentum; that’s what I meant when saying that the equation of motions are encoded in this brackets. This last equation tells us that, for an arbitrary time:

Going back to the original coordinates, we directly obtain:

which is in accordance with the result we would get by solving the traditional equation of motion. There are some thing to notice in this approach:

- You can see the direct relation between the energy of the system and the amplitude of oscillation. That’s why as soon as we put some damping, breaking the energy conservation, we obtain a decrease on amplitude. This also shows how resonance and other phenomena as such can occur when introducing an external time-dependent force, since this one breaks the time-translation symmetry.
- Regardless of the fact that we started from the action integral, no actual integral was calculated along this whole process! Not even an ansatz for the differential equation
- Hamiltonian in this approach look unsettlingly similar to the one in the quantum treatment, I invite you to have a look.

That’s pretty much it. I’m sorry for the long technical post, but I wanted to leave you a reference in case I use some of this for latter post. For now, as a gift, I’ll show you what happens if we are don’t neglect those boundaries terms I told you before:

Consider once again the action integral we mention before, but this time we will only leave fixed the initial point while allowing the end point to vary a bit. However, we will focus on the value of this action integral only for the trajectories that satisfy the E-L equation. This is the same as to compare how the stationary action would have change if, instead of arriving to the point that I was interesting on, I had arrive to another next to it, but still following a physical trajectory. With this line of thought in mind, the action integral looks like this:

and, from what we did before, its variation will be:

Since we said that this trajectories obey the Euler-Lagrange equation, the argument within the integral vanishes for every value of t, leaving us with a nice identity:

Notice that the term in the right-hand side is the generalized momentum… identifying the variation with the differential of S and taking into account the other coordinate, we obtain a familiar expression:

For those familiar with quantum mechanics this should look pretty interesting. This is not a coincidence and can be used to connect some loose strings… but this will be later, for now lets use this together with the Hamiltonian. From the action integral definition, it is not hard to see when varying the arrival time that:

But, since we are thinking of the action as a function of the ending point:

Where in the last equality we used the previous identity. Combining this two equalities with the definition of the Hamiltonian:

This is also equal to the energy of the system. I invite you to try by yourself the following exercise:

Consider the operators and . Study the effect of those operator when acting on the function . In particular, show that, for a system displaying conservation of energy and momentum, this function is an eigenvector of these operators.

This exercise is related to some nice subjects such as the WKB method, the Bohr-Sommerfeld quantization rule, path integrals, etc. However, this subject are for a longer discussion and now it is not the time; I just invite you to notice that everything I did here was classical mechanics, so, the real question is: Where is actually the quantum in quantum mechanics ?