# Generating Functions in Hamiltonian Mechanics

1. Feb 19, 2014

### dyn

Hi
I have been looking at canonical transformation using generating functions. I am using the Goldstein book and it gives the following example -
F1=qQ ⇔ Q=p and P=-q

F2=qP ⇔ Q=q and P=p

F3=pQ ⇔ Q=-q and P=-p

F4=pP ⇔ Q=p and P=-q

I'm confused ! Obviously functions 1 and 4 give the same canonical transformation Q=p and P=-q but functions 2 and 3 both return different transformations.
Are all 4 functions supposed to return the same transformation ?

2. Feb 20, 2014

### vanhees71

It depends which kind of generating function you use. All of them depend on one set of the old and new phase-space variables. The original generating function, which can be directly derived from the action principle in Hamiltonian formulation and the demand that the transformation should be canonical (i.e., diffeomorphisms on phase space that leave the Poisson brackets invariant), is
$$f=f(q,Q).$$
The relation between the old and new coordinates is then given by
$$p=\partial_q f, \quad P=-\partial_Q f.$$
The other generating functions are equivalent and can be found via Legendre transformations, e.g.,
$$f(q,Q)=g_1(q,P)-Q \cdot P.$$
Then you get
$$p=\partial_q g_1, \quad Q=\partial_P g_2.$$
The next combination is
$$f(q,Q)=g_2(p,Q)+q \cdot p.$$
Then we get
$$q=-\partial_p g_2, \quad P=-\partial_Q g_2.$$
Finally we use
$$g_2(p,Q)=g_3(p,P)-Q \cdot P.$$
Then we have
$$q=-\partial_p g_3, \quad Q=\partial_P g_3.$$
In all four cases the generating functions may also depend explicitly on time. Then you always have to adapt also the Hamiltonian via
$$H'=H+\partial_t (\text{generating function}).$$
So all four Legendre transformations in your examples are correct and obviously do not represent the same transformation.

3. Feb 20, 2014

### dyn

So you choose the particular generating function depending on what the transformation is ? Either function 1 or 4 which return the same transformation ; or function 2 or function 3 which both return different transformations ?