Skip to main content
\(\require{cancel}\)
Physics LibreTexts

15.3: Canonical Transformations in Hamiltonian Mechanics

  • Page ID
    9651
  • Hamiltonian mechanics is an especially elegant and powerful way to derive the equations of motion for complicated systems. Unfortunately, integrating the equations of motion to derive a solution can be a challenge. Hamilton recognized this difficulty, so he proposed using generating functions to make canonical transformations which transform the equations into a known soluble form. Jacobi, a contemporary mathematician, recognized the importance of Hamilton’s pioneering developments in Hamiltonian mechanics, and therefore he developed a sophisticated mathematical framework for exploiting the generating function formalism in order to make the canonical transformations required to solve Hamilton’s equations of motion.

    In the Lagrange formulation, transforming coordinates \((q_i, \dot{q}_i)\) to cyclic generalized coordinates \((Q_i, \dot{Q}_i)\), simplifies finding the Euler-Lagrange equations of motion. For the Hamiltonian formulation, the concept of coordinate transformations is extended to include simultaneous canonical transformation of both the spatial coordinates \(q_i\) and the conjugate momenta \(p_i\) from \((q_i, p_i)\) to \((Q_i, P_i)\), where both of the canonical variables are treated equally in the transformation. Compared to Lagrangian mechanics, Hamiltonian mechanics has twice as many variables which is an asset, rather than a liability, since it widens the realm of possible canonical transformations.

    Hamiltonian mechanics has the advantage that generating functions can be exploited to make canonical transformations to find solutions, which avoids having to use direct integration. Canonical transformations are the foundation of Hamiltonian mechanics; they underlie Hamilton-Jacobi theory and action-angle variable theory, both of which are powerful means for exploiting Hamiltonian mechanics to solve problems in physics and engineering. The concept underlying canonical transformations is that, if the equations of motion are simplified by using a new set of generalized variables \((\mathbf{Q},\mathbf{P})\), compared to using the original set of variables \((\mathbf{q},\mathbf{p})\), then an advantage has been gained. The solution, expressed in terms of the generalized variables \((\mathbf{Q},\mathbf{P})\), can be transformed back to express the solution in terms of the original coordinates, \((\mathbf{q},\mathbf{p})\).

    Only a specialized subset of transformations will be considered, namely canonical transformations that preserve the canonical form of Hamilton’s equations of motion. That is, given that the original set of variables \((q_i, p_i)\) satisfy Hamilton’s equations

    \[\mathbf{\dot{q}} = \frac{\partial H (\mathbf{q},\mathbf{p}, t)}{ \partial \mathbf{p}} \quad − \mathbf{\dot{p}} = \frac{\partial H (\mathbf{q},\mathbf{p}, t)}{ \partial \mathbf{q}} \label{15.71}\]

    for some Hamiltonian \(H(\mathbf{q},\mathbf{p}, t)\), then the transformation to coordinates \(Q_i(q_k,p_k, t), P_i (q_k, p_k, t)\) is canonical if, and only if, there exists a function \(\mathcal{H}(\mathbf{Q},\mathbf{P}, t)\) such that the \( \mathbf{ P}\) and \( \mathbf{ Q}\) are still governed by Hamilton’s equations. That is,

    \[\mathbf{\dot{Q}} = \frac{\partial\mathcal{H}(\mathbf{Q},\mathbf{P}, t)}{ \partial \mathbf{P}} \quad − \mathbf{\dot{P}} = \frac{\partial\mathcal{H}(\mathbf{Q},\mathbf{P}, t) }{\partial \mathbf{Q}} \label{15.72}\]

    where \(\mathcal{H}(\mathbf{Q},\mathbf{P}, t)\) plays the role of the Hamiltonian for the new variables. Note that \(\mathcal{H}(\mathbf{Q},\mathbf{P}, t)\) may be very different from the old Hamiltonian \(H(\mathbf{q},\mathbf{p}, t)\). The invariance of the Poisson bracket to canonical transformations, chapter \(15.2\), provides a powerful test that the transformation is canonical.

    Hamilton’s Principle of least action, discussed in chapter \(9\), states that

    \[\delta S = \delta \int^{t_2}_{t_1} L(\mathbf{q}, \mathbf{\dot{q}}, t)dt = \delta \int^{t_2}_{t_1} [\mathbf{p} \cdot \mathbf{\dot{q}} − H(\mathbf{q},\mathbf{p}, t)] dt = 0 \label{15.73}\]

    Similarly, applying Hamilton’s Principle of least action to the new Lagrangian \(\mathcal{L}(\mathbf{Q}, \mathbf{\dot{Q}} , t)\) gives

    \[\delta S = \delta \int^{t_2}_{t_1} \mathcal{L}(\mathbf{Q}, \mathbf{\dot{Q}} , t)dt = \delta \int^{t_2}_{t_1} \left[ \mathbf{P} \cdot \mathbf{\dot{Q}} − \mathcal{H}(\mathbf{Q},\mathbf{P}, t) \right] dt = 0 \label{15.74}\]

    The discussion of gauge-invariant Lagrangians, chapter \(9.3\), showed that \(L\) and \(\mathcal{L}\) can be related by the total time derivative of a generating function \(F\) where

    \[\frac{dF}{ dt} = \mathcal{L} − L \label{15.75}\]

    The generating function \(F\) can be any well-behaved function with continuous second derivatives of both the old and new canonical variables \(\mathbf{p}\), \(\mathbf{q}\), \(\mathbf{P}\), \(\mathbf{Q}\) and \(t\). Thus the integrands of \ref{15.73} and \ref{15.74} are related by

    \[\mathbf{p} \cdot \mathbf{\dot{q}} − H(\mathbf{q},\mathbf{p}, t) = \lambda \left[ \mathbf{P} \cdot \mathbf{\dot{Q}} − \mathcal{H}(\mathbf{Q},\mathbf{P}, t) \right] + \frac{dF}{dt} \label{15.76}\]

    where \(\lambda\) is a possible scale transformation. A scale transformation, such as changing units, is trivial, and will be assumed to be absorbed into the coordinates, making \(\lambda = 1\). Assuming that \(\lambda \neq 1\) is called an extended canonical transformation.

    Generating functions

    The generating function \(F\) has to be chosen such that the transformation from the initial variables \(( \mathbf{q},\mathbf{p})\) to the final variables \((\mathbf{Q},\mathbf{P})\) is a canonical transformation. The chosen generating function contributes to \ref{15.76} only if it is a function of the old plus new variables. The four possible types of generating functions of the first kind, are \(F_1(\mathbf{q}, \mathbf{Q}, t)\), \(F_2(\mathbf{q},\mathbf{P}, t)\), \(F_3(\mathbf{p}, \mathbf{Q}, t)\), and \(F_4(\mathbf{p}, \mathbf{P}, t)\). These four generating functions lead to relatively simple canonical transformations, are shown below.

    Type 1: \(F = F_1(\mathbf{q}, \mathbf{Q},t)\):

    The total time derivative of the generating function \(F = F_1(\mathbf{q}, \mathbf{Q},t)\) is given by

    \[\frac{dF(\mathbf{q}, \mathbf{Q},t)}{ dt} = \left[ \frac{\partial F_1(\mathbf{q}, \mathbf{Q},t)}{ \partial \mathbf{q}} \cdot \mathbf{\dot{q}} + \frac{\partial F_1(\mathbf{q}, \mathbf{Q},t)}{ \partial \mathbf{Q}} \cdot \mathbf{\dot{Q}} \right] + \frac{\partial F_1(\mathbf{q}, \mathbf{Q},t) }{\partial t} \label{15.77}\]

    Insert Equation \ref{15.77} into Equation \ref{15.76}, and assume that the trivial scale factor \(\lambda = 1\), then

    \[\left[ \mathbf{p} − \frac{\partial F_1(\mathbf{q}, \mathbf{Q},t)}{ \partial \mathbf{q}} \right] \cdot \mathbf{\dot{q}} − H(\mathbf{q},\mathbf{p}, t) = \left[ \mathbf{P} + \frac{\partial F_1(\mathbf{q}, \mathbf{Q},t)}{ \partial \mathbf{Q}} \right] \cdot \mathbf{\dot{Q}} − \mathcal{H}(\mathbf{Q},\mathbf{P}, t) + \frac{\partial F_1(\mathbf{q}, \mathbf{Q},t) }{\partial t} \nonumber\]

    Assume that the generating function \(F_1\) determines the canonical variables \(\mathbf{p}\) and \(\mathbf{P}\) to be

    \[\mathbf{p} = \frac{\partial F_1(\mathbf{q}, \mathbf{Q},t)}{ \partial \mathbf{q}} \qquad \mathbf{P} = −\frac{\partial F_1(\mathbf{q}, \mathbf{Q},t)}{ \partial \mathbf{Q}} \label{15.78}\]

    then the terms in each square bracket cancel, leading to the required canonical transformation

    \[\mathcal{H}(\mathbf{Q},\mathbf{P}, t) = H(\mathbf{q},\mathbf{p}, t) + \frac{\partial F_1(\mathbf{q}, \mathbf{Q},t)}{ \partial t} \label{15.79}\]

    Type 2: \(F = F_2(\mathbf{q},\mathbf{P},t) − \mathbf{Q} \cdot \mathbf{P}\):

    The total time derivative of the generating function \(F = F_2(\mathbf{q},\mathbf{P},t)−\mathbf{Q} \cdot \mathbf{P}\) is given by

    \[\frac{dF}{ dt} = \left[ \frac{\partial F_2(\mathbf{q},\mathbf{P},t)}{ \partial \mathbf{q}} \cdot \mathbf{\dot{q}} + \frac{\partial F_2(\mathbf{q},\mathbf{P},t)}{ \partial \mathbf{P}} \cdot \mathbf{\dot{p}} − \mathbf{P} \cdot \mathbf{\dot{Q}} − \mathbf{\dot{P}} \cdot \mathbf{Q} \right] + \frac{\partial F_2(\mathbf{q},\mathbf{P},t)}{ \partial t} \label{15.80}\]

    Insert this into Equation \ref{15.76}, and assume that the trivial scale factor \(\lambda = 1\), then

    \[\left( \mathbf{p} − \frac{\partial F_2(\mathbf{q},\mathbf{P},t)}{ \partial \mathbf{q}} \right) \cdot \mathbf{\dot{q}} − H(\mathbf{q},\mathbf{p}, t) = \mathbf{P} \cdot \mathbf{\dot{Q}} − \mathbf{P} \cdot \mathbf{\dot{Q}} + \left[ \frac{\partial F_2(\mathbf{q},\mathbf{P},t)}{ \partial \mathbf{P}} − \mathbf{Q} \right] \cdot \mathbf{\dot{P}} − \mathcal{H}(\mathbf{Q},\mathbf{P}, t) + \frac{\partial F_2(\mathbf{q},\mathbf{P},t)}{ \partial t } \nonumber\]

    Assume that the generating function \(F_2\) determines the canonical variables \(\mathbf{p}\) and \(\mathbf{Q}\) to be

    \[\mathbf{p} = \frac{\partial F_2(\mathbf{q},\mathbf{P},t)}{ \partial \mathbf{q}} \qquad \mathbf{Q} = \frac{\partial F_2(\mathbf{q},\mathbf{P},t) }{\partial \mathbf{P}} \label{15.81}\]

    then the terms in brackets cancel, leading to the required transformation

    \[\mathcal{H}(\mathbf{Q},\mathbf{P}, t) = H(\mathbf{q},\mathbf{p}, t) + \frac{\partial F_2(\mathbf{q},\mathbf{P},t)}{ \partial t} \label{15.82}\]

    Type 3: \(F = F_3(\mathbf{p}, \mathbf{Q},t) + \mathbf{q} \cdot \mathbf{p}\):

    The total time derivative of the generating function \(F = F_3(\mathbf{p}, \mathbf{Q},t) + \mathbf{q} \cdot \mathbf{p}\) is given by

    \[\frac{dF }{dt} = \left[ \frac{\partial F_3(\mathbf{p}, \mathbf{Q},t)}{ \partial \mathbf{p}} \cdot \mathbf{\dot{p}} + \frac{\partial F_3(\mathbf{p}, \mathbf{Q},t)}{ \partial\mathbf{ Q}} \cdot \mathbf{\dot{Q}} + \mathbf{\dot{q}} \cdot \mathbf{p} + \mathbf{q} \cdot \mathbf{\dot{p}} \right] + \frac{\partial F_3(\mathbf{p}, \mathbf{Q},t)}{ \partial t} \label{15.83}\]

    Insert this into Equation \ref{15.76}, and assume that the trivial scale factor \(\lambda = 1\), then

    \[− \left[ \mathbf{q}+ \frac{\partial F_3(\mathbf{p}, \mathbf{Q},t)}{ \partial \mathbf{p}} \right] \cdot \mathbf{\dot{p}} − H(\mathbf{q},\mathbf{p}, t) = \left[ \mathbf{P}+ \frac{\partial F_3(\mathbf{p}, \mathbf{Q},t)}{ \partial \mathbf{Q}} \right] \cdot \mathbf{\dot{Q}} − \mathcal{H}(\mathbf{Q},\mathbf{P}, t) + \frac{\partial F_3(\mathbf{p}, \mathbf{Q},t)}{ \partial t} \nonumber\]

    Assume that the generating function \(F_3\) determines the canonical variables \(\mathbf{q}\) and \(\mathbf{P}\) to be

    \[\mathbf{q} = −\frac{\partial F_3(\mathbf{p}, \mathbf{Q},t)}{ \partial \mathbf{p}} \qquad \mathbf{P} = −\frac{\partial F_3(\mathbf{p}, \mathbf{Q},t)}{ \partial \mathbf{Q}} \label{15.84}\]

    then the terms in brackets cancel, leading to the required transformation

    \[\mathcal{H}(\mathbf{Q},\mathbf{P}, t) = H(\mathbf{q},\mathbf{p}, t) + \frac{\partial F_3(\mathbf{p}, \mathbf{Q},t)}{ \partial t} \label{15.85}\]

    Type 4: \(F = F_4(\mathbf{p}, \mathbf{P},t) + \mathbf{q} \cdot \mathbf{p} − \mathbf{Q} \cdot \mathbf{P}\):

    The total time derivative of the generating function \(F = F_4(\mathbf{p}, \mathbf{P},t) + \mathbf{q} \cdot \mathbf{p} − \mathbf{Q} \cdot \mathbf{P}\) is given by

    \[\frac{dF }{dt} = \left[ \frac{\partial F_4(\mathbf{p}, \mathbf{P},t)}{ \partial \mathbf{p}} \cdot \mathbf{\dot{p}} + \frac{\partial F_4(\mathbf{p}, \mathbf{P},t) }{\partial \mathbf{P}} \cdot \mathbf{\dot{p}} + \mathbf{\dot{q}} \cdot \mathbf{p} + \mathbf{q} \cdot \mathbf{\dot{p}} − \mathbf{\dot{Q}} \cdot \mathbf{P} − \mathbf{Q} \cdot \mathbf{\dot{P}} \right] + \frac{\partial F_4(\mathbf{p}, \mathbf{P},t)}{ \partial t}\label{15.86}\]

    Insert this into Equation \ref{15.76}, and assume that the trivial scale factor \(\lambda = 1\), then

    \[− \left[ \mathbf{q}+ \frac{\partial F_4(\mathbf{p}, \mathbf{P},t)}{ \partial \mathbf{p}} \right] \cdot \mathbf{\dot{p}} − H(\mathbf{q},\mathbf{p}, t) = \left[ \frac{\partial F_4(\mathbf{p}, \mathbf{P},t)}{ \partial \mathbf{P} } − \mathbf{Q} \right] \cdot \mathbf{\dot{P}} − \mathcal{H}(\mathbf{Q},\mathbf{P}, t) + \frac{\partial F_4(\mathbf{p}, \mathbf{P},t) }{\partial t} \nonumber\]

    Assume that the generating function \(F_4\) determines the canonical variables \(\mathbf{q}\) and \(\mathbf{Q}\) to be

    \[\mathbf{q} = −\frac{\partial F_4(\mathbf{p}, \mathbf{P},t)}{ \partial \mathbf{p}} \qquad \mathbf{Q} = \frac{\partial F_4(\mathbf{p}, \mathbf{P},t)}{ \partial \mathbf{P}} \label{15.87}\]

    then the terms in brackets cancel, leading to the required transformation

    \[\mathcal{H}(\mathbf{Q},\mathbf{P}, t) = H(\mathbf{q},\mathbf{p}, t) + \frac{\partial F_4(\mathbf{p}, \mathbf{P},t)}{ \partial t} \label{15.88}\]

    Note that the last three generating functions require the inclusion of additional bilinear products of \(q\), \(p\), \(Q\), \(P\) in order for the terms to cancel to give the required result. The addition of the bilinear terms, ensures that the resultant generating function \(F\) is the same using any of the four generating functions \(F_1\), \(F_2\), \(F_3\), \(F_4\). Frequently the \(F_2(\mathbf{q},\mathbf{P}, t)\) generating function is the most convenient. The four possible generating functions of the first kind, given above, are related by Legendre transformations. A canonical transformation does not have to conform to only one of the four generating functions \(F_k\) for all the degrees of freedom, they can be a mixture of different flavors for the different degrees of freedom. The properties of the generating functions are summarized in table \(\PageIndex{1}\).

    Table \(\PageIndex{1}\): Canonical transformation generating functions
    Generating function Generating function derivatives Trivial special examples
    \(F = F_1(\mathbf{q}, \mathbf{Q}, t)\) \(p_i = \frac{\partial F_1}{ \partial q_i } \quad P_i = −\frac{\partial F_1}{ \partial Q_i}\) \(F_1 = q_iQ_i \quad Q_i = p_i \quad P_i = −q_i\)
    \(F = F_2(\mathbf{q},\mathbf{P}, t) − \mathbf{Q} \cdot \mathbf{P}\) \(p_i = \frac{\partial F_2}{ \partial q_i} \quad Q_i = \frac{\partial F_2}{ \partial P_i}\) \(F_2 = q_iP_i \quad Q_i = q_i \quad P_i = p_i\)
    \(F = F_3(\mathbf{p}, \mathbf{Q},t) + \mathbf{q} \cdot \mathbf{p}\) \(q_i = −\frac{\partial F_3}{ \partial p_i} \quad P_i = −\frac{\partial F_3}{ \partial Q_i}\) \(F_3 = p_iQ_i \quad Q_i = −q_i \quad P_i = −p_i\)
    \(F = F_4(\mathbf{p},\mathbf{P},t) + \mathbf{q} \cdot \mathbf{p} − \mathbf{Q} \cdot \mathbf{P}\) \(q_i = −\frac{\partial F_4}{ \partial p_i } \quad Q_i = \frac{\partial F_4}{ \partial P_i}\) \(F_4 = p_iP_i \quad Q_i = p_i \quad P_i = −q_i\)

    The partial derivatives of the generating functions \(F_i\) determine the corresponding conjugate variables not explicitly included in the generating function \(F_i\). Note that, for the first trivial example \(F_1 = q_iQ_i\), the old momenta become the new coordinates, \(Q_i = p_i\), and vice versa, \(P_i = −q_i\). This illustrates that it is better to name them “conjugate variables” rather than “momenta” and “coordinates”.

    In summary, Jacobi has developed a mathematical framework for finding the generating function \(F\) required to make a canonical transformation to a new Hamiltonian \(\mathcal{H}(\mathbf{Q},\mathbf{P}, t)\), that has a known solution. That is,

    \[\mathcal{H}(\mathbf{Q},\mathbf{P}, t) = H(\mathbf{q},\mathbf{p}, t) + \frac{\partial F}{ \partial t} \label{15.89}\]

    When \(\mathcal{H}(\mathbf{Q},\mathbf{P}, t)\) is a constant, then a solution has been obtained. The inverse transformation for this solution \(\mathbf{Q}(t), \mathbf{P}(t) \rightarrow \mathbf{q}(t), \mathbf{p}(t)\) now can be used to express the final solution in terms of the original variables of the system.

    Note the special case when \(\mathcal{H}(\mathbf{Q},\mathbf{P}, t)=0\), then Equation \ref{15.89} has been reduced to the Hamilton-Jacobi relation \ref{15.11}

    \[H(\mathbf{q},\mathbf{p}, t) + \frac{\partial S}{\partial t} = 0 \label{15.11}\]

    In this case, the generating function \(F\) determines the action functional \(S\) required to solve the Hamilton-Jacobi equation \((15.4.23)\)). Since Equation \ref{15.89} has transformed the Hamiltonian \(H(\mathbf{q},\mathbf{p}, t) \rightarrow \mathcal{H}(\mathbf{Q},\mathbf{P}, t)\), for which \(\mathcal{H}(\mathbf{Q},\mathbf{P}, t)=0\), then the solution \(\mathbf{Q}(t), \mathbf{P}(t)\) for the Hamiltonian \(\mathcal{H}(\mathbf{Q},\mathbf{P}, t)=0\) is obtained easily. This approach underlies Hamilton-Jacobi theory presented in chapter \(15.4\).

    Applications of Canonical Transformations

    The canonical transformation procedure may appear unnecessarily complicated for solving the examples given in this book, but it is essential for solving the complicated systems that occur in nature. For example, canonical transformations can be used to transform time-dependent, (non-autonomous) Hamiltonians to time-independent, (autonomous) Hamiltonians for which the solutions are known. Example \(15.6.2\) describes such a system. Canonical transformations provide a remarkably powerful approach for solving the equations of motion in Hamiltonian mechanics, especially when using the Hamilton-Jacobi approach discussed in chapter \(15.4\).

    Example \(\PageIndex{1}\): The identity canonical transformation

    The identity transformation \(F_2(\mathbf{q},\mathbf{P}) = \mathbf{q} \cdot \mathbf{P}\) satisfies \ref{15.89} if the following relations are satisfied \(p_i = \frac{\partial F_2 }{\partial q_i }= P_i\), \(Q_i = \frac{\partial F_2}{ \partial P_i } = q_i\), \(\mathcal{H}=H\). Note that the new and old coordinates are identical, hence \(F_2 = q_iP_i \) generates the identity transformation \(q_i = Q_i , p_i = P_i\).

    Example \(\PageIndex{2}\): The point canonical transformation

    Consider the point transformation \(F_2(\mathbf{q} \cdot \mathbf{P}) = f(\mathbf{q},t)\cdot \mathbf{P}\) where \(f(\mathbf{q},t)\) is some function of \(\mathbf{q}\). This transformation satisfies \ref{15.89} if the following relations are satisfied \(Q_i = \frac{\partial F_2}{ \partial P_i} = f_i(q_i)\), \(p_i = \frac{\partial F_2}{\partial q_i } = \frac{\partial f_i(q_i,t)}{ \partial q_i }\), \(\mathcal{H}=H\). Point transformations correspond to point-to-point transformations of coordinates.

    Example \(\PageIndex{3}\): The exchange canonical transformation

    The identity transformation \(F_1(\mathbf{q}, \mathbf{Q}) = \mathbf{q} \cdot \mathbf{Q}\) satisfies \ref{15.89} if the following relations are satisfied \(p_i = \frac{\partial F_1}{ \partial q_i} = Q_i\), \(P_i = −\frac{\partial F_1} {\partial Q_i} = −q_i\), \(\mathcal{H}=H\) That is, the coordinates and momenta have been interchanged.

    Example \(\PageIndex{4}\): Infinitessimal point canonical transformation

    Consider an infinitessimal point canonical transformation, that is infinitesimally close to a point identity.

    \[F_2(\mathbf{q} \cdot \mathbf{P},t) = \mathbf{q} \cdot \mathbf{P}+\epsilon G (\mathbf{q},\mathbf{P},t) \nonumber\]

    satisfies \ref{15.89} if the following relations are satisfied

    \[Q_i = \frac{\partial F_2}{ \partial P_i} = q_i + \epsilon \frac{\partial G(\mathbf{q},\mathbf{P}, t) }{\partial P_i} \nonumber\]

    \[p_i = \frac{\partial F_2 }{\partial q_i} = P_i + \epsilon \frac{\partial G(\mathbf{q},\mathbf{P}, t)}{ \partial q_i} \nonumber\]

    Thus the infinitessimal changes in \(q_i\) and \(p_i\) are given by

    \[\delta q_i(\mathbf{q},\mathbf{p},t) = Q_i − q_i = \epsilon \frac{\partial G(\mathbf{q},\mathbf{P}, t)}{ \partial P_i } = \epsilon \frac{\partial G(\mathbf{q},\mathbf{P}, t)}{ \partial p_i} + O(\epsilon^2) \nonumber\]

    \[\delta p_i(\mathbf{q},\mathbf{p},t) = P_i − p_i = −\epsilon \frac{\partial G(\mathbf{q},\mathbf{P}, t)}{ \partial q_i} = −\epsilon \frac{\partial G(\mathbf{q},\mathbf{P}, t)}{ \partial p_i} + O(\epsilon^2) \nonumber\]

    Thus \(G(\mathbf{q},\mathbf{P},t)\) is the generator of the infinitessimal canonical transformation.

    Example \(\PageIndex{5}\): 1-D harmonic oscillator via a cononical transformation

    The classic one-dimensional harmonic oscillator provides an example of the use of canonical transformations. Consider the Hamiltonian where \(\omega^2 = \frac{k}{m}\) then

    \[H = \frac{p^2}{2m} + \frac{kq^2}{ 2} = \frac{1}{ 2m} \left( p^2 + m^2\omega^2q^2\right) \nonumber\]

    This form of the Hamiltonian is a sum of two squares suggesting a canonical transformation for which \(H\) is cyclic in a new coordinate. A guess for a canonical transformation is of the form \(p = m\omega q \cot Q\) which is of the \(F_1(\mathbf{q}, \mathbf{Q})\) type where \(F_1\) equals \(F_1(\mathbf{q}, \mathbf{Q}) = \frac{m\omega q^2}{2} \cot Q\). Using \ref{15.78} gives

    \[p = \frac{\partial F_1(q,Q) }{\partial q_i} = m\omega q \cot Q \nonumber\]

    \[P = −\frac{\partial F_1(q, Q)}{ \partial Q} = \frac{m}{ 2} \frac{\omega q^2}{ \sin^2 Q} \nonumber\]

    Solving for the coordinates \((p, q)\) yields

    \[q = \sqrt{\frac{2P}{ m\omega}} \sin Q \tag{a}\label{a}\]

    \[p = \sqrt{2m\omega P} \cos Q \tag{b}\label{b}\]

    Inserting these into \(H\) gives

    \[\mathcal{H} =\omega P(\cos^2 Q + \sin^2 Q) = \omega P \nonumber\]

    which implies that \(Q\) is a cyclic coordinate.

    The Hamiltonian is conservative, since it does not explicitly depend on time, and it equals the total energy since the transformation to generalized coordinates is time independent. Thus

    \[\mathcal{H} =E = \omega P \nonumber\]

    Since

    \[\dot{Q} = \frac{\partial \mathcal{H}}{ \partial P} = \omega \nonumber\]

    then

    \[Q = \omega t + \phi \nonumber\]

    Substituting \(Q\) into \ref{a} gives the well known solution of the one-dimensional harmonic oscillator

    \[q = \sqrt{\frac{2E}{ m\omega^2}} \sin (\omega t + \phi ) \nonumber\]