For a time-dependent type-two generating function for a canonical transformation, the differential identity
gives , with the partial derivative taken at fixed . Here has no explicit time dependence, so the Hamiltonian correction is
As always, adding a function of time alone to the new Hamiltonian leaves Hamilton's equations unchanged. Choosing a time-independent type-two generating function for a canonical transformation fixes that irrelevant freedom and gives the displayed .
On the interior of the principal inverse-cosine branch, , the given canonical transformation has
Integrating suggests . Its other derivative is ; comparison with requires . Hence a suitable type-two generating function for a canonical transformation is
Both derivative equations reproduce the specified transformation exactly. Its mixed derivative is , so it defines a local canonical transformation where and , equivalently where . At or , the stated formulas fail to give a regular coordinate chart. These restrictions explain the square-root branch and the local meaning of canonicity. This is a trigonometric type-two canonical transformation.
A type-two generating function for a canonical transformation uses the mixed variables and defines
For a local invertible canonical transformation, require so that can be solved for . The differential identity gives , expressing preservation of the canonical symplectic form.
Under the gauge transformation,
because the curl of a gradient vanishes, and
The transformed Lagrangian is
A total time derivative changes the action only by endpoint terms, whose variation vanishes for fixed endpoints, so the Euler-Lagrange equations are unchanged.
The new momentum is
Use the type-two generating function for a canonical transformation
It gives , , and
This equals , so the gauge change is a time-dependent canonical transformation.
The defining relations for a type-2 generating function give
Hence
The exact differential changes the action only by an endpoint term. Thus the transformed variational principle has canonical one-form and yields Hamilton's equations in with
A transformation of phase space is canonical when it preserves the symplectic form, or equivalently all Poisson brackets. For one degree of freedom this is
equivalently .
Suppose a type-two generating function for a canonical transformation defines
Then
Equality of the mixed partial derivatives gives , so the transformation is canonical wherever it is locally invertible.
For
the fundamental theorem of calculus and differentiation under the integral sign give
Thus
and in particular .
For the unit-frequency simple harmonic motion, the transformed Hamiltonian is simply . Hamilton's equations become
Therefore
and transformation back gives the familiar solution
Now consider the weak quartic oscillator
Choose the modified generating function
It gives
so the transformed Hamiltonian is again . Hence and . Expanding the square root with the Taylor series gives
Differentiation with respect to therefore yields
where
Set and
Writing and expanding the inverse sine relation at gives
Expanding similarly gives
Consequently
Since , this is the required expression. The formula is understood away from turning points where and the ratio itself is singular.
For and ,
The one-dimensional criterion for a canonical transformation therefore gives
For either value, the type-two generating function for a canonical transformation
works, because and ; when , the first equation is equivalent to . For every other , the Poisson bracket is not one and the map is not canonical.
The type-two generating function for a canonical transformation defines and . On any branch with and , its inverse in mixed coordinates is
The square root equals on this branch. Differentiating proves the generating equations, and proves local invertibility by the inverse function theorem. Also , so the symplectic form obeys . This proves the transformation is canonical locally. It is not a single global chart across the inverse-trigonometric branch boundaries.
Since is independent of time, the transformed Hamiltonian is obtained by substitution, with zero generating-function time correction. An added function of time alone is an irrelevant Hamiltonian freedom, since it leaves Hamilton's equations unchanged.