The problem I'm supposed to solve is finding QQ , such that (p,q)(P,Q)(p,q)\rightarrow(P,Q) is a canonical transformation. In this case H=p2+q22\mathcal{H}=\frac{p^{2}+q^{2}}{2} and the new hamiltonian K\mathcal{K} is K=P\mathcal{K}=P . This means q˙=p\dot{q}=p and p˙=q\dot{p}=-q Since H\mathcal{H} and K\mathcal{K} are time independent H=K\mathcal{H}=\mathcal{K} and P=p2+q22P=\frac{p^{2}+q^{2}}{2} . Now I use a generating function of canonical transformations F4=F4(p,P)F_{4}=F_{4}(p,P) so: F4p=q\mboxandF4P=Q\frac{\partial F_{4}}{\partial p}=-q\quad\quad\quad\mbox{and}\quad\quad\quad\frac{\partial F_{4}}{\partial P}=Q P=p2+q22q=2Pp2P=\frac{p^{2}+q^{2}}{2}\quad\Rightarrow\quad q=\sqrt{2P-p^{2}} Then \begin{equation} F_{4}=-\int\sqrt{2P-p^{2}}dp\quad\Rightarrow\quad Q=-\int \frac{\partial\sqrt{2P-p^{2}}}{\partial P}dp=-arcsin\left(\frac{p}{\sqrt{2P}}\right)=-arcsin\left(\frac{p}{\sqrt{p^{2}+q^{2}}}\right) \end{equation} {Q,P}=QqPpQpPq=pp2+q2p(qp2+q2)q=1\{Q,P\}= \frac{\partial Q}{\partial q}\frac{\partial P}{\partial p}-\frac{\partial Q}{\partial p}\frac{\partial P}{\partial q}=\frac{p}{p^{2}+q^{2}}p-\left(-\frac{q}{p^{2}+q^{2}}\right)q=1 . Therefore this transformation is canonical. However I also tried to find QQ with the generating function F1=F1(q,Q)F_{1}=F_{1}(q,Q) , where \begin{equation} \frac{\partial F_{1}}{\partial Q}=-P\quad\quad\mbox{and}\quad\quad\frac{\partial F_{1}}{\partial q}=p \end{equation} Then \begin{equation} F_{1}=\int\frac{-p^{2}-q^{2}}{2}dQ\quad\Rightarrow\quad p=\int \frac{\partial\left(\frac{-p^{2}-q^{2}}{2}\right)}{\partial q}dQ=\int -qdQ=-qQ\quad\Rightarrow\quad Q=-\frac{p}{q} \end{equation} This is very different with respect to the first QQ found, and {Q,P}=pq2p+1qq=p2q2+1\{Q,P\}=\frac{p}{q^{2}}p+\frac{1}{q}q=\frac{p^{2}}{q^{2}}+1 which can only be equal to 1 if p=0p=0 . But if we assume this is a canonical transformation then Q˙=1\dot{Q}=1 and P˙=0\dot{P}=0 , and \begin{equation} \dot{Q}=\frac{\partial Q}{\partial q}\dot{q}+\frac{\partial Q}{\partial p}\dot{p}=\frac{p^{2}}{q^{2}}+1=1\Rightarrow p=0 \end{equation} I think the second result can't be possible, if p=0p=0 then Q=0Q=0 ; so my question is why I could not obtain QQ with F1F_{1} , did I miss something?