# Proving The Hamiltonian Is Invariant Under Coordinate Transformation

1. Nov 10, 2013

### embphysics

1. The problem statement, all variables and given/known data
(a) Consider a system with one degree of freedom and Hamiltonian $H = H (q,p)$ and a new pair of coordinates Q and P defined so that $q = \sqrt{2P} \sin Q$ and $p = \sqrt{2P} \cos Q$. Prove that if $\frac{\partial H}{\partial q} = - \dot{p}$ and $\frac{\partial H}{\partial p} = \dot{q}$, it automatically follows that $\frac{\partial H}{\partial Q} = - \dot{P}$ and $\frac{\partial H}{\partial P} = \dot{Q}$. 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 $H = \frac{1}{2}(q^2 + p^2)$.(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 $q = \sqrt{2P} \sin Q$. 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:

$H(q,p) = \dot{q}p - L(q, \dot{q})$

2. Nov 11, 2013

### ehild

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.

ehild

3. Nov 11, 2013

### embphysics

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?

4. Nov 11, 2013

### vanhees71

$$\frac{\mathrm{d}}{\mathrm{d} t} \sqrt{2P}=\frac{\dot{P}}{\sqrt{2P}}.$$

5. Nov 11, 2013

### embphysics

vanhees71, why wouldn't there be a 2 in the numerator? For the generalized velocity, I get $\dot{q} = 2\dot{P}(2P)^{-1/2} \sin Q + (2P)^{1/2}(\cos Q)\dot{Q}$

6. Nov 12, 2013

### ehild

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

ehild

7. Nov 12, 2013

### embphysics

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?

8. Nov 12, 2013

### ehild

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

$$\frac{\partial H}{\partial P} = \dot{Q}$$
$$\frac{\partial H}{\partial Q} = -\dot{P}$$

ehild

9. Nov 12, 2013

### embphysics

Okay, so for the generalized velocity I get $\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}$. What does this show? I don't quite understand the purpose of these steps.

10. Nov 12, 2013

### ehild

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

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

ehild

Last edited: Nov 12, 2013
11. Nov 12, 2013

### embphysics

I am not quite sure of what I'd prefer. Would the Hamiltonian look something like

$H = p \dot{q} - L$, where $L = \frac{1}{2} \dot{q}^2 - U(q)$. I am not sure if this is correct, though. I don't believe I can assume the potential function is simply $U(q)$, 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.

12. Nov 12, 2013

### embphysics

Okay, so I am trying to solve part (b), and here is my attempt:

$\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})$

and

$\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)$.

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.

13. Nov 12, 2013

### ehild

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.

ehild

14. Nov 12, 2013

### ehild

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.

ehild

15. Nov 12, 2013

### embphysics

Oh, I see. I have class now, but I'll begin working on this problem as soon as I can.

16. Nov 12, 2013

### embphysics

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, $\cal{H} = \mit{H} = T + U = \frac{1}{2} m \dot{q}^2 + \frac{1}{2} kq^2$. The generalized momentum is $p = \frac{\partial L}{\partial} \dot{q} = m\dot{q} \Rightarrow \dot{q} = \frac{p}{m}$

Substituting this in, and simplifying, yields the desired result: $\cal{H} = \frac{1}{2}(p^2 + q^2)$ (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 $\cal{H} \mit = \frac{1}{2} [(\sqrt{2P} \sin Q)^2 + (\sqrt{2P} \cos Q)^2]$. Because $\cos^2 Q + \sin^2 Q = 1$, the Hamiltonian reduces to $\cal{H} \mit = 2P$, 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.

17. Nov 15, 2013

### ehild

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

Go on with question d.

ehild

18. Nov 16, 2013

### ehild

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

$q = \sqrt{2P} \sin Q$, $p = \sqrt{2P} \cos Q$

and P and Q are functions p and q :

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

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

$\frac{\partial H}{\partial q} = - \dot{p}$

$\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}$

$- \dot{p}=-\frac{\partial p}{\partial Q} \dot{Q} -\frac{\partial p}{\partial P} \dot{P} \rightarrow$

$$\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}$$

Do the same with the other equation $\frac{\partial H}{\partial p} = \dot{q}$, 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.

ehild