Type-1 Generating Function F1(q,Q,t)

Here is a magic trick, performed by a single scalar function. Take the harmonic oscillator — the problem you have solved five different ways — and hand it to F1=12mωq2cot⁡QF_1=\tfrac12 m\omega q^2\cot Q. Turn the crank (p=∂F1/∂qp=\partial F_1/\partial q, P=−∂F1/∂QP=-\partial F_1/\partial Q) and the Hamiltonian collapses from a quadratic form into K=ωPK=\omega P: one momentum, conserved by inspection, one coordinate advancing uniformly like the hand of a clock. No differential equation was solved. The change of variables did all the work, and the change of variables cost one function of two arguments. That is the type-1 generating function in action. You met the taxonomy in Generating Functions and the Four Types — four ways to store a canonical transformation in one scalar, related by Legendre transforms. This page owns the first member of the family in full working detail: where the defining relations come from (a two-line coefficient match inside Hamilton's modified principle), why the new momentum carries its famous minus sign, when the (q,Q)(q,Q) representation exists and when it degenerates, and how the oscillator computation actually goes, digit by digit, from initial conditions to a predicted position. F1F_1 is the type that mixes coordinates and momenta most aggressively — it cannot even represent the identity map, but it swaps position and momentum effortlessly and it manufactures the action–angle variables on which perturbation theory, adiabatic invariants, and the old quantum theory were built. If you learn to run one generating function fluently, make it this one.

Key takeaways
  • A type-1 generating function F1(q,Q,t)F_1(q,Q,t) depends on the old and new coordinates; its two gradients deliver the momenta: p=∂F1/∂qp=\partial F_1/\partial q and P=−∂F1/∂QP=-\partial F_1/\partial Q.
  • The relations drop out of Hamilton's modified principle: old and new integrands describe the same motion, so they differ by a total time derivative, pq˙−H=PQ˙−K+dF1/dtp\dot q-H=P\dot Q-K+\mathrm{d}F_1/\mathrm{d}t; matching coefficients of the independent q˙\dot q and Q˙\dot Q does the rest.
  • The new Hamiltonian is K=H+∂F1/∂tK=H+\partial F_1/\partial t — equal in value to HH whenever the generator carries no explicit time.
  • Existence requires qq and QQ to be functionally independent: det⁡(∂2F1/∂qi∂Qj)≠0\det(\partial^2F_1/\partial q_i\partial Q_j)\neq0. The identity transformation fails this test — no F1F_1 generates it; switch to type 2.
  • The flagship computation: F1=12mωq2cot⁡QF_1=\tfrac12 m\omega q^2\cot Q turns the oscillator into K=ωPK=\omega P, with P=E/ωP=E/\omega the action and Q=ωt+ϕ0Q=\omega t+\phi_0 the angle.
  • Key idea: a single scalar function of the old and new coordinates generates the entire canonical transformation; differentiating with respect to its two arguments yields the conjugate momenta with opposite signs, automatically preserving the canonical structure.
The core insight

Treat one scalar function of mixed old/new coordinates as a generator; differentiating it with respect to its two arguments gives the conjugate momenta with opposite signs, guaranteeing canonicity through the variational principle.

Where this lives today

The type-1 idea — store a canonical map in a scalar of mixed old/new variables — is the backbone of symplectic integrators, the numerical methods that made long-horizon celestial mechanics trustworthy. A naive Runge–Kutta step slowly leaks phase-space area, and a billion-step Solar System integration spirals planets outward; a symplectic method instead defines each timestep as the canonical transformation of a mixed-variable generator (F1F_1- or F2F_2-type with ∂F/∂t\partial F/\partial t approximating H ΔtH\,\Delta t), so area preservation is exact by construction and energy errors stay bounded for gigayears. Every modern long-term Solar System stability study, and the molecular-dynamics engines behind protein simulation (velocity Verlet is a generating-function method in disguise), runs on this machinery. The same construction, rebranded as variational integrators, now drives trajectory optimization in robotics and physically stable animation in graphics — twenty-first-century engineering steering by a scalar function Jacobi would recognize at a glance.

The physical picture

Think of F1F_1 as a potential on a hybrid space — not the phase space (q,p)(q,p) and not the new chart (Q,P)(Q,P), but the mixed plane whose axes are the old coordinate and the new one. A single surface lives over this plane. Its slope in the qq direction is the old momentum; its slope in the QQ direction is minus the new momentum. Just as a conservative force field is fully stored in one scalar V(x)V(x), an entire canonical transformation — 2n2n functions' worth of map — is stored in one scalar F1F_1. The compression is possible because canonicity is a brutally strong constraint: of the 2n2n free functions in a general map (q,p)→(Q,P)(q,p)\to(Q,P), preserving Hamilton's equations eliminates half, and what survives is exactly one function's worth of freedom.

Figure
One surface over the mixed plane — its two slopes emit the old and new momenta with opposite signs
q (old coordinate) Q (new coordinate) level curves of F₁(q,Q) ∂F₁/∂q = p slope along q reads off the OLD momentum ∂F₁/∂Q = −P slope along Q reads off MINUS the new one one scalar surface stores the entire canonical map — like V(x) storing a whole force field

Why must the two slopes come with opposite signs? Because the surface straddles the old and new descriptions symmetrically, and the phase-space action treats "incoming" and "outgoing" charts with opposite orientation — the same antisymmetry that puts the minus sign into Hamilton's equations themselves. A gradient map (pp and PP both with ++ signs) would be the wrong geometry: flows built from it would compress phase-space area. The (+,−)(+,-) pair is precisely what preserves it. The payoff picture is the harmonic oscillator. In the (q,p)(q,p) chart the trajectory is an energy ellipse traced endlessly; the energy is constant even though neither qq nor pp is. The F1F_1 map unrolls that ellipse into a horizontal line in the (Q,P)(Q,P) chart: all the dynamics is straightened into uniform drift of an angle. Solving the system has been traded for rectifying it.

Figure
The F1 map unrolls the oscillator ellipse into uniform drift — dynamics traded for geometry
old chart (q, p): motion is an ellipse q p E hides in the ellipse's size; nothing constant in sight F₁ new chart (Q, P): motion is a straight line Q P Q̇ = ω, constant P = E/ω K = ωP: momentum frozen, angle drifts uniformly

Keep one caution from the picture: the surface analogy is over the mixed plane, so F1F_1 is useful only when qq and QQ can genuinely serve as independent axes. For maps in which the new coordinate shadows the old one — the identity above all — the mixed plane collapses and the type-1 representation dies. This is not a defect but the reason four different types of generating functions are needed: when one choice of independent variables becomes singular, another remains well defined.

From the variational principle to the type-1 rules

Everything follows from one requirement: the old chart and the new chart must tell the same dynamical story. In the old variables the trajectory extremizes the phase-space action with integrand pq˙−Hp\dot q-H; in the new variables, PQ˙−KP\dot Q-K. Two integrands force identical equations of motion when they differ by a total time derivative — a boundary term that fixed-endpoint variations never see. That freedom is where the generator enters:

p q˙−H=P Q˙−K+dF1dt(1)p\,\dot q-H=P\,\dot Q-K+\frac{\mathrm{d}F_1}{\mathrm{d}t} \qquad (1)

where: pq˙−Hp\dot q-H — the old phase-space Lagrangian; PQ˙−KP\dot Q-K — the new one; F1(q,Q,t)F_1(q,Q,t) — an as-yet arbitrary function of the old and new coordinates. Read it physically: the two descriptions may disagree pointwise along the path, but only by bookkeeping that integrates to endpoint values. Choosing which variables FF depends on is choosing the type; taking (q,Q,t)(q,Q,t) makes q˙\dot q and Q˙\dot Q the only velocities in the equation, and they are independent — which is exactly what lets us match their coefficients. Carrying out that match (Derivation A below) yields the two transformation equations and the Hamiltonian rule:

p=∂F1∂q,P=−∂F1∂Q(2)p=\frac{\partial F_1}{\partial q},\qquad P=-\frac{\partial F_1}{\partial Q} \qquad (2)

where: q,pq,p — old conjugate pair; Q,PQ,P — new conjugate pair; both relations hold at each instant. These are implicit equations for the map: the first is solved for Q(q,p,t)Q(q,p,t) — possible precisely when the mixed Hessian ∂2F1/∂q ∂Q\partial^2F_1/\partial q\,\partial Q is invertible — and the second then hands you P(q,p,t)P(q,p,t). The minus sign on PP is structural, not conventional: flip it and the map stops preserving phase-space area.

K=H+∂F1∂t(3)K=H+\frac{\partial F_1}{\partial t} \qquad (3)

where: K(Q,P,t)K(Q,P,t) — the new Hamiltonian ("Kamiltonian"), with HH re-expressed in the new variables; ∂F1/∂t\partial F_1/\partial t — the generator's explicit time derivative only. A time-independent generator gives K=HK=H in value — same energy function wearing new clothes. A time-dependent one shifts the energy bookkeeping, which is how moving charts and, eventually, the Hamilton–Jacobi equation (K=0K=0) become possible.

Derivation AType-1 relations from coefficient matching in the modified Hamilton principle

We are deriving the complete type-1 machinery — both transformation equations and the new-Hamiltonian rule — from nothing but the statement that old and new charts describe one physical motion. The strategy is the cleanest in this chapter: write both phase-space integrands, let them differ by the total derivative of a function chosen to depend on (q,Q,t)(q,Q,t), expand that derivative by the chain rule, and then exploit the functional independence of q˙\dot q and Q˙\dot Q to match coefficients term by term. The one subtlety to watch is why the velocities may be treated as independent: on the mixed plane, qq and QQ are independent coordinates, so a variation may wiggle one while freezing the other.

Step 1. Write the two variational statements. Old chart: δ∫(pq˙−H) dt=0\delta\int(p\dot q-H)\,\mathrm{d}t=0. New chart: δ∫(PQ˙−K) dt=0\delta\int(P\dot Q-K)\,\mathrm{d}t=0. Both are the modified Hamilton principle of Hamilton's Canonical Equations, whose independent variations of coordinates and momenta reproduce the canonical equations in each chart. Why both at once? Because "the transformation is canonical" means exactly this: whatever trajectory extremizes the old action must, seen through the map, extremize the new one.

Step 2. Let the integrands differ by a total derivative, pq˙−H=PQ˙−K+dF1/dtp\dot q-H=P\dot Q-K+\mathrm{d}F_1/\mathrm{d}t, with F1=F1(q,Q,t)F_1=F_1(q,Q,t). A total derivative contributes F1(end)−F1(start)F_1(\text{end})-F_1(\text{start}) to the action, and because the endpoint variations vanish, this boundary term does not affect the Euler–Lagrange equations.

Step 3. Expand by the chain rule:

dF1dt=∂F1∂qq˙+∂F1∂QQ˙+∂F1∂t\frac{\mathrm{d}F_1}{\mathrm{d}t}=\frac{\partial F_1}{\partial q}\dot q+\frac{\partial F_1}{\partial Q}\dot Q+\frac{\partial F_1}{\partial t}

and substitute into Step 2, collecting everything on one side:

(p−∂F1∂q)q˙−(P+∂F1∂Q)Q˙−(H−K+∂F1∂t)=0\left(p-\frac{\partial F_1}{\partial q}\right)\dot q-\left(P+\frac{\partial F_1}{\partial Q}\right)\dot Q-\left(H-K+\frac{\partial F_1}{\partial t}\right)=0

Step 4. Match the coefficient of q˙\dot q. Since q˙\dot q and Q˙\dot Q can be varied independently at a point of the mixed plane, each bracket must vanish separately. The first gives p=∂F1/∂qp=\partial F_1/\partial q.

Step 5. Match the coefficient of Q˙\dot Q: P=−∂F1/∂QP=-\partial F_1/\partial Q. The minus sign arrives because PQ˙P\dot Q sits on the opposite side of the identity from pq˙p\dot q — the new chart is the "outgoing" description, and the generator straddles the two with opposite orientation. Why is this not a convention? Try P=+∂F1/∂QP=+\partial F_1/\partial Q with any concrete generator, say F1=qQF_1=qQ: the resulting map (q,p)→(p,q)(q,p)\to(p,q) has Jacobian determinant −1-1 and reverses phase-space orientation — Hamilton's equations in the new chart pick up a wrong overall sign. Only the opposite-sign pairing preserves the canonical structure and the phase-space orientation.

Step 6. The velocity-free remainder fixes the new Hamiltonian: K=H+∂F1/∂tK=H+\partial F_1/\partial t. Every type in the family obeys this same rule, because the Legendre transforms connecting the types never touch the explicit time slot. The coefficient matching is unambiguous because q˙\dot q and Q˙\dot Q are independent; as a concrete check, setting F1=qQF_1=qQ reproduces the known swap map with {Q,P}=1\{Q,P\}=1.

One structural identity is worth extracting before the applications, because it is the germ of the symplectic condition. The two relations in (2) come from a single C2C^2 function, so their cross-derivatives are locked together:

∂p∂Q∣q=∂2F1∂Q ∂q=−∂P∂q∣Q(4)\frac{\partial p}{\partial Q}\bigg|_{q}=\frac{\partial^2F_1}{\partial Q\,\partial q}=-\frac{\partial P}{\partial q}\bigg|_{Q} \qquad (4)

where: the outer derivatives are taken on the mixed plane. This is an integrability condition the map satisfies identically — no Poisson bracket needs computing. It is one block of the full symplectic condition MJMT=JM J M^{\mathsf T}=J that Symplectic Condition assembles in matrix form; a generating function satisfies this integrability condition automatically, which is precisely why the construction guarantees a canonical transformation.

Go deeper · Derivation B · 1 minCanonicity is automatic — the mixed-partials check
Derivation BCanonicity is automatic — the mixed-partials check

We are showing that any transformation produced by the type-1 rules is canonical without ever computing a Poisson bracket: the equality of mixed second derivatives of the single scalar F1F_1 is the symplectic integrability condition in the (q,Q)(q,Q) representation. The strategy is two one-line differentiations and a comparison. What to watch: which variable is held fixed in each derivative — the whole content lives in that bookkeeping.

Step 1. Differentiate p=∂F1/∂qp=\partial F_1/\partial q with respect to QQ at fixed qq:

∂p∂Q∣q=∂2F1∂Q ∂q\frac{\partial p}{\partial Q}\bigg|_{q}=\frac{\partial^2F_1}{\partial Q\,\partial q}

Step 2. Differentiate P=−∂F1/∂QP=-\partial F_1/\partial Q with respect to qq at fixed QQ:

∂P∂q∣Q=−∂2F1∂q ∂Q\frac{\partial P}{\partial q}\bigg|_{Q}=-\frac{\partial^2F_1}{\partial q\,\partial Q}

Step 3. For any twice continuously differentiable F1F_1, the mixed partials are equal (Clairaut–Schwarz), so

∂p∂Q∣q=−∂P∂q∣Q\frac{\partial p}{\partial Q}\bigg|_{q}=-\frac{\partial P}{\partial q}\bigg|_{Q}

Why this settles canonicity: the condition is exactly what the symplectic condition MJMT=JMJM^{\mathsf T}=J reduces to when written in mixed variables — the antisymmetric structure of phase space re-expressed as "one potential, two slopes." A map that cannot be so derived generically fails it; a map that can, passes identically. For example, with F1=qQF_1=qQ the relation reads ∂p/∂Q=1=−∂P/∂q\partial p/\partial Q=1=-\partial P/\partial q (since P=−qP=-q) — both sides equal 1, confirming that generating-function maps are canonical by construction.

The flagship computation: the oscillator rectified

Now run the machine on a real Hamiltonian. The oscillator H=p2/2m+12mω2q2H=p^2/2m+\tfrac12 m\omega^2q^2 is quadratic in both arguments — an ellipse in phase space — and the following generator is engineered to trade (q,p)(q,p) for an angle and an action:

F1(q,Q)=12 mω q2cot⁡Q(5)F_1(q,Q)=\tfrac{1}{2}\,m\omega\,q^{2}\cot Q \qquad (5)

where: mm — mass; ω\omega — angular frequency; QQ — the would-be angle variable; the cot⁡Q\cot Q is what will convert the phase-space ellipse into sine and cosine. This form is motivated by the known action–angle parametrization of the harmonic oscillator, and it can be verified directly by differentiation; the motivating route runs as follows. Work backwards: if q∝Psin⁡Qq\propto\sqrt{P}\sin Q and p∝Pcos⁡Qp\propto\sqrt{P}\cos Q are to hold, then p/q∝cot⁡Qp/q\propto\cot Q, and integrating p=∂F1/∂q=mωqcot⁡Qp=\partial F_1/\partial q=m\omega q\cot Q in qq lands on (5). Generators are usually reverse-engineered this way, then verified forwards.

Go deeper · Derivation C · 1 minSolving the harmonic oscillator with a type-1 generator
Derivation CSolving the harmonic oscillator with a type-1 generator

We are transforming the oscillator to variables in which its dynamics is trivial, using F1=12mωq2cot⁡QF_1=\tfrac12 m\omega q^2\cot Q — the single most instructive generating-function computation in mechanics, and the doorway to Action-Angle Variables. The route: extract both momenta from the generator, invert to get the explicit map (Q,P)→(q,p)(Q,P)\to(q,p), substitute into HH, and integrate the new — trivial — canonical equations. Watch two things: the derivative of cot⁡Q\cot Q, which produces the required 1/sin⁡2Q1/\sin^{2}Q factor, and the identity sin⁡2Q+cos⁡2Q=1\sin^{2}Q+\cos^{2}Q=1, which eliminates the angle from the Hamiltonian.

Step 1. Old momentum from the qq-slope:

p=∂F1∂q=mω qcot⁡Qp=\frac{\partial F_1}{\partial q}=m\omega\,q\cot Q

Step 2. New momentum from the QQ-slope, using d(cot⁡Q)/dQ=−1/sin⁡2Q\mathrm{d}(\cot Q)/\mathrm{d}Q=-1/\sin^2Q:

P=−∂F1∂Q=mω q22sin⁡2QP=-\frac{\partial F_1}{\partial Q}=\frac{m\omega\,q^{2}}{2\sin^{2}Q}

Why the sign works out: the derivative of cot⁡\cot is negative, and the defining relation carries its own minus sign; the two cancel, leaving P>0P>0 — an action should be positive.

Step 3. Invert Step 2 for the old coordinate:

q=2Pmω sin⁡Qq=\sqrt{\frac{2P}{m\omega}}\,\sin Q

Step 4. Substitute into Step 1 to express the old momentum in new variables:

p=mωqcot⁡Q=2mωP cos⁡Qp=m\omega q\cot Q=\sqrt{2m\omega P}\,\cos Q

Step 5. Transform the Hamiltonian. F1F_1 has no explicit time dependence, so K=HK=H re-expressed:

K=p22m+12mω2q2=ωPcos⁡2Q+ωPsin⁡2Q=ωPK=\frac{p^{2}}{2m}+\tfrac12 m\omega^{2}q^{2}=\omega P\cos^{2}Q+\omega P\sin^{2}Q=\omega P

Why this is the victory: QQ is absent from KK — the new coordinate is cyclic (see Cyclic Coordinates and Conserved Momenta), so its conjugate momentum froze the moment we finished transforming.

Step 6. Integrate the new canonical equations:

Q˙=∂K∂P=ω  ⇒  Q=ωt+ϕ0,P˙=−∂K∂Q=0  ⇒  P=Eω\dot Q=\frac{\partial K}{\partial P}=\omega\;\Rightarrow\;Q=\omega t+\phi_{0},\qquad \dot P=-\frac{\partial K}{\partial Q}=0\;\Rightarrow\;P=\frac{E}{\omega}

Since the transformed Hamiltonian is K=ωPK=\omega P and, for a time-independent generator, K=H=EK=H=E, it follows immediately that P=E/ωP=E/\omega. Mapping back through Steps 3–4 delivers q(t)q(t) and p(t)p(t) as sines and cosines — the familiar solution, produced without solving a single differential equation in the old chart. As a check: substituting q=2P/mωsin⁡Qq=\sqrt{2P/m\omega}\sin Q and p=2mωPcos⁡Qp=\sqrt{2m\omega P}\cos Q back into HH returns ωP\omega P identically, and dimensionally [P]=[E]/[ω]=J s[P]=[E]/[\omega]=\mathrm{J\,s}, confirming PP is an action.

The lesson generalizes: for every integrable system there exist charts in which the Hamiltonian depends on momenta alone, and generating functions are the vehicle that takes you there. That program — run systematically rather than by inspired guessing — is Hamilton–Jacobi theory, where the generator itself becomes the unknown of a partial differential equation (the type-2 route; see Type-2 Generating Function F2(q,P,t)).

Limiting cases

CaseResultMeaning
Non-degenerate mixed Hessiandet⁡(∂2F1/∂qi ∂Qj)≠0\det\left(\partial^{2}F_1/\partial q_i\,\partial Q_j\right)\neq0p=∂qF1p=\partial_qF_1 can be inverted for Q(q,p,t)Q(q,p,t); the type-1 representation exists
Identity map Q=q, P=pQ=q,\ P=pno F1F_1 existsq,Qq,Q dependent — the mixed plane collapses; use F2=qPF_2=qP (type 2)
Swap generator F1=qQF_1=qQp=Q, P=−qp=Q,\ P=-qcoordinates and momenta trade places — impossible to express in Lagrangian mechanics
Time-independent F1F_1K=HK=H (in value)the transformation reshuffles phase space at fixed energy function
Oscillator generator F1=12mωq2cot⁡QF_1=\tfrac12 m\omega q^2\cot QK=ωPK=\omega Pdynamics rectified: action frozen, angle drifts at ω\omega
Q→0Q\to0 or π\pi in the oscillator mapcot⁡Q\cot Q divergeschart singular where qq-axis is crossed: the angle chart, like all charts, has coordinate singularities

Worked examples

1 · The swap generator on a free particle (confidence builder)

Take F1=qQF_1=qQ acting on a free particle, H=p2/2mH=p^2/2m with m=2.0 kgm=2.0\ \mathrm{kg}. At the phase point q=3.0 mq=3.0\ \mathrm{m}, p=4.0 kg m/sp=4.0\ \mathrm{kg\,m/s}, find the new variables and the new Hamiltonian, and verify both canonical equations numerically.

Step 1. Run the type-1 rules. p=∂F1/∂q=Qp=\partial F_1/\partial q=Q, so Q=p=4.0 kg m/sQ=p=4.0\ \mathrm{kg\,m/s}; and P=−∂F1/∂Q=−q=−3.0 mP=-\partial F_1/\partial Q=-q=-3.0\ \mathrm{m}. Coordinates and momenta have swapped (with the orientation-preserving minus sign), units and all — the new "coordinate" is measured in momentum units, which canonical mechanics happily permits.

Step 2. Build KK. No explicit time in F1F_1, so K=HK=H re-expressed: p=Qp=Q gives K(Q,P)=Q2/2mK(Q,P)=Q^{2}/2m. Value check: K=(4.0)2/(2×2.0)=4.0 JK=(4.0)^2/(2\times2.0)=4.0\ \mathrm{J}, equal to H=(4.0)2/4.0=4.0 JH=(4.0)^2/4.0=4.0\ \mathrm{J} ✓.

Step 3. First canonical equation: Q˙=∂K/∂P=0\dot Q=\partial K/\partial P=0. Directly: Q˙=p˙=0\dot Q=\dot p=0 for a free particle ✓ — the new coordinate is frozen because it is the conserved momentum.

Step 4. Second canonical equation: P˙=−∂K/∂Q=−Q/m=−4.0/2.0=−2.0 m/s\dot P=-\partial K/\partial Q=-Q/m=-4.0/2.0=-2.0\ \mathrm{m/s}. Directly: P˙=−q˙=−p/m=−4.0/2.0=−2.0 m/s\dot P=-\dot q=-p/m=-4.0/2.0=-2.0\ \mathrm{m/s} ✓. Bracket check in old variables: {Q,P}=∂qQ ∂pP−∂pQ ∂qP=(0)(0)−(1)(−1)=1\{Q,P\}=\partial_qQ\,\partial_pP-\partial_pQ\,\partial_qP=(0)(0)-(1)(-1)=\mathbf{1} ✓. The transformation is canonical: the physics is unchanged, but the canonical variables have exchanged their dynamical roles.

2 · Predicting an oscillator's position through the angle chart (exam level)

An oscillator has m=0.50 kgm=0.50\ \mathrm{kg}, ω=4.0 rad/s\omega=4.0\ \mathrm{rad/s}, and at t=0t=0: q0=0.30 mq_0=0.30\ \mathrm{m}, p0=0.80 kg m/sp_0=0.80\ \mathrm{kg\,m/s}. Using the generator F1=12mωq2cot⁡QF_1=\tfrac12 m\omega q^2\cot Q, find the action PP, the initial angle ϕ0\phi_0, and predict qq at t=0.50 st=0.50\ \mathrm{s}. Cross-check against the direct solution.

Step 1. Energy first: E=p02/2m+12mω2q02=0.641.0+12(0.50)(16)(0.09)=0.64+0.36=1.00 JE=p_0^{2}/2m+\tfrac12 m\omega^{2}q_0^{2}=\frac{0.64}{1.0}+\tfrac12(0.50)(16)(0.09)=0.64+0.36=1.00\ \mathrm{J}. The action is P=E/ω=1.00/4.0=0.250 J sP=E/\omega=1.00/4.0=\mathbf{0.250\ J\,s} — frozen for all time.

Step 2. Determine the initial angle directly from the generating-function relations. Dividing q=2P/mωsin⁡Qq=\sqrt{2P/m\omega}\sin Q by p=2mωPcos⁡Qp=\sqrt{2m\omega P}\cos Q gives tan⁡Q=mωq/p\tan Q=m\omega q/p, so tan⁡ϕ0=(0.50)(4.0)(0.30)/0.80=0.75\tan\phi_0=(0.50)(4.0)(0.30)/0.80=0.75 — a 3–4–5 triangle, sin⁡ϕ0=0.60\sin\phi_0=0.60, cos⁡ϕ0=0.80\cos\phi_0=0.80, ϕ0=0.6435 rad\phi_0=0.6435\ \mathrm{rad}.

Step 3. Consistency check on PP using the new-momentum relation directly: P=mωq02/(2sin⁡2ϕ0)=(0.50)(4.0)(0.09)/(2×0.36)=0.18/0.72=0.250 J sP=m\omega q_0^{2}/(2\sin^{2}\phi_0)=(0.50)(4.0)(0.09)/(2\times0.36)=0.18/0.72=0.250\ \mathrm{J\,s} ✓, and p0=mωq0cot⁡ϕ0=(2.0)(0.30)(0.80/0.60)=0.80 kg m/sp_0=m\omega q_0\cot\phi_0=(2.0)(0.30)(0.80/0.60)=0.80\ \mathrm{kg\,m/s} ✓. Amplitude for later: 2P/mω=0.50/2.0=0.50 m\sqrt{2P/m\omega}=\sqrt{0.50/2.0}=0.50\ \mathrm{m}.

Step 4. March the angle forward — the only dynamics left: Q(0.50)=ωt+ϕ0=4.0×0.50+0.6435=2.6435 radQ(0.50)=\omega t+\phi_0=4.0\times0.50+0.6435=2.6435\ \mathrm{rad}. Then

q(0.50)=0.50 sin⁡(2.6435)=0.50×0.4777=0.239 mq(0.50)=0.50\,\sin(2.6435)=0.50\times0.4777=\mathbf{0.239\ m}

Step 5. Cross-check by brute force in the old chart: q(t)=q0cos⁡ωt+(p0/mω)sin⁡ωt=0.30cos⁡(2.0)+0.40sin⁡(2.0)=0.30×(−0.4161)+0.40×0.9093=−0.1248+0.3637=0.239 mq(t)=q_0\cos\omega t+(p_0/m\omega)\sin\omega t=0.30\cos(2.0)+0.40\sin(2.0)=0.30\times(-0.4161)+0.40\times0.9093=-0.1248+0.3637=0.239\ \mathrm{m} ✓. Identical to the millimeter. The generating-function method avoids integrating the equations of motion: it transforms the dynamics to a chart where the motion is uniform, advances the system by one step, and transforms back.

Origins · 1 minArnold Sommerfeld and how this was discovered
AS
Arnold Sommerfeld
1868–1951 · Munich

Sommerfeld is the physicist who made the action variable P=E/ωP=E/\omega famous beyond mechanics. In 1915–16, extending Bohr's atom, he and William Wilson promoted exactly the quantity a type-1 generator hands you — the phase integral ∮p dq\oint p\,\mathrm{d}q, which for the oscillator equals 2πP2\pi P — to a quantization rule: ∮p dq=nh\oint p\,\mathrm{d}q=nh. Applied with elliptic orbits and relativistic corrections, it produced the fine-structure constant α\alpha and split hydrogen's spectral lines before wave mechanics existed. The deeper reason the recipe worked at all is generating-function mechanics: action variables are the adiabatically invariant, canonically privileged momenta of an integrable system, so "quantize the action" was the only chart-independent rule available. Sommerfeld's Munich seminar — Heisenberg, Pauli, Debye, Bethe among its students — treated canonical transformations as the working language of atomic theory, and his Atombau und Spektrallinien carried that language to a generation. Nominated for the Nobel Prize a record 84 times without winning, he remains the field's great teacher: the old quantum theory died in 1925, but the action variables it ran on are still how accelerator physicists and planetary dynamicists label orbits today.

History
1828
— Hamilton's Theory of Systems of Rays stores an optical instrument in one characteristic function — the germ of the generator idea
1834
— Hamilton's dynamical papers cast mechanics in canonical form, making the phase-space action available
1837
— Jacobi announces the transformation method: change variables wholesale by a single function, aiming at trivial dynamics
1843
— Jacobi's Königsberg lectures (published 1866) systematize generating functions and solve previously intractable problems
1916
— Sommerfeld and Wilson quantize the action integral, running the old quantum theory on action-angle charts
1927
— Dirac's transformation theory carries generating-function structure into quantum mechanics as unitary transformations

Going further

References. Goldstein, Classical Mechanics, 3rd ed., §9.1 · Morin, Introduction to Classical Mechanics, Ch. 15 · Landau & Lifshitz, Mechanics, Vol. 1, §45 · Taylor, Classical Mechanics, Ch. 13 The identity K=ωPK=\omega P can be confirmed by substituting q=2P/mωsin⁡Qq=\sqrt{2P/m\omega}\sin Q and p=2mωPcos⁡Qp=\sqrt{2m\omega P}\cos Q into H=p2/2m+12mω2q2H=p^2/2m+\tfrac12 m\omega^2 q^2; all signs and the −1/sin⁡2Q-1/\sin^2 Q derivative of cot⁡Q\cot Q are standard. The numeric examples on this page (swap map at q=3.0q=3.0, p=4.0p=4.0; oscillator with m=0.50m=0.50, ω=4.0\omega=4.0, q0=0.30q_0=0.30, p0=0.80p_0=0.80) each carry an internal cross-check.

Builds on: Definition of Canonical Transformations · Generating Functions and the Four Types Leads to: Type-2 Generating Function F2(q,P,t) · Type-3 and Type-4 Generating Functions · Symplectic Condition · Poisson Brackets as a Test for Canonicity

How would I ever guess a generator like (1/2) m ω q² cot Q on my own?

You reverse-engineer it. Decide what you want the new variables to do — for the oscillator, q∝Psin⁡Qq\propto\sqrt{P}\sin Q so that the energy becomes a function of PP alone — then form the ratio p/qp/q, which eliminates PP and leaves pp as a function of qq and QQ only: p=mωqcot⁡Qp=m\omega q\cot Q. Since type-1 demands p=∂F1/∂qp=\partial F_1/\partial q, integrate in qq at fixed QQ and you land on the generator. In practice nobody guesses generators forwards; Hamilton–Jacobi theory (the type-2 route) turns the reverse-engineering into a systematic PDE.

Is F1 itself a physical quantity? Does its value mean anything?

Along an actual trajectory, yes and beautifully: the identity pq˙−H=PQ˙−K+dF1/dtp\dot q-H=P\dot Q-K+\mathrm{d}F_1/\mathrm{d}t integrates to show that F1F_1 accumulates the difference of the two phase-space actions between endpoints. That is why Hamilton's principal function — the action integral itself — turns out to be a generating function of exactly this mixed-variable kind. Off-trajectory, though, F1F_1 is scaffolding: only its derivatives (the map) are physics, and adding a constant changes nothing.

Why can't F1 generate the identity? The identity is the most harmless map there is.

Because F1F_1's two arguments must be usable as independent axes of a plane, and under the identity Q=qQ=q they are the same variable — the mixed plane degenerates to a line. Algebraically, p=∂F1(q,Q)/∂qp=\partial F_1(q,Q)/\partial q must be solvable for QQ, which needs ∂2F1/∂q∂Q≠0\partial^2F_1/\partial q\partial Q\neq0; but any candidate would have to give pp independent of QQ at Q=qQ=q, a contradiction. The family exists precisely for this reason: F2=qPF_2=qP generates the identity with no drama. Near-identity maps — the infinitesimal canonical transformations that build flows — are type-2 territory too.

Do the four types generate different sets of transformations? Is type 1 more powerful?

No type is more powerful; they are four coordinate charts on the same space of canonical transformations, related by Legendre transforms (e.g. F2=F1+QPF_2=F_1+QP). Most transformations admit several representations; some sit in a blind spot of one type — the identity for F1F_1, the full swap for F2F_2. For a given map, existence of type kk is a non-degeneracy condition on the corresponding pair of variables. See Generating Functions and the Four Types for the full taxonomy and the master table.

When F1 depends on time, K is not the energy. What is it then?

KK is the generator of time evolution in the new chart — the function whose partial derivatives produce Q˙\dot Q and P˙\dot P. That role does not require it to equal the kinetic-plus-potential energy, and after a time-dependent transformation it generally will not (a chart co-rotating with the dynamics can reach K=0K=0: nothing moves in that chart, though the particle certainly carries energy). Energy bookkeeping and evolution bookkeeping coincide only when the chart itself is time-independent.

In the oscillator example the new coordinate Q is an angle and P has units of action, not momentum. Is that allowed?

Entirely. Canonical mechanics constrains only the pair: the product of each conjugate pair must carry dimensions of action (J s\mathrm{J\,s}), because p dqp\,\mathrm{d}q terms build the action integral. QQ dimensionless (radians) with [P]=J s[P]=\mathrm{J\,s} satisfies this exactly as well as meters times kg m/s\mathrm{kg\,m/s}. Freeing the variables from their metric meaning is much of the formalism's power — the swap generator F1=qQF_1=qQ even gives a "coordinate" measured in momentum units.

Equation (4) looks like only part of a symplectic condition. Where is the rest?

Sharp eye. For one degree of freedom, (4) is the whole content — it is equivalent to {Q,P}=1\{Q,P\}=1. For nn degrees of freedom, the mixed-partials argument applied to all index pairs generates the full set of conditions packaged in MJMT=JMJM^{\mathsf T}=J: symmetry of ∂2F1/∂qi∂qj\partial^2F_1/\partial q_i\partial q_j-type blocks plus the cross-block relation. The matrix formulation in Symplectic Condition is the tidy way to carry all of them at once; the generating-function origin is why they hold identically rather than needing to be checked.

Is Hamilton's principal function from the action principle literally one of these generators?

Yes — that is the deepest fact in this corner of mechanics. The action S(q,t;q0,t0)S(q,t;q_0,t_0) evaluated along the true trajectory, viewed as a function of the endpoints, satisfies p=∂S/∂qp=\partial S/\partial q and p0=−∂S/∂q0p_0=-\partial S/\partial q_0: exactly the type-1 relations with (q0,p0)(q_0,p_0) as the "new" chart. Time evolution itself is a canonical transformation, generated by the accumulating action. Quantum mechanics inherits this wholesale: eiS/ℏe^{iS/\hbar} is the propagator's phase, which is why canonical transformations become unitary ones.

Before this

Where this leads