Generating functions have many uses and it is useful to be able to construct one from a given transformation. We can do this from the defining relationship between the generating function and the transformation.
Example Show that the transformation
Show that the transformation is canonical and find a generating function F(Q,q).
is canonical and find a generating function F(Q,q).
We use the fact that and
and For the transformation to be canonical it suffices to show, using the equivalence of mixed partial derivatives
For the transformation to be canonical it suffices to show, using the equivalence of mixed partial derivatives that
that (1)
(1)


Hence and
and so (1) is satisfied and the equation is canonical.
so (1) is satisfied and the equation is canonical.
To find the generating function we use the relationships
we use the relationships and
 and to give
to give



where is an arbitrary function of
is an arbitrary function of
Differentiating this expressing with respect to gives the relationship above for
gives the relationship above for so we may set
so we may set and
and