Let $H=q_1p_1-q_2p_2-aq_1^2+bq_2^2$ (with $a,b$ constant) be a Hamiltionian.
Show that $G=\dfrac{p_1-aq_1}{q_2}$ is a first integral (integral of motion) of this system.
According to the proposed solution, I need to show that the Poisson Bracket $[G,H] = 0$.
I used the following method, is this valid?
Other method?
The Hamiltionian equations are:
$$\dot q_1 = \dfrac{\partial H}{\partial p_1} = q_1 \qquad\qquad \dot q_2 = -p_2$$
$$\dot p_1 = -\dfrac{\partial H}{\partial q_1} = -p_1+2aq_1 \qquad\qquad \dot p_2 = q_2-2bq_2$$
Then, if $G$ is a integral of motion the total time derivative must equal zero (true?)
So:
$$\begin{align} \dfrac{\operatorname d G}{\operatorname d t} & = \dfrac{1}{q_2^2}\left[ q_2(\dot p_1-a\dot q_1) - \dot q_2(p_1-aq_1)\right]\\ &= \ldots \text{(substitution using the Hamiltionian equations)} \\ &= 0 \end{align}$$