We all know that there are some famous mathematical operations playing an important role in many fields of physics (and besides not only in physics). Knowledge of such common things allows understanding of relations between different phenomena and sometimes even opens new views on physics in general. One of such, Legendre transformation (that is Adrien-Marie Legendre’s who is on the right side) and its role in Hamiltonian mechanics (by William Rowan Hamilton, a gentleman on the left side) is to be the topic of our today’s discussion.

First of all, let’s take a look which math operation is actually called Legendre transformation. Let us consider a convex function of one variable for simplicity

y = f(x).

We shall introduce a new variable p = f'(x). Due to convexity, the following relation is obvious

\dfrac{dp}{dx} = f^{\prime\prime}(x) \neq 0.

It means that we can express x coordinate with a new one, p. And a new function of a new variable can be considered:

H(p) = -f(x) + px.

Namely, this transformation of the pair (x,f(x)) into the pair (p, H(p)) is called the Legendre transformation in mathematics. Due to the symmetry, it is easy to see that Legendre transformation of the function H(p) turns us back us to the function f(x). And you see, just move f(x) to the left-hand side and H(p) to the right-hand side to get the inverse Legendre transformation here.

In the case of multivariable function f(x_1,x_2,\ldots,x_n), one can perform the same operation introducing a variable p_i for the each of x_i:

H(p_1,p_2,\ldots,p_n) = -f(x_1,x_2,\ldots,x_n) + \sum_n p_i x_i.

This transformation has found a wide application in physics to describe the transformation of one set of coordinates to another if the old and new coordinates are connected by differential expression. It is also widely used in classical and quantum mechanics, thermodynamics and field theory. Here, for example, let us consider a Hamiltonian formalism in classical mechanics.

A mechanical system is described by the Lagrange function

L = L(q_1,q_2,\ldots,q_n; \dot q_1, \dot q_2,\ldots,\dot q_n; t).

There are three set of variables: generalized coordinates q = \{q_i\}, generalized velocities \dot q = \{ \dot q_i \} and time t. To apply the Legendre transformation, let’s select one of these sets – velocities \dot q. A new set of variables is

p_i = \dfrac{\partial L}{\partial \dot q_i},

and this is exactly momentum in the classical mechanics by its definition. Super. Now we can put down a new function

H (q; p; t) = -L(q; \dot q; t) + \sum_n p_i \dot q_i.

This one is called Hamiltonian. The main feature of Hamiltonian function is that it generalizes coordinates and momentums, but not velocities. In many cases, especially in problems of classical mechanics, a numerical value of a Hamiltonian coincides with the energy of the system. In quantum mechanics, it becomes a specific differential operator, which eigenvalues are values of energy allowed for the system. This is why it is so important in the theoretical physics.