# Canonical transformation

In Hamiltonian mechanics, a canonical transformation is a change of canonical coordinates (q, p) → (Q, P) that preserves the form of Hamilton's equations. This is sometimes known as form invariance. Although Hamilton's equations are preserved, it need not preserve the explicit form of the Hamiltonian itself. Canonical transformations are useful in their own right, and also form the basis for the Hamilton–Jacobi equations (a useful method for calculating conserved quantities) and Liouville's theorem (itself the basis for classical statistical mechanics).
Since Lagrangian mechanics is based on generalized coordinates, transformations of the coordinates q → Q do not affect the form of Lagrange's equations and, hence, do not affect the form of Hamilton's equations if the momentum is simultaneously changed by a Legendre transformation into $P_{i}={\frac {\partial L}{\partial {\dot {Q}}_{i}}}\ ,$ where $\left\{\ (P_{1},Q_{1}),\ (P_{2},Q_{2}),\ (P_{3},Q_{3}),\ \ldots \ \right\}$ are the new co‑ordinates, grouped in canonical conjugate pairs of momenta $P_{i}$ and corresponding positions $Q_{i},$ for $i=1,2,\ldots \ N,$ with $N$ being the number of degrees of freedom in both co‑ordinate systems.
Therefore, coordinate transformations (also called point transformations) are a type of canonical transformation. However, the class of canonical transformations is much broader, since the old generalized coordinates, momenta and even time may be combined to form the new generalized coordinates and momenta. Canonical transformations that do not include the time explicitly are called restricted canonical transformations (many textbooks consider only this type).
Modern mathematical descriptions of canonical transformations are considered under the broader topic of symplectomorphism which covers the subject with advanced mathematical prerequisites such as cotangent bundles, exterior derivatives and symplectic manifolds.

## Notation

Boldface variables such as q represent a list of N generalized coordinates that need not transform like a vector under rotation and similarly p represents the corresponding generalized momentum, e.g., ${\begin{aligned}\mathbf {q} &\equiv \left(q_{1},q_{2},\ldots ,q_{N-1},q_{N}\right)\\\mathbf {p} &\equiv \left(p_{1},p_{2},\ldots ,p_{N-1},p_{N}\right).\end{aligned}}$
A dot over a variable or list signifies the time derivative, e.g., ${\dot {\mathbf {q} }}\equiv {\frac {d\mathbf {q} }{dt}}$and the equalities are read to be satisfied for all coordinates, for example:${\dot {\mathbf {p} }}=-{\frac {\partial f}{\partial \mathbf {q} }}\quad \Longleftrightarrow \quad {\dot {p_{i}}}=-{\frac {\partial f}{\partial {q_{i}}}}\quad (i=1,\dots ,N).$
The dot product notation between two lists of the same number of coordinates is a shorthand for the sum of the products of corresponding components, e.g., $\mathbf {p} \cdot \mathbf {q} \equiv \sum _{k=1}^{N}p_{k}q_{k}.$
The dot product (also known as an "inner product") maps the two coordinate lists into one variable representing a single numerical value. The coordinates after transformation are similarly labelled with Q for transformed generalized coordinates and P for transformed generalized momentum.

## Conditions for restricted canonical transformation

Restricted canonical transformations are coordinate transformations where transformed coordinates Q and P do not have explicit time dependence, i.e., Q=Q(q, p){\textstyle \mathbf {Q} =\mathbf {Q} (\mathbf {q} , \mathbf {p} )} and P=P(q, p){\textstyle \mathbf {P} =\mathbf {P} (\mathbf {q} , \mathbf {p} )}. The functional form of Hamilton's equations is${\begin{aligned}{\dot {\mathbf {p} }}&=-{\frac {\partial H}{\partial \mathbf {q} }}\,,&{\dot {\mathbf {q} }}&={\frac {\partial H}{\partial \mathbf {p} }}\end{aligned}}$ In general, a transformation (q, p) → (Q, P) does not preserve the form of Hamilton's equations but in the absence of time dependence in transformation, some simplifications are possible. Following the formal definition for a canonical transformation, it can be shown that for this type of transformation, the new Hamiltonian (sometimes called the Kamiltonian) can be expressed as:$K(\mathbf {Q} ,\mathbf {P} ,t)=H(q(\mathbf {Q} ,\mathbf {P} ),p(\mathbf {Q} ,\mathbf {P} ),t)+{\frac {\partial G}{\partial t}}(t)$where it differs by a partial time derivative of a function known as a generator, which reduces to being only a function of time for restricted canonical transformations.
In addition to leaving the form of the Hamiltonian unchanged, it is also permits the use of the unchanged Hamiltonian in the Hamilton's equations of motion due to the above form as:
${\begin{alignedat}{3}{\dot {\mathbf {P} }}&=-{\frac {\partial K}{\partial \mathbf {Q} }}&&=-\left({\frac {\partial H}{\partial \mathbf {Q} }}\right)_{\mathbf {Q} ,\mathbf {P} ,t}\\{\dot {\mathbf {Q} }}&=\,\,\,\,{\frac {\partial K}{\partial \mathbf {P} }}&&=\,\,\,\,\,\left({\frac {\partial H}{\partial \mathbf {P} }}\right)_{\mathbf {Q} ,\mathbf {P} ,t}\\\end{alignedat}}$
Although canonical transformations refers to a more general set of transformations of phase space corresponding with less permissive transformations of the Hamiltonian, it provides simpler conditions to obtain results that can be further generalized. All of the following conditions, with the exception of bilinear invariance condition, can be generalized for canonical transformations, including time dependance.

### Indirect conditions

Since restricted transformations have no explicit time dependence (by definition), the time derivative of a new generalized coordinate Q$_m$ is
${\begin{aligned}{\dot {Q}}_{m}&={\frac {\partial Q_{m}}{\partial \mathbf {q} }}\cdot {\dot {\mathbf {q} }}+{\frac {\partial Q_{m}}{\partial \mathbf {p} }}\cdot {\dot {\mathbf {p} }}\\&={\frac {\partial Q_{m}}{\partial \mathbf {q} }}\cdot {\frac {\partial H}{\partial \mathbf {p} }}-{\frac {\partial Q_{m}}{\partial \mathbf {p} }}\cdot {\frac {\partial H}{\partial \mathbf {q} }}\\&=\lbrace Q_{m},H\rbrace \end{aligned}}$ where {⋅, ⋅} is the Poisson bracket.
Similarly for the identity for the conjugate momentum, P$_m$ using the form of the "Kamiltonian" it follows that:
${\begin{aligned}{\frac {\partial K(\mathbf {Q} ,\mathbf {P} ,t)}{\partial P_{m}}}&={\frac {\partial K(\mathbf {Q} (\mathbf {q} ,\mathbf {p} ),\mathbf {P} (\mathbf {q} ,\mathbf {p} ),t)}{\partial \mathbf {q} }}\cdot {\frac {\partial \mathbf {q} }{\partial P_{m}}}+{\frac {\partial K(\mathbf {Q} (\mathbf {q} ,\mathbf {p} ),\mathbf {P} (\mathbf {q} ,\mathbf {p} ),t)}{\partial \mathbf {p} }}\cdot {\frac {\partial \mathbf {p} }{\partial P_{m}}}\\[1ex]&={\frac {\partial H(\mathbf {q} ,\mathbf {p} ,t)}{\partial \mathbf {q} }}\cdot {\frac {\partial \mathbf {q} }{\partial P_{m}}}+{\frac {\partial H(\mathbf {q} ,\mathbf {p} ,t)}{\partial \mathbf {p} }}\cdot {\frac {\partial \mathbf {p} }{\partial P_{m}}}\\[1ex]&={\frac {\partial H}{\partial \mathbf {q} }}\cdot {\frac {\partial \mathbf {q} }{\partial P_{m}}}+{\frac {\partial H}{\partial \mathbf {p} }}\cdot {\frac {\partial \mathbf {p} }{\partial P_{m}}}\end{aligned}}$
Due to the form of the Hamiltonian equations of motion,
${\begin{aligned}{\dot {\mathbf {P} }}&=-{\frac {\partial K}{\partial \mathbf {Q} }}\\{\dot {\mathbf {Q} }}&=\,\,\,\,{\frac {\partial K}{\partial \mathbf {P} }}\end{aligned}}$
if the transformation is canonical, the two derived results must be equal, resulting in the equations: ${\begin{aligned}\left({\frac {\partial Q_{m}}{\partial p_{n}}}\right)_{\mathbf {q} ,\mathbf {p} }&=-\left({\frac {\partial q_{n}}{\partial P_{m}}}\right)_{\mathbf {Q} ,\mathbf {P} }\\\left({\frac {\partial Q_{m}}{\partial q_{n}}}\right)_{\mathbf {q} ,\mathbf {p} }&=\left({\frac {\partial p_{n}}{\partial P_{m}}}\right)_{\mathbf {Q} ,\mathbf {P} }\end{aligned}}$
The analogous argument for the generalized momenta P$_m$ leads to two other sets of equations: ${\begin{aligned}\left({\frac {\partial P_{m}}{\partial p_{n}}}\right)_{\mathbf {q} ,\mathbf {p} }&=\left({\frac {\partial q_{n}}{\partial Q_{m}}}\right)_{\mathbf {Q} ,\mathbf {P} }\\\left({\frac {\partial P_{m}}{\partial q_{n}}}\right)_{\mathbf {q} ,\mathbf {p} }&=-\left({\frac {\partial p_{n}}{\partial Q_{m}}}\right)_{\mathbf {Q} ,\mathbf {P} }\end{aligned}}$
These are the indirect conditions to check whether a given transformation is canonical.

### Symplectic condition

Sometimes the Hamiltonian relations are represented as:
${\dot {\eta }}=J\nabla _{\eta }H$
Where J:=(0I$_n$−I$_n$0), {\textstyle J:={\begin{pmatrix}0&I_{n}\\-I_{n}&0\\\end{pmatrix}}, }
and η=[q$_1$⋮q$_n$p$_1$⋮p$_n$]{\textstyle \mathbf {\eta } ={\begin{bmatrix}q_{1}\\\vdots \\q_{n}\\p_{1}\\\vdots \\p_{n}\\\end{bmatrix}}}. Similarly, let ε=[Q$_1$⋮Q$_n$P$_1$⋮P$_n$]{\textstyle \mathbf {\varepsilon } ={\begin{bmatrix}Q_{1}\\\vdots \\Q_{n}\\P_{1}\\\vdots \\P_{n}\\\end{bmatrix}}}.
From the relation of partial derivatives, converting the ${\dot {\eta }}=J\nabla _{\eta }H$ relation in terms of partial derivatives with new variables gives ${\dot {\eta }}=J(M^{T}\nabla _{\varepsilon }H)$ where M:=∂(Q, P)/∂(q, p) {\textstyle M:={\frac {\partial (\mathbf {Q} , \mathbf {P} )}{\partial (\mathbf {q} , \mathbf {p} )}}}. Similarly for ε$^˙${\textstyle {\dot {\varepsilon }}},
${\dot {\varepsilon }}=M{\dot {\eta }}=MJM^{T}\nabla _{\varepsilon }H$
Due to form of the Hamiltonian equations for ε$^˙${\textstyle {\dot {\varepsilon }}},
${\dot {\varepsilon }}=J\nabla _{\varepsilon }K=J\nabla _{\varepsilon }H$
where ∇$_ε$K=∇$_ε$H{\textstyle \nabla _{\varepsilon }K=\nabla _{\varepsilon }H} can be used due to the form of Kamiltonian. Equating the two equations gives the symplectic condition as:
$MJM^{T}=J$The left hand side of the above is called the Poisson matrix of $\varepsilon$, denoted as P(ε)=MJM$^T${\textstyle {\mathcal {P}}(\varepsilon )=MJM^{T}}. Similarly, a Lagrange matrix of $\eta$ can be constructed as L(η)=M$^T$JM{\textstyle {\mathcal {L}}(\eta )=M^{T}JM}. It can be shown that the symplectic condition is also equivalent to M$^T$JM=J{\textstyle M^{T}JM=J} by using the J$^{−1}$=−J{\textstyle J^{-1}=-J} property. The set of all matrices M{\textstyle M} which satisfy symplectic conditions form a symplectic group. The symplectic conditions are equivalent with indirect conditions as they both lead to the equation ε$^˙$=J∇$_ε$H{\textstyle {\dot {\varepsilon }}=J\nabla _{\varepsilon }H}, which is used in both of the derivations.

### Invariance of the Poisson bracket

The Poisson bracket which is defined as:$\{u,v\}_{\eta }:=\sum _{i=1}^{n}\left({\frac {\partial u}{\partial q_{i}}}{\frac {\partial v}{\partial p_{i}}}-{\frac {\partial u}{\partial p_{i}}}{\frac {\partial v}{\partial q_{i}}}\right)$can be represented in matrix form as:$\{u,v\}_{\eta }:=(\nabla _{\eta }u)^{T}J(\nabla _{\eta }v)$Hence using partial derivative relations and symplectic condition gives:$\{u,v\}_{\eta }=(\nabla _{\eta }u)^{T}J(\nabla _{\eta }v)=(M^{T}\nabla _{\varepsilon }u)^{T}J(M^{T}\nabla _{\varepsilon }v)=(\nabla _{\varepsilon }u)^{T}MJM^{T}(\nabla _{\varepsilon }v)=(\nabla _{\varepsilon }u)^{T}J(\nabla _{\varepsilon }v)=\{u,v\}_{\varepsilon }$
The symplectic condition can also be recovered by taking u=ε$_i${\textstyle u=\varepsilon _{i}} and v=ε$_j${\textstyle v=\varepsilon _{j}} which shows that (MJM$^T$)$_{ij}$=J$_{ij}${\textstyle (MJM^{T})_{ij}=J_{ij}}. Thus these conditions are equivalent to symplectic conditions. Furthermore, it can be seen that P$_{ij}$(ε)={ε$_i$, ε$_j$}$_η$=(MJM$^T$)$_{ij}${\textstyle {\mathcal {P}}_{ij}(\varepsilon )=\{\varepsilon _{i}, \varepsilon _{j}\}_{\eta }=(MJM^{T})_{ij}}, which is also the result of explicitly calculating the matrix element by expanding it.

### Invariance of the Lagrange bracket

The Lagrange bracket which is defined as:
$[u,v]_{\eta }:=\sum _{i=1}^{n}\left({\frac {\partial q_{i}}{\partial u}}{\frac {\partial p_{i}}{\partial v}}-{\frac {\partial p_{i}}{\partial u}}{\frac {\partial q_{i}}{\partial v}}\right)$
can be represented in matrix form as:
$[u,v]_{\eta }:=\left({\frac {\partial \eta }{\partial u}}\right)^{T}J\left({\frac {\partial \eta }{\partial v}}\right)$
Using similar derivation, gives:
$[u,v]_{\varepsilon }=(\partial _{u}\varepsilon )^{T}\,J\,(\partial _{v}\varepsilon )=(M\,\partial _{u}\eta )^{T}\,J\,(M\,\partial _{v}\eta )=(\partial _{u}\eta )^{T}\,M^{T}JM\,(\partial _{v}\eta )=(\partial _{u}\eta )^{T}\,J\,(\partial _{v}\eta )=[u,v]_{\eta }$The symplectic condition can also be recovered by taking u=η$_i${\textstyle u=\eta _{i}} and v=η$_j${\textstyle v=\eta _{j}} which shows that (M$^T$JM)$_{ij}$=J$_{ij}${\textstyle (M^{T}JM)_{ij}=J_{ij}}. Thus these conditions are equivalent to symplectic conditions. Furthermore, it can be seen that L$_{ij}$(η)=[η$_i$, η$_j$]$_ε$=(M$^T$JM)$_{ij}${\textstyle {\mathcal {L}}_{ij}(\eta )=[\eta _{i}, \eta _{j}]_{\varepsilon }=(M^{T}JM)_{ij}}, which is also the result of explicitly calculating the matrix element by expanding it.

### Bilinear invariance conditions

These set of conditions only apply to restricted canonical transformations or canonical transformations that are independent of time variable.
Consider arbitrary variations of two kinds, in a single pair of generalized coordinate and the corresponding momentum:
dε=(dq$_1$, dp$_1$, 0, 0, …), δε=(δq$_1$, δp$_1$, 0, 0, …).{\textstyle d\varepsilon =(dq_{1}, dp_{1}, 0, 0, \ldots ), \quad \delta \varepsilon =(\delta q_{1}, \delta p_{1}, 0, 0, \ldots ).}
The area of the infinitesimal parallelogram is given by:
δa(12)=dq$_1$δp$_1$−δq$_1$dp$_1$=(δε)$^T$Jdε.{\textstyle \delta a(12)=dq_{1}\delta p_{1}-\delta q_{1}dp_{1}={(\delta \varepsilon )}^{T}\, J\, d\varepsilon .}
It follows from the M$^T$JM=J{\textstyle M^{T}JM=J} symplectic condition that the infinitesimal area is conserved under canonical transformation:
δa(12)=(δε)$^T$Jdε=(Mδη)$^T$JMdη=(δη)$^T$M$^T$JMdη=(δη)$^T$Jdη=δA(12).{\textstyle \delta a(12)={(\delta \varepsilon )}^{T}\, J\, d\varepsilon ={(M\delta \eta )}^{T}\, J\, Md\eta ={(\delta \eta )}^{T}\, M^{T}JM\, d\eta ={(\delta \eta )}^{T}\, J\, d\eta =\delta A(12).}
Note that the new coordinates need not be completely oriented in one coordinate momentum plane.
Hence, the condition is more generally stated as an invariance of the form (dε)$^T$Jδε{\textstyle {(d\varepsilon )}^{T}\, J\, \delta \varepsilon } under canonical transformation, expanded as:$\sum \delta q\cdot dp-\delta p\cdot dq=\sum \delta Q\cdot dP-\delta P\cdot dQ$If the above is obeyed for any arbitrary variations, it would be only possible if the indirect conditions are met. The form of the equation, v$^T$Jw{\textstyle {v}^{T}\, J\, w} is also known as a symplectic product of the vectors v{\textstyle {v}} and w{\textstyle w} and the bilinear invariance condition can be stated as a local conservation of the symplectic product.

## Liouville's theorem

The indirect conditions allow us to prove Liouville's theorem, which states that the volume in phase space is conserved under canonical transformations, i.e., $\int \mathrm {d} \mathbf {q} \,\mathrm {d} \mathbf {p} =\int \mathrm {d} \mathbf {Q} \,\mathrm {d} \mathbf {P}$
By calculus, the latter integral must equal the former times the determinant of Jacobian M$\int \mathrm {d} \mathbf {Q} \,\mathrm {d} \mathbf {P} =\int \det(M)\,\mathrm {d} \mathbf {q} \,\mathrm {d} \mathbf {p}$Where M:=∂(Q, P)/∂(q, p) {\textstyle M:={\frac {\partial (\mathbf {Q} , \mathbf {P} )}{\partial (\mathbf {q} , \mathbf {p} )}}}
Exploiting the "division" property of Jacobians yields$M\equiv {\frac {\partial (\mathbf {Q} ,\mathbf {P} )}{\partial (\mathbf {q} ,\mathbf {P} )}}\left/{\frac {\partial (\mathbf {q} ,\mathbf {p} )}{\partial (\mathbf {q} ,\mathbf {P} )}}\right.$
Eliminating the repeated variables gives$M\equiv {\frac {\partial (\mathbf {Q} )}{\partial (\mathbf {q} )}}\left/{\frac {\partial (\mathbf {p} )}{\partial (\mathbf {P} )}}\right.$
Application of the indirect conditions above yields $\operatorname {det} (M)=1$.

## Generating function approach

To guarantee a valid transformation between (q, p, H) and (Q, P, K), we may resort to a direct generating function approach. Both sets of variables must obey Hamilton's principle. That is the action integral over the Lagrangians ${\mathcal {L}}_{qp}=\mathbf {p} \cdot {\dot {\mathbf {q} }}-H(\mathbf {q} ,\mathbf {p} ,t)$ and ${\mathcal {L}}_{QP}=\mathbf {P} \cdot {\dot {\mathbf {Q} }}-K(\mathbf {Q} ,\mathbf {P} ,t)$, obtained from the respective Hamiltonian via an "inverse" Legendre transformation, must be stationary in both cases (so that one can use the Euler–Lagrange equations to arrive at Hamiltonian equations of motion of the designated form; as it is shown for example here): ${\begin{aligned}\delta \int _{t_{1}}^{t_{2}}\left[\mathbf {p} \cdot {\dot {\mathbf {q} }}-H(\mathbf {q} ,\mathbf {p} ,t)\right]dt&=0\\\delta \int _{t_{1}}^{t_{2}}\left[\mathbf {P} \cdot {\dot {\mathbf {Q} }}-K(\mathbf {Q} ,\mathbf {P} ,t)\right]dt&=0\end{aligned}}$
One way for both variational integral equalities to be satisfied is to have $\lambda \left[\mathbf {p} \cdot {\dot {\mathbf {q} }}-H(\mathbf {q} ,\mathbf {p} ,t)\right]=\mathbf {P} \cdot {\dot {\mathbf {Q} }}-K(\mathbf {Q} ,\mathbf {P} ,t)+{\frac {dG}{dt}}$
Lagrangians are not unique: one can always multiply by a constant λ and add a total time derivative ⁠dG/dt⁠ and yield the same equations of motion (as discussed on Wikibooks). In general, the scaling factor λ is set equal to one; canonical transformations for which λ ≠ 1 are called extended canonical transformations. ⁠dG/dt⁠ is kept, otherwise the problem would be rendered trivial and there would be not much freedom for the new canonical variables to differ from the old ones.
Here G is a generating function of one old canonical coordinate (q or p), one new canonical coordinate (Q or P) and (possibly) the time t. Thus, there are four basic types of generating functions (although mixtures of these four types can exist), depending on the choice of variables. As will be shown below, the generating function will define a transformation from old to new canonical coordinates, and any such transformation (q, p) → (Q, P) is guaranteed to be canonical.
The various generating functions and its properties tabulated below is discussed in detail:
Properties of four basic canonical transformations :
| Generating function | Generating function derivatives | Generating function derivatives | Transformed Hamiltonian | Trivial cases | Trivial cases | Trivial cases |
| $G=G_{1}(q,Q,t)$ | $p={\frac {\partial G_{1}}{\partial q}}$ | $P=-{\frac {\partial G_{1}}{\partial Q}}$ | K=H+∂G/∂t {\textstyle K=H+{\frac {\partial G}{\partial t}}} | $G_{1}=qQ$ | $Q=p$ | $P=-q$ |
| $G=G_{2}(q,P,t)-QP$ | $p={\frac {\partial G_{2}}{\partial q}}$ | $Q={\frac {\partial G_{2}}{\partial P}}$ | K=H+∂G/∂t {\textstyle K=H+{\frac {\partial G}{\partial t}}} | $G_{2}=qP$ | $Q=q$ | $P=p$ |
| $G=G_{3}(p,Q,t)+qp$ | $q=-{\frac {\partial G_{3}}{\partial p}}$ | $P=-{\frac {\partial G_{3}}{\partial Q}}$ | K=H+∂G/∂t {\textstyle K=H+{\frac {\partial G}{\partial t}}} | $G_{3}=pQ$ | $Q=-q$ | $P=-p$ |
| $G=G_{4}(p,P,t)+qp-QP$ | $q=-{\frac {\partial G_{4}}{\partial p}}$ | $Q={\frac {\partial G_{4}}{\partial P}}$ | K=H+∂G/∂t {\textstyle K=H+{\frac {\partial G}{\partial t}}} | $G_{4}=pP$ | $Q=p$ | $P=-q$ |

### Type 1 generating function

The type 1 generating function G$_1$ depends only on the old and new generalized coordinates $G\equiv G_{1}(\mathbf {q} ,\mathbf {Q} ,t)$ To derive the implicit transformation, we expand the defining equation above $\mathbf {p} \cdot {\dot {\mathbf {q} }}-H(\mathbf {q} ,\mathbf {p} ,t)=\mathbf {P} \cdot {\dot {\mathbf {Q} }}-K(\mathbf {Q} ,\mathbf {P} ,t)+{\frac {\partial G_{1}}{\partial t}}+{\frac {\partial G_{1}}{\partial \mathbf {q} }}\cdot {\dot {\mathbf {q} }}+{\frac {\partial G_{1}}{\partial \mathbf {Q} }}\cdot {\dot {\mathbf {Q} }}$
Since the new and old coordinates are each independent, the following 2N + 1 equations must hold ${\begin{aligned}\mathbf {p} &={\frac {\partial G_{1}}{\partial \mathbf {q} }}\\\mathbf {P} &=-{\frac {\partial G_{1}}{\partial \mathbf {Q} }}\\K&=H+{\frac {\partial G_{1}}{\partial t}}\end{aligned}}$
These equations define the transformation (q, p) → (Q, P) as follows: The first set of N equations $\ \mathbf {p} ={\frac {\ \partial G_{1}\ }{\partial \mathbf {q} }}\$ define relations between the new generalized coordinates Q and the old canonical coordinates (q, p). Ideally, one can invert these relations to obtain formulae for each Q$_k$ as a function of the old canonical coordinates. Substitution of these formulae for the Q coordinates into the second set of N equations $\mathbf {P} =-{\frac {\partial G_{1}}{\partial \mathbf {Q} }}$ yields analogous formulae for the new generalized momenta P in terms of the old canonical coordinates (q, p). We then invert both sets of formulae to obtain the old canonical coordinates (q, p) as functions of the new canonical coordinates (Q, P). Substitution of the inverted formulae into the final equation $K=H+{\frac {\partial G_{1}}{\partial t}}$ yields a formula for K as a function of the new canonical coordinates (Q, P).
In practice, this procedure is easier than it sounds, because the generating function is usually simple. For example, let $G_{1}\equiv \mathbf {q} \cdot \mathbf {Q}$ This results in swapping the generalized coordinates for the momenta and vice versa ${\begin{aligned}\mathbf {p} &={\frac {\partial G_{1}}{\partial \mathbf {q} }}=\mathbf {Q} \\\mathbf {P} &=-{\frac {\partial G_{1}}{\partial \mathbf {Q} }}=-\mathbf {q} \end{aligned}}$ and K = H. This example illustrates how independent the coordinates and momenta are in the Hamiltonian formulation; they are equivalent variables.

### Type 2 generating function

The type 2 generating function $G_{2}(\mathbf {q} ,\mathbf {P} ,t)$ depends only on the old generalized coordinates and the new generalized momenta $G\equiv G_{2}(\mathbf {q} ,\mathbf {P} ,t)-\mathbf {Q} \cdot \mathbf {P}$ where the $-\mathbf {Q} \cdot \mathbf {P}$ terms represent a Legendre transformation to change the right-hand side of the equation below. To derive the implicit transformation, we expand the defining equation above $\mathbf {p} \cdot {\dot {\mathbf {q} }}-H(\mathbf {q} ,\mathbf {p} ,t)=-\mathbf {Q} \cdot {\dot {\mathbf {P} }}-K(\mathbf {Q} ,\mathbf {P} ,t)+{\frac {\partial G_{2}}{\partial t}}+{\frac {\partial G_{2}}{\partial \mathbf {q} }}\cdot {\dot {\mathbf {q} }}+{\frac {\partial G_{2}}{\partial \mathbf {P} }}\cdot {\dot {\mathbf {P} }}$
Since the old coordinates and new momenta are each independent, the following 2N + 1 equations must hold ${\begin{aligned}\mathbf {p} &={\frac {\partial G_{2}}{\partial \mathbf {q} }}\\\mathbf {Q} &={\frac {\partial G_{2}}{\partial \mathbf {P} }}\\K&=H+{\frac {\partial G_{2}}{\partial t}}\end{aligned}}$
These equations define the transformation (q, p) → (Q, P) as follows: The first set of N equations $\mathbf {p} ={\frac {\partial G_{2}}{\partial \mathbf {q} }}$ define relations between the new generalized momenta P and the old canonical coordinates (q, p). Ideally, one can invert these relations to obtain formulae for each P$_k$ as a function of the old canonical coordinates. Substitution of these formulae for the P coordinates into the second set of N equations $\mathbf {Q} ={\frac {\partial G_{2}}{\partial \mathbf {P} }}$ yields analogous formulae for the new generalized coordinates Q in terms of the old canonical coordinates (q, p). We then invert both sets of formulae to obtain the old canonical coordinates (q, p) as functions of the new canonical coordinates (Q, P). Substitution of the inverted formulae into the final equation $K=H+{\frac {\partial G_{2}}{\partial t}}$ yields a formula for K as a function of the new canonical coordinates (Q, P).
In practice, this procedure is easier than it sounds, because the generating function is usually simple. For example, let $G_{2}\equiv \mathbf {g} (\mathbf {q} ;t)\cdot \mathbf {P}$ where g is a set of N functions. This results in a point transformation of the generalized coordinates $\mathbf {Q} ={\frac {\partial G_{2}}{\partial \mathbf {P} }}=\mathbf {g} (\mathbf {q} ;t)$

### Type 3 generating function

The type 3 generating function $G_{3}(\mathbf {p} ,\mathbf {Q} ,t)$ depends only on the old generalized momenta and the new generalized coordinates $G\equiv G_{3}(\mathbf {p} ,\mathbf {Q} ,t)+\mathbf {q} \cdot \mathbf {p}$ where the $\mathbf {q} \cdot \mathbf {p}$ terms represent a Legendre transformation to change the left-hand side of the equation below. To derive the implicit transformation, we expand the defining equation above $-\mathbf {q} \cdot {\dot {\mathbf {p} }}-H(\mathbf {q} ,\mathbf {p} ,t)=\mathbf {P} \cdot {\dot {\mathbf {Q} }}-K(\mathbf {Q} ,\mathbf {P} ,t)+{\frac {\partial G_{3}}{\partial t}}+{\frac {\partial G_{3}}{\partial \mathbf {p} }}\cdot {\dot {\mathbf {p} }}+{\frac {\partial G_{3}}{\partial \mathbf {Q} }}\cdot {\dot {\mathbf {Q} }}$
Since the new and old coordinates are each independent, the following 2N + 1 equations must hold ${\begin{aligned}\mathbf {q} &=-{\frac {\partial G_{3}}{\partial \mathbf {p} }}\\\mathbf {P} &=-{\frac {\partial G_{3}}{\partial \mathbf {Q} }}\\K&=H+{\frac {\partial G_{3}}{\partial t}}\end{aligned}}$
These equations define the transformation (q, p) → (Q, P) as follows: The first set of N equations $\mathbf {q} =-{\frac {\partial G_{3}}{\partial \mathbf {p} }}$ define relations between the new generalized coordinates Q and the old canonical coordinates (q, p). Ideally, one can invert these relations to obtain formulae for each Q$_k$ as a function of the old canonical coordinates. Substitution of these formulae for the Q coordinates into the second set of N equations $\mathbf {P} =-{\frac {\partial G_{3}}{\partial \mathbf {Q} }}$ yields analogous formulae for the new generalized momenta P in terms of the old canonical coordinates (q, p). We then invert both sets of formulae to obtain the old canonical coordinates (q, p) as functions of the new canonical coordinates (Q, P). Substitution of the inverted formulae into the final equation $K=H+{\frac {\partial G_{3}}{\partial t}}$ yields a formula for K as a function of the new canonical coordinates (Q, P).
In practice, this procedure is easier than it sounds, because the generating function is usually simple.

### Type 4 generating function

The type 4 generating function $G_{4}(\mathbf {p} ,\mathbf {P} ,t)$ depends only on the old and new generalized momenta $G\equiv G_{4}(\mathbf {p} ,\mathbf {P} ,t)+\mathbf {q} \cdot \mathbf {p} -\mathbf {Q} \cdot \mathbf {P}$ where the $\mathbf {q} \cdot \mathbf {p} -\mathbf {Q} \cdot \mathbf {P}$ terms represent a Legendre transformation to change both sides of the equation below. To derive the implicit transformation, we expand the defining equation above $-\mathbf {q} \cdot {\dot {\mathbf {p} }}-H(\mathbf {q} ,\mathbf {p} ,t)=-\mathbf {Q} \cdot {\dot {\mathbf {P} }}-K(\mathbf {Q} ,\mathbf {P} ,t)+{\frac {\partial G_{4}}{\partial t}}+{\frac {\partial G_{4}}{\partial \mathbf {p} }}\cdot {\dot {\mathbf {p} }}+{\frac {\partial G_{4}}{\partial \mathbf {P} }}\cdot {\dot {\mathbf {P} }}$
Since the new and old coordinates are each independent, the following 2N + 1 equations must hold ${\begin{aligned}\mathbf {q} &=-{\frac {\partial G_{4}}{\partial \mathbf {p} }}\\\mathbf {Q} &={\frac {\partial G_{4}}{\partial \mathbf {P} }}\\K&=H+{\frac {\partial G_{4}}{\partial t}}\end{aligned}}$
These equations define the transformation (q, p) → (Q, P) as follows: The first set of N equations $\mathbf {q} =-{\frac {\partial G_{4}}{\partial \mathbf {p} }}$ define relations between the new generalized momenta P and the old canonical coordinates (q, p). Ideally, one can invert these relations to obtain formulae for each P$_k$ as a function of the old canonical coordinates. Substitution of these formulae for the P coordinates into the second set of N equations $\mathbf {Q} ={\frac {\partial G_{4}}{\partial \mathbf {P} }}$ yields analogous formulae for the new generalized coordinates Q in terms of the old canonical coordinates (q, p). We then invert both sets of formulae to obtain the old canonical coordinates (q, p) as functions of the new canonical coordinates (Q, P). Substitution of the inverted formulae into the final equation $K=H+{\frac {\partial G_{4}}{\partial t}}$ yields a formula for K as a function of the new canonical coordinates (Q, P).

### Limitations on the four types of generating functions

Considering $G_{2}(\mathbf {q} ,\mathbf {P} ,t)$ as an example, using generating function of second kind: p$_i$=∂G$_2$/∂q$_i$ {\textstyle {p}_{i}={\frac {\partial G_{2}}{\partial {q}_{i}}}} and Q$_i$=∂G$_2$/∂P$_i$ {\textstyle {Q}_{i}={\frac {\partial G_{2}}{\partial {P}_{i}}}}, the first set of equations consisting of variables p{\textstyle \mathbf {p} }, q{\textstyle \mathbf {q} } and P{\textstyle \mathbf {P} } has to be inverted to get P(q, p){\textstyle \mathbf {P} (\mathbf {q} , \mathbf {p} )}. This process is possible when the matrix defined by a$_{ij}$=∂p$_i$(q, P)/∂P$_j$ {\textstyle a_{ij}={\frac {\partial {p}_{i}(\mathbf {q} , \mathbf {P} )}{\partial P_{j}}}} is non-singular using the inverse function theorem, and can be restated as the following relation.
$\left|{\begin{array}{l l l}{\displaystyle {\frac {\partial ^{2}G_{2}}{\partial P_{1}\partial q_{1}}}}&{\cdots }&{\displaystyle {\frac {\partial ^{2}G_{2}}{\partial P_{1}\partial q_{n}}}}\\{\quad \vdots }&{\ddots }&{\quad \vdots }\\{\displaystyle {\frac {\partial ^{2}G_{2}}{\partial P_{n}\partial q_{1}}}}&{\cdots }&{\displaystyle {\frac {\partial ^{2}G_{2}}{\partial P_{n}\partial q_{n}}}}\end{array}}\right|{\neq 0}$
Hence, restrictions are placed on generating functions to have the matrices: [∂$^2$G$_1$/∂Q$_j$∂q$_i$]{\textstyle \left[{\frac {\partial ^{2}G_{1}}{\partial Q_{j}\partial q_{i}}}\right]}, [∂$^2$G$_2$/∂P$_j$∂q$_i$]{\textstyle \left[{\frac {\partial ^{2}G_{2}}{\partial P_{j}\partial q_{i}}}\right]}, [∂$^2$G$_3$/∂p$_j$∂Q$_i$]{\textstyle \left[{\frac {\partial ^{2}G_{3}}{\partial p_{j}\partial Q_{i}}}\right]} and [∂$^2$G$_4$/∂p$_j$∂P$_i$]{\textstyle \left[{\frac {\partial ^{2}G_{4}}{\partial p_{j}\partial P_{i}}}\right]}, being non-singular. These conditions also correspond to local invertibility of the coordinates. From these restrictions, it can be stated that type 1 and type 4 generating functions always have a non-singular [∂Q$_i$(q, p)/∂p$_j$]{\textstyle \left[{\frac {\partial Q_{i}(\mathbf {q} , \mathbf {p} )}{\partial p_{j}}}\right]} matrix whereas type 2 and type 3 generating functions always have a non-singular [∂P$_i$(q, p)/∂p$_j$]{\textstyle \left[{\frac {\partial P_{i}(\mathbf {q} , \mathbf {p} )}{\partial p_{j}}}\right]} matrix. Hence, the canonical transformations resulting from these four generating functions alone are not completely general.

### Generalized use of generating functions

In other words, since (Q, P) and (q, p) are each 2N independent functions, it follows that to have generating function of the form G$_1$(q, Q, t){\textstyle G_{1}(\mathbf {q} , \mathbf {Q} , t)} and $G_{4}(\mathbf {p} ,\mathbf {P} ,t)$ or $G_{2}(\mathbf {q} ,\mathbf {P} ,t)$ and $G_{3}(\mathbf {p} ,\mathbf {Q} ,t)$, the corresponding Jacobian matrices [∂Q$_i$/∂p$_j$]{\textstyle \left[{\frac {\partial Q_{i}}{\partial p_{j}}}\right]} and [∂P$_i$/∂p$_j$]{\textstyle \left[{\frac {\partial P_{i}}{\partial p_{j}}}\right]} are restricted to be non singular, ensuring that the generating function is a function of 2N + 1 independent variables. However, as a feature of canonical transformations, it is always possible to choose 2N such independent functions from sets (q, p) or (Q, P), to form a generating function representation of canonical transformations, including the time variable. Hence, it can be proven that every finite canonical transformation can be given as a closed but implicit form that is a variant of the given four simple forms.

## Canonical transformation conditions
### Canonical transformation relations

From: $K=H+{\frac {\partial G}{\partial t}}$, calculate ∂(K−H)/∂P {\textstyle {\frac {\partial (K-H)}{\partial P}}}:
${\begin{aligned}\left({\frac {\partial (K-H)}{\partial P}}\right)_{Q,P,t}&={\frac {\partial K}{\partial P}}-{\frac {\partial H}{\partial p}}{\frac {\partial p}{\partial P}}-{\frac {\partial H}{\partial q}}{\frac {\partial q}{\partial P}}-{\frac {\partial H}{\partial t}}\left({\frac {\partial t}{\partial P}}\right)_{Q,P,t}\\&={\dot {Q}}+{\dot {p}}{\frac {\partial q}{\partial P}}-{\dot {q}}{\frac {\partial p}{\partial P}}\\&={\frac {\partial Q}{\partial t}}+{\frac {\partial Q}{\partial q}}\cdot {\dot {q}}+{\frac {\partial Q}{\partial p}}\cdot {\dot {p}}+{\dot {p}}{\frac {\partial q}{\partial P}}-{\dot {q}}{\frac {\partial p}{\partial P}}\\&={\dot {q}}\left({\frac {\partial Q}{\partial q}}-{\frac {\partial p}{\partial P}}\right)+{\dot {p}}\left({\frac {\partial q}{\partial P}}+{\frac {\partial Q}{\partial p}}\right)+{\frac {\partial Q}{\partial t}}\end{aligned}}$
Since the left hand side is ∂(K−H)/∂P=∂/∂P (∂G/∂t)|$_{Q, P, t}${\textstyle {\frac {\partial (K-H)}{\partial P}}={\frac {\partial }{\partial P}}\left({\frac {\partial G}{\partial t}}\right){\bigg |}_{Q, P, t}} which is independent of dynamics of the particles, equating coefficients of q$^˙${\textstyle {\dot {q}}} and p$^˙${\textstyle {\dot {p}}} to zero, canonical transformation rules are obtained. This step is equivalent to equating the left hand side as ∂(K−H)/∂P=∂Q/∂t {\textstyle {\frac {\partial (K-H)}{\partial P}}={\frac {\partial Q}{\partial t}}}.
Similarly:
${\begin{aligned}\left({\frac {\partial (K-H)}{\partial Q}}\right)_{Q,P,t}&={\frac {\partial K}{\partial Q}}-{\frac {\partial H}{\partial p}}{\frac {\partial p}{\partial Q}}-{\frac {\partial H}{\partial q}}{\frac {\partial q}{\partial Q}}-{\frac {\partial H}{\partial t}}\left({\frac {\partial t}{\partial Q}}\right)_{Q,P,t}\\&=-{\dot {P}}+{\dot {p}}{\frac {\partial q}{\partial Q}}-{\dot {q}}{\frac {\partial p}{\partial Q}}\\&=-{\frac {\partial P}{\partial t}}-{\frac {\partial P}{\partial q}}\cdot {\dot {q}}-{\frac {\partial P}{\partial p}}\cdot {\dot {p}}+{\dot {p}}{\frac {\partial q}{\partial Q}}-{\dot {q}}{\frac {\partial p}{\partial Q}}\\&=-\left({\dot {q}}\left({\frac {\partial P}{\partial q}}+{\frac {\partial p}{\partial Q}}\right)+{\dot {p}}\left({\frac {\partial P}{\partial p}}-{\frac {\partial q}{\partial Q}}\right)+{\frac {\partial P}{\partial t}}\right)\end{aligned}}$Similarly the canonical transformation rules are obtained by equating the left hand side as ∂(K−H)/∂Q=−∂P/∂t {\textstyle {\frac {\partial (K-H)}{\partial Q}}=-{\frac {\partial P}{\partial t}}}.
The above two relations can be combined in matrix form as: J(∇$_ε$ ∂G/∂t )=∂ε/∂t {\textstyle J\left(\nabla _{\varepsilon }{\frac {\partial G}{\partial t}}\right)={\frac {\partial \varepsilon }{\partial t}}} (which will also retain same form for extended canonical transformation) where the result ∂G/∂t=K−H{\textstyle {\frac {\partial G}{\partial t}}=K-H}, has been used. The canonical transformation relations are hence said to be equivalent to J(∇$_ε$ ∂G/∂t )=∂ε/∂t {\textstyle J\left(\nabla _{\varepsilon }{\frac {\partial G}{\partial t}}\right)={\frac {\partial \varepsilon }{\partial t}}} in this context.
The canonical transformation relations can now be restated to include time dependance:${\begin{aligned}\left({\frac {\partial Q_{m}}{\partial p_{n}}}\right)_{\mathbf {q} ,\mathbf {p} ,t}&=-\left({\frac {\partial q_{n}}{\partial P_{m}}}\right)_{\mathbf {Q} ,\mathbf {P} ,t}\\\left({\frac {\partial Q_{m}}{\partial q_{n}}}\right)_{\mathbf {q} ,\mathbf {p} ,t}&=\left({\frac {\partial p_{n}}{\partial P_{m}}}\right)_{\mathbf {Q} ,\mathbf {P} ,t}\end{aligned}}$${\begin{aligned}\left({\frac {\partial P_{m}}{\partial p_{n}}}\right)_{\mathbf {q} ,\mathbf {p} ,t}&=\left({\frac {\partial q_{n}}{\partial Q_{m}}}\right)_{\mathbf {Q} ,\mathbf {P} ,t}\\\left({\frac {\partial P_{m}}{\partial q_{n}}}\right)_{\mathbf {q} ,\mathbf {p} ,t}&=-\left({\frac {\partial p_{n}}{\partial Q_{m}}}\right)_{\mathbf {Q} ,\mathbf {P} ,t}\end{aligned}}$Since ∂(K−H)/∂P=∂Q/∂t {\textstyle {\frac {\partial (K-H)}{\partial P}}={\frac {\partial Q}{\partial t}}} and ∂(K−H)/∂Q=−∂P/∂t {\textstyle {\frac {\partial (K-H)}{\partial Q}}=-{\frac {\partial P}{\partial t}}}, if Q and P do not explicitly depend on time, K=H+∂G/∂t (t){\textstyle K=H+{\frac {\partial G}{\partial t}}(t)} can be taken. The analysis of restricted canonical transformations is hence consistent with this generalization.

### Symplectic condition

Applying transformation of co-ordinates formula for $\nabla _{\eta }H=M^{T}\nabla _{\varepsilon }H$, in Hamiltonian's equations gives:${\dot {\eta }}=J\nabla _{\eta }H=J(M^{T}\nabla _{\varepsilon }H)$
Similarly for ε$^˙${\textstyle {\dot {\varepsilon }}}:${\dot {\varepsilon }}=M{\dot {\eta }}+{\frac {\partial \varepsilon }{\partial t}}=MJM^{T}\nabla _{\varepsilon }H+{\frac {\partial \varepsilon }{\partial t}}$or:${\dot {\varepsilon }}=J\nabla _{\varepsilon }K=J\nabla _{\varepsilon }H+J\nabla _{\varepsilon }\left({\frac {\partial G}{\partial t}}\right)$Where the last terms of each equation cancel due to J(∇$_ε$ ∂G/∂t )=∂ε/∂t {\textstyle J\left(\nabla _{\varepsilon }{\frac {\partial G}{\partial t}}\right)={\frac {\partial \varepsilon }{\partial t}}} condition from canonical transformations. Hence leaving the symplectic relation: MJM$^T$=J{\textstyle MJM^{T}=J} which is also equivalent with the condition M$^T$JM=J{\textstyle M^{T}JM=J}. It follows from the above two equations that the symplectic condition implies the equation J(∇$_ε$ ∂G/∂t )=∂ε/∂t {\textstyle J\left(\nabla _{\varepsilon }{\frac {\partial G}{\partial t}}\right)={\frac {\partial \varepsilon }{\partial t}}}, from which the indirect conditions can be recovered. Thus, symplectic conditions and indirect conditions can be said to be equivalent in the context of using generating functions.

### Invariance of the Poisson and Lagrange brackets

Since P$_{ij}$(ε)={ε$_i$, ε$_j$}$_η$=(MJM$^T$)$_{ij}$=J$_{ij}${\textstyle {\mathcal {P}}_{ij}(\varepsilon )=\{\varepsilon _{i}, \varepsilon _{j}\}_{\eta }=(MJM^{T})_{ij}=J_{ij}} and L$_{ij}$(η)=[η$_i$, η$_j$]$_ε$=(M$^T$JM)$_{ij}$=J$_{ij}${\textstyle {\mathcal {L}}_{ij}(\eta )=[\eta _{i}, \eta _{j}]_{\varepsilon }=(M^{T}JM)_{ij}=J_{ij}} where the symplectic condition is used in the last equalities. Using {ε$_i$, ε$_j$}$_ε$=[η$_i$, η$_j$]$_η$=J$_{ij}${\textstyle \{\varepsilon _{i}, \varepsilon _{j}\}_{\varepsilon }=[\eta _{i}, \eta _{j}]_{\eta }=J_{ij}}, the equalities {ε$_i$, ε$_j$}$_η$={ε$_i$, ε$_j$}$_ε${\textstyle \{\varepsilon _{i}, \varepsilon _{j}\}_{\eta }=\{\varepsilon _{i}, \varepsilon _{j}\}_{\varepsilon }} and [η$_i$, η$_j$]$_ε$=[η$_i$, η$_j$]$_η${\textstyle [\eta _{i}, \eta _{j}]_{\varepsilon }=[\eta _{i}, \eta _{j}]_{\eta }} are obtained which imply the invariance of Poisson and Lagrange brackets.

## Extended canonical transformation
### Canonical transformation relations

By solving for:$\lambda \left[\mathbf {p} \cdot {\dot {\mathbf {q} }}-H(\mathbf {q} ,\mathbf {p} ,t)\right]=\mathbf {P} \cdot {\dot {\mathbf {Q} }}-K(\mathbf {Q} ,\mathbf {P} ,t)+{\frac {dG}{dt}}$with various forms of generating function, the relation between K and H goes as ∂G/∂t=K−λH{\textstyle {\frac {\partial G}{\partial t}}=K-\lambda H} instead, which also applies for λ=1{\textstyle \lambda =1} case.
All results presented below can also be obtained by replacing q→√λq{\textstyle q\rightarrow {\sqrt {\lambda }}q}, p→√λp{\textstyle p\rightarrow {\sqrt {\lambda }}p} and H→λH{\textstyle H\rightarrow {\lambda }H} from known solutions, since it retains the form of Hamilton's equations. The extended canonical transformations are hence said to be result of a canonical transformation (λ=1{\textstyle \lambda =1}) and a trivial canonical transformation (λ≠1{\textstyle \lambda \neq 1}) which has MJM$^T$=λJ{\textstyle MJM^{T}=\lambda J} (for the given example, M=√λI{\textstyle M={\sqrt {\lambda }}I} which satisfies the condition).
Using same steps previously used in previous generalization, with ∂G/∂t=K−λH{\textstyle {\frac {\partial G}{\partial t}}=K-\lambda H} in the general case, and retaining the equation J(∇$_ε$ ∂g/∂t )=∂ε/∂t {\textstyle J\left(\nabla _{\varepsilon }{\frac {\partial g}{\partial t}}\right)={\frac {\partial \varepsilon }{\partial t}}}, extended canonical transformation partial differential relations are obtained as:${\begin{aligned}\left({\frac {\partial Q_{m}}{\partial p_{n}}}\right)_{\mathbf {q} ,\mathbf {p} ,t}&=-\lambda \left({\frac {\partial q_{n}}{\partial P_{m}}}\right)_{\mathbf {Q} ,\mathbf {P} ,t}\\\left({\frac {\partial Q_{m}}{\partial q_{n}}}\right)_{\mathbf {q} ,\mathbf {p} ,t}&=\lambda \left({\frac {\partial p_{n}}{\partial P_{m}}}\right)_{\mathbf {Q} ,\mathbf {P} ,t}\end{aligned}}$${\begin{aligned}\left({\frac {\partial P_{m}}{\partial p_{n}}}\right)_{\mathbf {q} ,\mathbf {p} ,t}&=\lambda \left({\frac {\partial q_{n}}{\partial Q_{m}}}\right)_{\mathbf {Q} ,\mathbf {P} ,t}\\\left({\frac {\partial P_{m}}{\partial q_{n}}}\right)_{\mathbf {q} ,\mathbf {p} ,t}&=-\lambda \left({\frac {\partial p_{n}}{\partial Q_{m}}}\right)_{\mathbf {Q} ,\mathbf {P} ,t}\end{aligned}}$

### Symplectic condition

Following the same steps to derive the symplectic conditions, as: ${\dot {\eta }}=J\nabla _{\eta }H=J(M^{T}\nabla _{\varepsilon }H)$and ${\dot {\varepsilon }}=M{\dot {\eta }}+{\frac {\partial \varepsilon }{\partial t}}=MJM^{T}\nabla _{\varepsilon }H+{\frac {\partial \varepsilon }{\partial t}}$
where using ∂G/∂t=K−λH{\textstyle {\frac {\partial G}{\partial t}}=K-\lambda H} instead gives:${\dot {\varepsilon }}=J\nabla _{\varepsilon }K=\lambda J\nabla _{\varepsilon }H+J\nabla _{\varepsilon }\left({\frac {\partial G}{\partial t}}\right)$The second part of each equation cancel. Hence the condition for extended canonical transformation instead becomes: MJM$^T$=λJ{\textstyle MJM^{T}=\lambda J}.

### Poisson and Lagrange brackets

The Poisson brackets are changed as follows:$\{u,v\}_{\eta }=(\nabla _{\eta }u)^{T}J(\nabla _{\eta }v)=(M^{T}\nabla _{\varepsilon }u)^{T}J(M^{T}\nabla _{\varepsilon }v)=(\nabla _{\varepsilon }u)^{T}MJM^{T}(\nabla _{\varepsilon }v)=\lambda (\nabla _{\varepsilon }u)^{T}J(\nabla _{\varepsilon }v)=\lambda \{u,v\}_{\varepsilon }$whereas, the Lagrange brackets are changed as:
$[u,v]_{\varepsilon }=(\partial _{u}\varepsilon )^{T}\,J\,(\partial _{v}\varepsilon )=(M\,\partial _{u}\eta )^{T}\,J\,(M\,\partial _{v}\eta )=(\partial _{u}\eta )^{T}\,M^{T}JM\,(\partial _{v}\eta )=\lambda (\partial _{u}\eta )^{T}\,J\,(\partial _{v}\eta )=\lambda [u,v]_{\eta }$ Hence, the Poisson bracket scales by the inverse of λ{\textstyle \lambda } whereas the Lagrange bracket scales by a factor of λ{\textstyle \lambda }.

## Infinitesimal canonical transformation

Consider the canonical transformation that depends on a continuous parameter $\alpha$, as follows:
${\begin{aligned}&Q(q,p,t;\alpha )\quad \quad \quad &Q(q,p,t;0)=q\\&P(q,p,t;\alpha )\quad \quad {\text{with}}\quad &P(q,p,t;0)=p\\\end{aligned}}$
For infinitesimal values of $\alpha$, the corresponding transformations are called as infinitesimal canonical transformations which are also known as differential canonical transformations.
Consider the following generating function:
$G_{2}(q,P,t)=qP+\alpha G(q,P,t)$
Since for $\alpha =0$, $G_{2}=qP$ has the resulting canonical transformation, $Q=q$ and $P=p$, this type of generating function can be used for infinitesimal canonical transformation by restricting $\alpha$ to an infinitesimal value. From the conditions of generators of second type:${\begin{aligned}{p}&={\frac {\partial G_{2}}{\partial {q}}}=P+\alpha {\frac {\partial G}{\partial {q}}}(q,P,t)\\{Q}&={\frac {\partial G_{2}}{\partial {P}}}=q+\alpha {\frac {\partial G}{\partial {P}}}(q,P,t)\\\end{aligned}}$Since $P=P(q,p,t;\alpha )$, changing the variables of the function $G$ to $G(q,p,t)$ and neglecting terms of higher order of $\alpha$, gives:${\begin{aligned}{p}&=P+\alpha {\frac {\partial G}{\partial {q}}}(q,p,t)\\{Q}&=q+\alpha {\frac {\partial G}{\partial p}}(q,p,t)\\\end{aligned}}$Infinitesimal canonical transformations can also be derived using the matrix form of the symplectic condition.

### Active canonical transformations

In the passive view of transformations, the coordinate system is changed without the physical system changing, whereas in the active view of transformation, the coordinate system is retained and the physical system is said to undergo transformations. Thus, using the relations from infinitesimal canonical transformations, the change in the system states under active view of the canonical transformation is said to be:
${\begin{aligned}&\delta q=\alpha {\frac {\partial G}{\partial p}}(q,p,t)\quad {\text{and}}\quad \delta p=-\alpha {\frac {\partial G}{\partial q}}(q,p,t),\\\end{aligned}}$
or as $\delta \eta =\alpha J\nabla _{\eta }G$ in matrix form.
For any function $u(\eta )$, it changes under active view of the transformation according to:
$\delta u=u(\eta +\delta \eta )-u(\eta )=(\nabla _{\eta }u)^{T}\delta \eta =\alpha (\nabla _{\eta }u)^{T}J(\nabla _{\eta }G)=\alpha \{u,G\}.$
Considering the change of Hamiltonians in the active view, i.e., for a fixed point,$K(Q=q_{0},P=p_{0},t)-H(q=q_{0},p=p_{0},t)=\left(H(q_{0}',p_{0}',t)+{\frac {\partial G_{2}}{\partial t}}\right)-H(q_{0},p_{0},t)=-\delta H+\alpha {\frac {\partial G}{\partial t}}=\alpha \left(\{G,H\}+{\frac {\partial G}{\partial t}}\right)=\alpha {\frac {dG}{dt}}$where (q=q$_0$$^′$, p=p$_0$$^′$){\textstyle (q=q_{0}', p=p_{0}')} are mapped to the point, (Q=q$_0$, P=p$_0$){\textstyle (Q=q_{0}, P=p_{0})} by the infinitesimal canonical transformation, and similar change of variables for $G(q,P,t)$ to $G(q,p,t)$ is considered up-to first order of $\alpha$. Hence, if the Hamiltonian is invariant for infinitesimal canonical transformations, its generator is a constant of motion.

### Examples of ICT
#### Time evolution

Taking $G(q,p,t)=H(q,p,t)$ and $\alpha =dt$, then $\delta \eta =(J\nabla _{\eta }H)dt={\dot {\eta }}dt=d\eta$. Thus the continuous application of such a transformation maps the coordinates $\eta (\tau )$ to $\eta (\tau +t)$. Hence if the Hamiltonian is time translation invariant, i.e. does not have explicit time dependence, its value is conserved for the motion.

#### Translation

Taking $G(q,p,t)=p_{k}$, $\delta p_{i}=0$ and $\delta q_{i}=\alpha \delta _{ik}$. Hence, the canonical momentum generates a shift in the corresponding generalized coordinate and if the Hamiltonian is invariant of translation, the momentum is a constant of motion.

#### Rotation

Consider an orthogonal system for an N-particle system:
${\begin{array}{l}{\mathbf {q} =\left(x_{1},y_{1},z_{1},\ldots ,x_{n},y_{n},z_{n}\right),}\\{\mathbf {p} =\left(p_{1x},p_{1y},p_{1z},\ldots ,p_{nx},p_{ny},p_{nz}\right).}\end{array}}$
Choosing the generator to be: $G=L_{z}=\sum _{i=1}^{n}\left(x_{i}p_{iy}-y_{i}p_{ix}\right)$ and the infinitesimal value of $\alpha =\delta \phi$, then the change in the coordinates is given for x by:
${\begin{array}{c}{\delta x_{i}=\{x_{i},G\}\delta \phi =\displaystyle \sum _{j}\{x_{i},x_{j}p_{jy}-y_{j}p_{jx}\}\delta \phi =\displaystyle \sum _{j}(\underbrace {\{x_{i},x_{j}p_{jy}\}} _{=0}-{\{x_{i},y_{j}p_{jx}\}}})\delta \phi \\{=\displaystyle -\sum _{j}y_{j}\underbrace {\{x_{i},p_{jx}\}} _{=\delta _{ij}}\delta \phi =-y_{i}\delta \phi }\end{array}}$
and similarly for y:
${\begin{array}{c}\delta y_{i}=\{y_{i},G\}\delta \phi =\displaystyle \sum _{j}\{y_{i},x_{j}p_{jy}-y_{j}p_{jx}\}\delta \phi =\displaystyle \sum _{j}(\{y_{i},x_{j}p_{jy}\}-\underbrace {\{y_{i},y_{j}p_{jx}\}} _{=0})\delta \phi \\{=\displaystyle \sum _{j}x_{j}\underbrace {\{y_{i},p_{jy}\}} _{=\delta _{ij}}\delta \phi =x_{i}\delta \phi \,,}\end{array}}$
whereas the z component of all particles is unchanged: δz$_i$={z$_i$, G}δϕ=∑$_j${z$_i$, x$_j$p$_{jy}$−y$_j$p$_{jx}$}δϕ=0{\textstyle \delta z_{i}=\left\{z_{i}, G\right\}\delta \phi =\sum _{j}\left\{z_{i}, x_{j}p_{jy}-y_{j}p_{jx}\right\}\delta \phi =0}.
These transformations correspond to rotation about the z axis by angle $\delta \phi$ in its first order approximation. Hence, repeated application of the infinitesimal canonical transformation generates a rotation of system of particles about the z axis. If the Hamiltonian is invariant under rotation about the z axis, the generator, the component of angular momentum along the axis of rotation, is an invariant of motion.

## Motion as canonical transformation

Motion itself (or, equivalently, a shift in the time origin) is a canonical transformation. If $\mathbf {Q} (t)\equiv \mathbf {q} (t+\tau )$ and $\mathbf {P} (t)\equiv \mathbf {p} (t+\tau )$, then Hamilton's principle is automatically satisfied$\delta \int _{t_{1}}^{t_{2}}\left[\mathbf {P} \cdot {\dot {\mathbf {Q} }}-K(\mathbf {Q} ,\mathbf {P} ,t)\right]dt=\delta \int _{t_{1}+\tau }^{t_{2}+\tau }\left[\mathbf {p} \cdot {\dot {\mathbf {q} }}-H(\mathbf {q} ,\mathbf {p} ,t+\tau )\right]dt=0$since a valid trajectory $(\mathbf {q} (t),\mathbf {p} (t))$ should always satisfy Hamilton's principle, regardless of the endpoints.

## Examples

* The translation $\mathbf {Q} (\mathbf {q} ,\mathbf {p} )=\mathbf {q} +\mathbf {a} ,\mathbf {P} (\mathbf {q} ,\mathbf {p} )=\mathbf {p} +\mathbf {b}$ where $\mathbf {a} ,\mathbf {b}$ are two constant vectors is a canonical transformation. Indeed, the Jacobian matrix is the identity, which is symplectic: $I^{\text{T}}JI=J$.
* Set $\mathbf {x} =(q,p)$ and $\mathbf {X} =(Q,P)$, the transformation $\mathbf {X} (\mathbf {x} )=R\mathbf {x}$ where $R\in SO(2)$ is a rotation matrix of order 2 is canonical. Keeping in mind that special orthogonal matrices obey $R^{\text{T}}R=I$ it's easy to see that the Jacobian is symplectic. However, this example only works in dimension 2: $SO(2)$ is the only special orthogonal group in which every matrix is symplectic. Note that the rotation here acts on $(q,p)$ and not on $q$ and $p$ independently, so these are not the same as a physical rotation of an orthogonal spatial coordinate system.
* The transformation $(Q(q,p),P(q,p))=(q+f(p),p)$, where $f(p)$ is an arbitrary function of $p$, is canonical. Jacobian matrix is indeed given by ${\frac {\partial X}{\partial x}}={\begin{bmatrix}1&f'(p)\\0&1\end{bmatrix}}$ which is symplectic.

## Modern mathematical description

In mathematical terms, canonical coordinates are any coordinates on the phase space (cotangent bundle) of the system that allow the canonical one-form to be written as $\sum _{i}p_{i}\,dq^{i}$ up to a total differential (exact form). The change of variable between one set of canonical coordinates and another is a canonical transformation. The index of the generalized coordinates q is written here as a superscript ($q^{i}$), not as a subscript as done above ($q_{i}$). The superscript conveys the contravariant transformation properties of the generalized coordinates, and does not mean that the coordinate is being raised to a power. Further details may be found at the symplectomorphism article.

## History

The first major application of the canonical transformation was in 1846, by Charles Delaunay, in the study of the Earth-Moon-Sun system. This work resulted in the publication of a pair of large volumes as Mémoires by the French Academy of Sciences, in 1860 and 1867.