I'm having some problems with an assignment where I have to state the Hamiltonian from the kinetic energy $T$ and potential energy $U$. These are as follows:
$$T(\dot{x},\dot{y})=2m\dot{x}^{2}+\frac{1}{2}m\dot{y}^{2}-m\dot{x}\dot{y}$$ and $$U(x,y)=-mgy+\frac{1}{2}k(y-l_{0})^{2}+U_{0},$$ where $m$, $g$, $k$, $l_{0}$ and $U_{0}$ are constants.
Now, I have to derive the generalised momenta $p_{x}$ and $p_{y}$, which I do with the equation:
$$p_{x}=\frac{\partial T}{\partial \dot{x}}$$ and $$p_{y}=\frac{\partial T}{\partial \dot{y}},$$ and I'm using only $T$ since the potential $U$ does not depend on the generalized coordinates.
This is pretty straightforward, and I end out with $\dot{x}$ and $\dot{y}$ given by the momenta as: $$\dot{x}=\frac{p_{x}+p_{y}}{4m}$$ and $$\dot{y}=\frac{p_{x}+p_{y}}{m}$$ Now the Hamiltonian should be simple to get, since I only have to insert these into the equation for the kinetic energy. But, according to the solution, I have to show that the Hamiltonian is given by: $$H(x,y,p_{x},p_{y}) = \frac{1}{6m}(p_{x}^{2}+2p_{x}p_{y}+4p_{y}^{2}) + U$$ But if I do what I said above I instead get: $$H(x,y,p_{x},p_{y}) = \frac{3}{8m}(p_{x}^{2}+2p_{x}p_{y}+p_{y}^{2}) + U$$ And I really can't figure out where I'm doing it wrong. Is my way to go not the correct ? Expressing $\dot{x}$ and $\dot{y}$ with respect to the momenta, and then just inserting it in the kinetic energy ?
Don't think the solution is wrong, but you never know. So yeah, I need some help to get moving :)