Solution (source code)

= Solution

A locally invertible time-independent <canonical transformation> is canonical when
$$
\boxed{\{Q_i,Q_j\}=0,\quad\{P_i,P_j\}=0,\quad\{Q_i,P_j\}=\delta_{ij}.}
$$
The proposed coordinates are locally independent only for $q_1\ne0$, since their configuration-space Jacobian has <determinant> $2q_1$. <Work> on one sign branch of $q_1$.

The mixed brackets first require
$$
P_1=\frac{p_1-p_2}{2q_1}+A(q_1,q_2),\qquad
P_2=p_2+B(q_1,q_2).
$$
The last bracket condition is
$$
\{P_1,P_2\}=\partial_{q_2}A-
\frac{\partial_{q_1}B-\partial_{q_2}B}{2q_1}=0.
$$
Expressing $A,B$ in the $Q$ coordinates turns this into $\partial_{Q_2}A=\partial_{Q_1}B$. Thus their shift one-form is closed and locally is the differential of an arbitrary smooth function $S(Q_1,Q_2)$. The <canonical momenta for a squared coordinate> therefore have the general local form
$$
\boxed{P_1=\frac{p_1-p_2}{2q_1}+\frac{\partial S}{\partial Q_1},\qquad
P_2=p_2+\frac{\partial S}{\partial Q_2}.}
$$
Conversely, any such $S$ satisfies all bracket conditions. This does not give one nonsingular transformation through $q_1=0$, or identify the two sign branches globally.

Choose $S=Q_2^3/3$. Then
$$
\boxed{P_1=\frac{p_1-p_2}{2q_1},\qquad P_2=p_2+(q_1+q_2)^2,\qquad H=P_1^2+P_2.}
$$