# Hamiltonian -> Lagrangian

1. Dec 9, 2006

### Logarythmic

Consider the time-dependent Hamiltonian

$$H(q,p;t) = \frac{p^2}{2m \sin^2{(\omega t})} - \omega pq \cot{(\omega t)} - \frac{m}{2} \omega^2 \sin^2{(\omega t)} q^2$$

with constant m and $$\omega$$.
Find a corresponding Lagrangian $$L = L(q,\dot{q};t)$$

Ok, I know that the Hamiltonian is given by

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

where

$$p = \frac{\partial L}{\partial \dot{q}}$$

Is it as easy as

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

And how do I get rid of the p's?

2. Dec 9, 2006

### antonantal

Since $$p = \frac{\partial L}{\partial \dot{q}}$$ you can substitute $$p$$ in $$L(q, \dot{q};t) =\dot{q}p - H(q,p;t)$$ and solve the differential equation.

3. Dec 9, 2006

### Logarythmic

Yeah, nice equation.. Any tip on how to solve it?

4. Dec 10, 2006

### Logarythmic

I still need help... Anyone?

5. Dec 10, 2006

### Physics Monkey

You have a Hamiltonian H which is a function of q and p: H(q,p). From the Hamilton equations of motion you have that $$\dot{q} = \frac{\partial H(q,p)}{\partial p}$$. Now think about this equation for a minute, it gives you a formula for $$\dot{q}$$ in terms of q and p. But if you rearrange the equation by solving for p, it gives you a formula for p in terms q and $$\dot{q}$$. This is what you want! To see why form the object the $$p\dot{q} - H(q,p)$$ which is almost but not quite the Lagrangian. To make this quantity into the true Lagrangian you should substitute your formula for p in terms of q and $$\dot{q}$$ into this expression. This is the important step because you know the Lagrangian is a function of q and $$\dot{q}$$, not q and p.

6. Dec 10, 2006

### Logarythmic

Ok, then I get the Lagrangian

$$L = m \sin^2{(\omega t)} \left[ \left( \dot{q} + \omega t \cot{(\omega t)} \right) \left( \frac{1}{2} \dot{q} + \omega cot{(\omega t)} (1 - \frac{1}{2}q) \right) + \frac{1}{2} \omega^2 q^2 \right]$$

Now my mission is to "obtain, by choosing a suitable new coordinate, an equivalent time-independent Lagrangian $$\tilde{L}$$".
How is this supposed to be done?

7. Dec 10, 2006

### vanesch

Staff Emeritus
I don't know if this can help you, but a Lagrangian L and L' are equivalent (generate the same dynamics) if they differ by a total derivative to time of a function of q and t only:
$$L' = L + \frac{d F(q_i,t)}{dt}$$

I didn't check, but maybe you can get all the time depedence into that form...

8. Dec 10, 2006

### Logarythmic

I don't think that's what I'm supposed to do here. Referring to "by choosing a new coordinate"...

9. Dec 10, 2006

### Logarythmic

There are time-dependence in every term so that is not a possibility.. =/

10. Dec 10, 2006

### Physics Monkey

Logarythmic,

The first thing you should do is check your algebra. The Lagrangian you've displayed in post 6 contains a (1-q/2) which doesn't make sense because q has units. When you get the Lagrangian right the situation will look better.

11. Dec 10, 2006

### Logarythmic

Ok, I forgot a q so my correct Lagrangian is

$$L = m \sin^2{(\omega t)} \left[ \frac{\dot{q}^2}{2} + \omega q \dot{q} \cot{(\omega t)} + \frac{1}{2} \omega^2 q^2 (1 + \cot^2{(\omega t)} ) \right]$$

but there is still a time dependence in every term so writing it as

$$L = \tilde{L} + \frac{dF(q,t)}{dt}$$

will be hard..? Or?

12. Dec 10, 2006

### Physics Monkey

Ok, your Lagrangian looks good now. At this point I think there is a fairly straightforward guess you can make as to what your new coordinate should be. To make it even more clear, you might try completing the square for qdot.

PS The L' = L + df/dt thing isn't really important for this problem.

13. Dec 11, 2006

### Logarythmic

Completing the square?

14. Dec 11, 2006

### masudr

Completing the square

$$\begin{array}{rl} \alpha x^2 + \beta x + \gamma &= \alpha\left[ x^2 + \frac{\beta}{\alpha} x + \frac{\gamma}{\alpha}\right] \\ &= \alpha\left[ (x + \frac{\beta}{2 \alpha})^2 + (\frac{\gamma}{\alpha}-\frac{\beta^2}{4 \alpha^2}) \right] \end{array}$$

It looks a lot neater if we take $\alpha=1$:

$$x^2 + \beta x + \gamma = (x + \beta /2)^2 + (\gamma-\beta^2/4)$$

Last edited: Dec 11, 2006