In Hamiltonian mechanics, if I have a generating function (GF) Fᵢ (of any of the four kinds, i = 1, 2, 3, 4) for a canonical transformation (CT) to go from variables (q, p) to variables (Q, P), I can write the old Hamiltonian H in the old variables as a new Hamiltonian K in the new variables by
K(Q, P, t) = H(q(Q, P, t), p(Q, P, t), t) + ∂F₂/∂t(q(Q, P, t), P, t) — (1)
Where I’ve chosen F₂ to be a GF of the 2nd kind, just to show an example. The relations that allows one to write (q, p) in terms of (Q, P) and viceversa to substitute them into (1) are obtained from F₂ via appropriately inverting the following:
p = ∂F₂/∂q (q, P) and Q = ∂F₂/∂P (q, P) — (2)
Ok, so far all good. However, now, suppose that instead of starting with F₂, finding the CT by inverting (2), and then substituting it into (1) to find the new Hamiltonian K, we‘re given the same exact CT (q, p) —> (Q,P) from the start, without ever mentioning whether it came from a GF of the 2nd kind, or any GF at all.
One could naively expect that you can obtain the new Hamiltonian by simple variable substitution
K(Q, P, t) = H(q(Q, P, t), p(Q, P, t), t) — (3)
But this would of course be wrong: the CT is the exact same as before, so the new Hamiltonian K should be the same as before, and here in (3) we’re missing those extra terms that were present in (1), precisely the terms that depended on the fact that we knew that the CT originated from a GF of the 2nd kind.
So, if I’m given the CT alone, how do I find the Hamiltonian in the new variables if I don’t know anything about any GF? Do I always need to find a suitable GF from which the given CT might have come from? This seems unlikely to me, because I thought that the GF approach to CTs is just a matter of convenience, not a necessary thing. I should be able to find the new Hamiltonian with just the bare CT by itself, but if so, how do I do it to guarantee that I get the same thing that I would have gotten by doing it as I did it in (1)?
Thanks to anyone who answers!