1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Proving The Hamiltonian Is Invariant Under Coordinate Transformation

  1. Nov 10, 2013 #1
    1. The problem statement, all variables and given/known data
    (a) Consider a system with one degree of freedom and Hamiltonian [itex]H = H (q,p)[/itex] and a new pair of coordinates Q and P defined so that [itex]q = \sqrt{2P} \sin Q[/itex] and [itex]p = \sqrt{2P} \cos Q[/itex]. Prove that if [itex]\frac{\partial H}{\partial q} = - \dot{p}[/itex] and [itex]\frac{\partial H}{\partial p} = \dot{q}[/itex], it automatically follows that [itex]\frac{\partial H}{\partial Q} = - \dot{P}[/itex] and [itex]\frac{\partial H}{\partial P} = \dot{Q}[/itex]. In other words, the Hamiltonian formalism applies just as well to the new coordinates a to the old. (b) Show that the Hamiltonian of a one-dimensional harmonic oscillator with mass m = 1 and force constant k=1 is [itex]H = \frac{1}{2}(q^2 + p^2)[/itex].(c) Show that if you rewrite this Hamiltonian in terms of Q and P defined in the two equations above, then Q is ignorable. What is P?(d) Solve the Hamiltonian equation for Q(t) and verify that, when rewritten for q, your solution gives the expected behavior.

    2. Relevant equations

    3. The attempt at a solution
    All right, here is the solution I have written so far:

    The system under consideration is constrained to move in such a way that its position can be adequately described by a single coordinate. In this case, the coordinate is q. However, there is another single coordinate that sufficiently describes the system's position, too, and that would be Q. The coordinate transformation between Q and q is [itex]q = \sqrt{2P} \sin Q[/itex]. Given a position coordinate Q describing the system's position relative to some origin, we can find the corresponding coordinate q that describes the same location.

    Here is where I am having trouble, writing the Hamiltonian as a function of q and p:

    [itex]H(q,p) = \dot{q}p - L(q, \dot{q})[/itex]
  2. jcsd
  3. Nov 11, 2013 #2


    User Avatar
    Homework Helper

    You do not need to know the Hamiltonian, just transform the variables. Both q and p are function of the new variables Q and P. Determine the partial derivatives of H and the time derivatives of the "old" p and q in terms of the new variables and their time derivatives.

  4. Nov 11, 2013 #3
    All right, I am trying to find the velocity (the time derivative of q), and am running into a little difficulty with the chain.

    $q = \sqrt{2P} \sin Q$. Because of this relationship, I will have to use the chain rule, becaus P and Q may both depend on time:

    $\dot{q} = \sqrt{2 \dot{P}} \sin Q + \sqrt{2P} (\cos Q) \dot{Q}$

    Did I properly apply both of those rules?
  5. Nov 11, 2013 #4


    User Avatar
    Science Advisor
    Gold Member
    2017 Award

    Think about your derivatives! E.g.,
    [tex]\frac{\mathrm{d}}{\mathrm{d} t} \sqrt{2P}=\frac{\dot{P}}{\sqrt{2P}}.[/tex]
  6. Nov 11, 2013 #5
    vanhees71, why wouldn't there be a 2 in the numerator? For the generalized velocity, I get [itex]\dot{q} = 2\dot{P}(2P)^{-1/2} \sin Q + (2P)^{1/2}(\cos Q)\dot{Q}[/itex]
  7. Nov 12, 2013 #6


    User Avatar
    Homework Helper

    [itex]\frac {\partial \sqrt {2P}}{\partial P} = (1/2) (2P)^{-1/2} \cdot 2[/itex]

  8. Nov 12, 2013 #7
    Oh, yes. Of course, I forgot the power rule. The more I look at this problem the more I am unsure as to how to proceed. Why don't I need to write the Hamiltonian out?
  9. Nov 12, 2013 #8


    User Avatar
    Homework Helper

    Derive the expressions both for dq/dt and dp/dt, and also write the partial derivatives of H with respect q and p in terms of derivatives with respect to the new coordinate Q and momentum P.

    You do not need the Hamiltonian function itself, and you do not know it. Show that the relations are valid with the new coordinate and momentum, that is

    [tex]\frac{\partial H}{\partial P} = \dot{Q}[/tex]
    [tex]\frac{\partial H}{\partial Q} = -\dot{P}[/tex]

  10. Nov 12, 2013 #9
    Okay, so for the generalized velocity I get [itex]\dot{x} = \frac{\partial H}{\partial p} \Rightarrow \dot{P}(2P)^{-1/2} \sin Q + (2P)^{1/2}(\cos Q) \dot{Q} = \frac{\partial H}{\partial p}[/itex]. What does this show? I don't quite understand the purpose of these steps.
  11. Nov 12, 2013 #10


    User Avatar
    Homework Helper

    If you prefer to solve a) by writing out H try to do it.

    I suggest to do questions b) and c) first.

    Last edited: Nov 12, 2013
  12. Nov 12, 2013 #11
    I am not quite sure of what I'd prefer. Would the Hamiltonian look something like

    [itex] H = p \dot{q} - L[/itex], where [itex]L = \frac{1}{2} \dot{q}^2 - U(q)[/itex]. I am not sure if this is correct, though. I don't believe I can assume the potential function is simply [itex]U(q)[/itex], because that would be assuming the force is conservative, and that the PE is time independent.

    If this does happen to be correct, of course, I would have to replace the generalized velocity with the generalized momentum.
  13. Nov 12, 2013 #12
    Okay, so I am trying to solve part (b), and here is my attempt:

    [itex]\dot{q} = \frac{\partial H}{\partial p} \Rightarrow \int \dot{q} dp = \int \frac{\partial H}{\partial p} dp \Rightarrow H = p \dot{q} + f(\dot{q})[/itex]


    [itex]\dot{p} = - \frac{\partial H}{\partial q} \Rightarrow \int \dot{p} dq = \int \frac{\partial H}{\partial q} dq \Rightarrow H = - \dot{p}q - g(q) [/itex].

    I know I need to solve for the constants of integration, but I can't recall as to how that is done. The thing is, however, that this method doesn't seem very promising.
  14. Nov 12, 2013 #13


    User Avatar
    Homework Helper

    Well, you need to prove that the Hamiltonian equations are valid for the new coordinate and momentum, for all cases. You do not know the Lagrangian function in general.

  15. Nov 12, 2013 #14


    User Avatar
    Homework Helper

    You know L or H for a one-dimensional harmonic oscillator in terms of the coordinate x and momentum p= mdx/dt. It is a conservative system. H is the total energy. Show that it is 0.5(p2+q2) if m=1 and k=1.

  16. Nov 12, 2013 #15
    Oh, I see. I have class now, but I'll begin working on this problem as soon as I can.
  17. Nov 12, 2013 #16
    Okay, so for part (b) and (c), here is my work:

    Because the system is exhibiting simple harmonic motion, the forces acting on it can be described with Hooke's law; and because the force in Hooke's law depends only on position, it satisfies the condition of being a conservative force (is there a way of showing it satisfies the second condition, that the curl of the force is the zero vector?). From these circumstances, the Hamiltonian will simply be the total mechanical energy, [itex]\cal{H} = \mit{H} = T + U = \frac{1}{2} m \dot{q}^2 + \frac{1}{2} kq^2[/itex]. The generalized momentum is [itex]p = \frac{\partial L}{\partial} \dot{q} = m\dot{q} \Rightarrow \dot{q} = \frac{p}{m} [/itex]

    Substituting this in, and simplifying, yields the desired result: [itex]\cal{H} = \frac{1}{2}(p^2 + q^2)[/itex] (isn't this the square of the magnitude of the z vector in phase space?).

    For part (c): Is it true that the only reason why we can proceed with part (c) is because we've proved (or, in my case, am still trying to prove) in part (a), that to write down the Hamiltonian in terms of different coordinates (a different way of measuring position) we can simply use the equations that relate the two coordinate systems (the transformation equations, if you will), and substitute directly into the Hamiltonian we found for the first coordinate system; that is, we don't have to derive a new Hamiltonian for the 2nd coordinate system. And is this all true provided the relationship between the two coordinate systems doesn't explicitly involve time?

    Going off of this analysis, I get [itex]\cal{H} \mit = \frac{1}{2} [(\sqrt{2P} \sin Q)^2 + (\sqrt{2P} \cos Q)^2][/itex]. Because [itex]\cos^2 Q + \sin^2 Q = 1[/itex], the Hamiltonian reduces to [itex]\cal{H} \mit = 2P[/itex], from which we can see the Hamiltonian no longer depends on the generalized position Q, and the motion of the system can be described with the generalized momentum P.
  18. Nov 15, 2013 #17


    User Avatar
    Homework Helper

    Check factor 2. It should be H(P,Q)=P. So what is P in this case?

    Go on with question d.

  19. Nov 16, 2013 #18


    User Avatar
    Homework Helper

    As for question a), the variables p and q are functions of P and Q

    [itex]q = \sqrt{2P} \sin Q[/itex], [itex]p = \sqrt{2P} \cos Q[/itex]

    and P and Q are functions p and q :

    [itex]P=\frac{p^2+q^2}{2}[/itex], [itex]Q=\arctan(q/p)[/itex]

    Apply the chain rule to write the Hamiltonian equations in terms of the new variables.

    [itex]\frac{\partial H}{\partial q} = - \dot{p}[/itex]

    [itex]\frac{\partial H}{\partial q} = \frac{\partial H}{\partial Q} \frac{\partial Q}{\partial q} + \frac {\partial H}{\partial P} \frac{\partial P}{\partial q} [/itex]

    [itex] - \dot{p}=-\frac{\partial p}{\partial Q} \dot{Q} -\frac{\partial p}{\partial P} \dot{P} \rightarrow[/itex]

    [tex]\frac{\partial H}{\partial Q} \frac{\partial Q}{\partial q} + \frac {\partial H}{\partial P} \frac{\partial P}{\partial q} = -\frac{\partial p}{\partial Q} \dot{Q} -\frac{\partial p}{\partial P} \dot{P}[/tex]

    Do the same with the other equation [itex]\frac{\partial H}{\partial p} = \dot{q}[/itex], substitute the partial derivatives ∂P/∂q , ∂P/∂p, ∂Q∂q , ∂Q/∂p, and ∂p/∂Q , ∂p/∂P, ∂q/∂Q , ∂q/∂P. You get two equation for ∂H/∂Q and ∂H/∂P, solve for them.

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted