# Canonical transformations in Hamiltonian mechanics

How to prove that in the new Hamiltonian, which is formed by any of the generator function will not contain $Q$ (transformed from $q$)? I.e. new Hamiltonian will only be a function of $P$ (transformed from $p$).

-
Could you clarify the question? If the new Hamiltonian does not contain $Q$, then the equations of motion (which are preserved under a canonical transformation) would imply $\dot P=0$. So this seems like a very special canonical transformation, which you are talking about. – pppqqq Jan 26 '14 at 17:25
Please, reformulate your question into a more clear form, I cannot understand it as it stands. – Valter Moretti Jan 26 '14 at 17:29

For each given hamiltonian $H$, this will only happen for a few, rather special, canonical transformations. As pppqqq points out, having $H$ not depend on $Q$ implies that $\dot P=0$ and hence $P$ is a constant of the motion. To put this differently, it means that the property you want will only happen when the momenta you transform into are some of the (rather few) constants of the motion.