Solution (source code)

= Solution

An invertible change $(q,p)\mapsto(Q,P)$ is canonical when it preserves the <Poisson bracket>. Its fundamental brackets must be
$$
\boxed{\{Q_i,Q_j\}=0,\qquad\{P_i,P_j\}=0,\qquad
\{Q_i,P_j\}=\delta_{ij}.}
$$
The <chain rule> then makes the bracket of any two <observables> identical in the old and new coordinates. Consequently <Hamilton's equations> retain their canonical form. A time-dependent <canonical transformation> also requires the corresponding extra term in the transformed <Hamiltonian>; bracket preservation by itself concerns each fixed time.