# Can a Hamiltonian include explicitly the derivative of the conjugate momentum, especially after a canonical transformation?

Can a Hamiltonian expression, say $$H$$ with $$(q,p)$$ as conjugate variable pair, include the total derivative of $$p$$ explicitly? That is, can we have $$H=H(q,p,\dot{p})$$?

And, if so, what does it imply in terms of the usual canonical equations? I can see that it will lead to second order derivatives now. Is this permissible in the Hamiltonian formulation, and what does it mean?

Finally, if a transformation $$(Q,P,t) \rightarrow (q,p,t)$$ is what had led a regular Hamiltonian $$K(Q,P,t)$$ to become a new one $$H(q,p,\dot{p},t)$$ with such dependence on $$\dot{p}$$, as described above, does that mean that such transformation is necessarily not canonical? Or can a regular canonical generating function $$F$$, for example, do so?

No, the Hamiltonian $$H(q,p,t)$$ depends by definition not on $$\dot{q}$$ or $$\dot{p}$$. Similarly for the Kamiltonian $$K(Q,P,t)$$.
For Legendre transformations involving $$\dot{q}$$ or $$\dot{p}$$, see e.g. this & this Phys.SE posts and links therein.