# Invariance of Euler-Lagrange and Hamilton’s equations under canonical transformations

References: Shankar, R. (1994), Principles of Quantum Mechanics, Plenum Press. Section 2.7; Exercise 2.7.8 (1-3).

Here we’ll investigate how the Euler-Lagrange equations and Hamilton’s canonical equations are affected by a change in coordinates of the form

$\displaystyle q_{i}\rightarrow\overline{q}_{i}\left(q_{1},\ldots,q_{n}\right) \ \ \ \ \ (1)$

Note that the new coordinates ${\overline{q}}$ depend only on the old coordinates and not on the velocities ${\dot{q}_{i}}$. We also assume that the transformation is invertible, so it’s possible to find the ${q_{i}}$ as functions of the ${\overline{q}_{i}}$.

First, we need to show that the Euler-Lagrange equations are invariant under such a transformation. Starting with the inverse equations

$\displaystyle q_{i}=q_{i}\left(\overline{q}\right) \ \ \ \ \ (2)$

(we’re using unsubscripted variables to refer to the entire set, so that ${\overline{q}=\left(\overline{q}_{1},\ldots,\overline{q}_{n}\right)}$), we have

$\displaystyle \dot{q}_{i}=\sum_{j}\frac{\partial q_{i}}{\partial\overline{q}_{j}}\dot{\overline{q}}_{j} \ \ \ \ \ (3)$

Since the velocities ${\dot{\overline{q}}_{j}}$ are independent variables, this implies that, if we hold the coordinates ${\overline{q}}$ constant,

$\displaystyle \left(\frac{\partial\dot{q}_{i}}{\partial\dot{\overline{q}}_{j}}\right)_{\overline{q}}=\frac{\partial q_{i}}{\partial\overline{q}_{j}} \ \ \ \ \ (4)$

since the derivative just picks out the one term containing ${\dot{\overline{q}}_{j}}$ in the sum 3. Now consider the Euler-Lagrange equations in the new coordinates. To do this, we write the Lagrangian in terms of the new coordinates and velocities, so that

$\displaystyle L=L\left(\overline{q},\dot{\overline{q}}\right) \ \ \ \ \ (5)$

Taking derivatives, we have

$\displaystyle \frac{\partial L}{\partial\overline{q}_{i}}=\sum_{j}\left[\frac{\partial L}{\partial q_{j}}\frac{\partial q_{j}}{\partial\overline{q}_{i}}+\frac{\partial L}{\partial\dot{q}_{j}}\frac{\partial\dot{q}_{j}}{\partial\overline{q}_{i}}\right] \ \ \ \ \ (6)$

The second term on the RHS is zero since the velocities don’t depend on the coordinates (and vice versa), so we’re left with

$\displaystyle \frac{\partial L}{\partial\overline{q}_{i}}=\sum_{j}\frac{\partial L}{\partial q_{j}}\frac{\partial q_{j}}{\partial\overline{q}_{i}} \ \ \ \ \ (7)$

Now for the other derivative

$\displaystyle \frac{\partial L}{\partial\dot{\overline{q}}_{i}}=\sum_{j}\left[\frac{\partial L}{\partial q_{j}}\frac{\partial q_{j}}{\partial\dot{\overline{q}}_{i}}+\frac{\partial L}{\partial\dot{q}_{j}}\frac{\partial\dot{q}_{j}}{\partial\dot{\overline{q}}_{i}}\right] \ \ \ \ \ (8)$

The first term on the RHS is zero (same reason as in the previous equation), and we can apply 4 to the second term to get

$\displaystyle \frac{\partial L}{\partial\dot{\overline{q}}_{i}}=\sum_{j}\frac{\partial L}{\partial\dot{q}_{j}}\frac{\partial q_{i}}{\partial\overline{q}_{j}} \ \ \ \ \ (9)$

We can now take the derivative with respect to time and apply the Euler-Lagrange equation (which we know to be valid for the ${q}$ coordinates). We’re also assuming that the coordinates have no explicit time dependence. Thus

 $\displaystyle \frac{d}{dt}\left(\frac{\partial L}{\partial\dot{\overline{q}}_{i}}\right)$ $\displaystyle =$ $\displaystyle \sum_{j}\frac{d}{dt}\left(\frac{\partial L}{\partial\dot{q}_{j}}\right)\frac{\partial q_{i}}{\partial\overline{q}_{j}}\ \ \ \ \ (10)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \sum_{j}\frac{\partial L}{\partial q_{j}}\frac{\partial q_{i}}{\partial\overline{q}_{j}} \ \ \ \ \ (11)$

Comparing this with 7 we see that

$\displaystyle \frac{d}{dt}\left(\frac{\partial L}{\partial\dot{\overline{q}}_{i}}\right)=\frac{\partial L}{\partial\overline{q}_{i}} \ \ \ \ \ (12)$

That is, the Euler-Lagrange equations are valid for the ${\overline{q}}$ coordinates as well.

We can use the Lagrangian to see how the momenta ${p_{i}}$ transform under the coordinate change. The definition of the canonical momentum is

$\displaystyle p_{i}=\frac{\partial L}{\partial\dot{q}_{i}} \ \ \ \ \ (13)$

If we write the Lagrangian in terms of the ${\overline{q}}$ coordinates and velocities as in 5, then the momenta in the new coordinate system are

$\displaystyle \overline{p}_{i}=\frac{\partial L\left(\overline{q},\dot{\overline{q}}\right)}{\partial\dot{\overline{q}}_{i}} \ \ \ \ \ (14)$

At this point, it’s worth noting that although ${L\left(\overline{q},\dot{\overline{q}}\right)}$ and ${L\left(q,\dot{q}\right)}$ are different functions, they have the same value at each point in the configuration space. That is, if we choose some point that has the coordinates ${\left(q,\dot{q}\right)}$ in the ${q}$ system and coordinates ${\left(\overline{q},\dot{\overline{q}}\right)}$ in the ${\overline{q}}$ system, then, numerically at that one point, we must have ${L\left(\overline{q},\dot{\overline{q}}\right)=L\left(q,\dot{q}\right)}$. Because of this, we can write

$\displaystyle \overline{p}_{i}=\left(\frac{\partial L\left(\overline{q},\dot{\overline{q}}\right)}{\partial\dot{\overline{q}}_{i}}\right)_{\overline{q}}=\left(\frac{\partial L\left(q,\dot{q}\right)}{\partial\dot{\overline{q}}_{i}}\right)_{\overline{q}} \ \ \ \ \ (15)$

That is, if we’re keeping ${\overline{q}}$ constant, the derivative of ${L}$ with respect to ${\dot{\overline{q}}_{i}}$ must be the same (numerically) no matter what coordinates we’re using to write ${L}$. Therefore, we can use the latter form and then use the chain rule to write out the derivative:

$\displaystyle \overline{p}_{i}=\left(\frac{\partial L\left(q,\dot{q}\right)}{\partial\dot{\overline{q}}_{i}}\right)_{\overline{q}}=\sum_{j}\left[\frac{\partial L}{\partial q_{j}}\frac{\partial q_{j}}{\partial\dot{\overline{q}}_{i}}+\frac{\partial L}{\partial\dot{q}_{j}}\frac{\partial\dot{q}_{j}}{\partial\dot{\overline{q}}_{i}}\right] \ \ \ \ \ (16)$

Because the coordinates ${q}$ don’t depend on the velocities ${\dot{\overline{q}}}$, the first term on the RHS is zero. We can use 4 in the second term, and we have

 $\displaystyle \overline{p}_{i}$ $\displaystyle =$ $\displaystyle \sum_{j}\frac{\partial L}{\partial\dot{q}_{j}}\frac{\partial q_{j}}{\partial\overline{q}_{i}}\ \ \ \ \ (17)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \sum_{j}\frac{\partial q_{j}}{\partial\overline{q}_{i}}p_{j} \ \ \ \ \ (18)$

where we used the definition of ${p_{j}=\partial L/\partial\dot{q}_{j}}$ in the last line.

If we review the derivation of Hamilton’s equations, we see that nowhere did we make any assumptions about the particular coordinate system that was being used in the Lagrangian. All that is required for Hamilton’s equations to be valid is that the momenta are defined as in 14, and that the Euler-Lagrange equations are satisfied. Therefore, in any such system, Hamilton’s equations are valid:

 $\displaystyle \frac{\partial H}{\partial\overline{p}_{i}}$ $\displaystyle =$ $\displaystyle \dot{\overline{q}}_{i}\ \ \ \ \ (19)$ $\displaystyle -\frac{\partial H}{\partial\overline{q}_{i}}$ $\displaystyle =$ $\displaystyle \dot{\overline{p}}_{i} \ \ \ \ \ (20)$

A transformation of the form 1 and 18, that is, that obeys

 $\displaystyle \overline{q}_{i}$ $\displaystyle =$ $\displaystyle \overline{q}_{i}\left(q_{1},\ldots,q_{n}\right)\ \ \ \ \ (21)$ $\displaystyle \overline{p}_{i}$ $\displaystyle =$ $\displaystyle \sum_{j}\frac{\partial q_{j}}{\partial\overline{q}_{i}}p_{j} \ \ \ \ \ (22)$

is called a point transformation.

In the ${2n}$-dimensional phase space of the Hamiltonian formalism, where ${q}$ and ${p}$ are the variables rather than the ${q}$ and ${\dot{q}}$ used in the Lagrangian, we can envision a more general transformation in which

 $\displaystyle \overline{q}_{i}$ $\displaystyle =$ $\displaystyle \overline{q}_{i}\left(q,p\right)\ \ \ \ \ (23)$ $\displaystyle \overline{p}_{i}$ $\displaystyle =$ $\displaystyle \overline{p}_{i}\left(q,p\right) \ \ \ \ \ (24)$

In such a general transformation, there’s no guarantee that 18 is satisfied, so such transformations need not be point transformations (though they could be). There’s also no guarantee that the momenta are related to the Lagrangian by 14, and thus Hamilton’s equations may not be satisfied.

However, a set of coordinates ${\left(\overline{q},\overline{p}\right)}$ that does satisfy Hamilton’s equations 19 and 20 is known as a canonical transformation.