Hamiltonian in terms of Lagrangian is "H = p \\cdot x - L", where "p = \\frac{\\partial L}{\\partial{\\dot x}} = 2 \\dot{x}". "H" is a function of "p, x".
Hence, "H = 2 \\dot{x} \\cdot \\dot{x} - \\dot{x}^2 + \\omega^2 x^2 = \\dot{x}^2 + \\omega^2 x^2 = \\frac{p^2}{4} + \\omega^2 x^2".
Hamiltonian equations are "\\dot{x} = \\frac{\\partial H}{\\partial p}", "\\dot{p} = - \\frac{\\partial H}{\\partial x}".
Using Hamilton above: "\\dot{x} = \\frac{p}{2}", "\\dot{p} = -2 \\omega^2 x".
Substituting "p = 2 \\dot{x}" from the first equation into the second, obtain "2 \\ddot{x} = - 2 \\omega^2 x", or "\\ddot{x} + \\omega^2 x = 0", which is the equation of motion of harmonic oscillator.
Comments
Leave a comment