Given an initial system is a Hamiltonian. Show that a linear transformation of this system is also a Hamiltonian and find what the Hamiltonian is Given that the system
$$\dot x = f(x,y) \\ \dot y = g(x,y)$$
is Hamiltonian $H(x,y)$.
Introduce new coordinates $(z, w)$ defined by the linear transformation $z = ax + by\,$ and $w = cx + dy\,$ which we assume to be invertible. Show that the
system in the new coordinates is also Hamiltonian, and compute the new
Hamiltonian $\widetilde{H}(z, w)$.
My attempt: So I know that for a system to be a Hamiltonian it must be a fist integral, it must also obey that $\dot x = \frac{\partial H}{\partial y}$ and that $\dot y = -\frac{\partial H}{\partial x}$
And I can write the new coordiantes as $$\pmatrix{z \\ w} = \pmatrix{ a & b \\ c & d}\pmatrix{x \\ y}$$
So what I have said is that $$\frac{d\widetilde{H}}{dt} = \frac{d\widetilde{H}}{dz} \frac{dz}{dt} + \frac{d\widetilde{H}}{dw} \frac{dw}{dt}$$
But I am struggling here. If I assume the system to be Hamiltonian it is very easy to show that it is a first integral. But I don't know how to show this is a first integral without the assumption of it being a Hamiltonian
Edit: Here is the exact question asked

Now I've been trying to do this question for a few hours now and I really can't see how to do it. I know I can say that
$$\pmatrix{x \\ y} = \frac{1}{ad-bc}\pmatrix{ d & -b \\ -c & a}\pmatrix{z \\ w}$$
And I know that $x$ and $y$ are part of a Hamiltonian but I am really stuck here. Please can someone just help me out
 A: Let's write for simplicity $\begin{bmatrix}z\\w\end{bmatrix}=M\begin{bmatrix}x\\y\end{bmatrix}$. We start off by writing the DE for $z$ and $w$:
$$\begin{bmatrix}\dot{z}\\\dot{w}\end{bmatrix}=MJ\nabla_{(x,y)} H,\qquad (*)$$
where $J=\begin{bmatrix}0 &1\\-1&0\end{bmatrix}$ and $\nabla_{(x,y)} H=\begin{bmatrix}H_x\\H_y\end{bmatrix}$. Assuming that $z=z(x,y)$, resp. $w=w(x,y)$ and using the chain rule we get
$$\begin{bmatrix}\frac{\partial x}{\partial z}& \frac{\partial y}{\partial z}\\\frac{\partial x}{\partial w}& \frac{\partial y}{\partial w}\end{bmatrix}\begin{bmatrix}H_x\\H_y\end{bmatrix}=\begin{bmatrix}H_z\\H_w\end{bmatrix}.$$
We can easily observe that the matrix in front of $\nabla_{(x,y)}H$ is equal to $\left(M^{-1}\right)^T$. Noting that $(M^{-1})^T=(M^T)^{-1}$ we get
$$\nabla_{(x,y)}H=M^T\nabla_{(z,w)}H$$
and, taking into account (*) we finally arrive at 
$$\begin{bmatrix}\dot{z}\\\dot{w}\end{bmatrix}=MJM^T\nabla_{(z,w)} H,$$
where $MJM^T$ is a skew-symmetric matrix, $MJM^T=\det(M)J$ hence, the new system is Hamiltonian and $H(z,w)=\det(M)H(x,y)$.
The latter result can be obtained by considering transformation of the symplectic form: $dz\wedge dw=(adx+bdy)\wedge(cdx+ddy)=(ad-bc)dx\wedge dy$. 
