Generating functions which arise in Hamiltonian mechanics are quite different from generating functions in mathematics. In the case of physics, generating functions act as a bridge between two sets of canonical variables when performing canonical transformation.
Details
There are four basic generating functions, summarized by the following table.
Generating Function
|
Its Derivatives
|
|
and
|
|
and
|
|
and
|
|
and
|
S Sankar
Example
Sometimes one can turn a given Hamiltonian into one that looks a bit more like the harmonic oscillator Hamiltonian, which is

So, as an example, if one were given the Hamiltonian

(where p is generalized momentum, and q is the generalized coordinate.)
a good canonical transformation to choose would be

This turns the Hamiltonian into

which is in the form of the harmonic oscillator Hamiltonian.
The generating function, F, for this transformation is of the 3rd kind,

To find F explicitly, use the equation for its derivative (from the table above),

and substitute the expression for P from equation (2), expressed in terms of p and Q:

Integrating this with respect to Q results in an equation for the generating function of the transformation given by equation (2):
|
To confirm that this is the correct generating function, verify that it matches (2):

See also
References