# How to get lagragean when hamiltonian is given

1. Aug 18, 2011

### vrinda mukund

hai everyone,

the question is " the hamiltonian of a particle is H = [(p*p)/2m + pq] where q is the generalised coordinate and p is the corresponding canonical momentum. the lagragean is .................?

i know that H = p(dq/dt) - L. but the answer should not contain p. how can i solve it? answer is (m/2)(dq/dt - q)2

2. Aug 18, 2011

### G01

Remember Hamilton's equations, specifically:

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

Use this to get an expression for $p$ in terms of $\dot{q}$.

3. Aug 18, 2011

### vanhees71

$$L=\dot{q} p -H$$

and express $p$ via $\dot{q}$, where

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

$$\dot{q}=\frac{p}{m}+q \; \Rightarrow \; p=m(\dot{q}-q).$$

and

$$L=\dot{q} p-\frac{p^2}{2m}-p q =m \dot{q} (\dot{q}-q) - \frac{m}{2} (\dot{q}-q)^2 - m q(\dot{q}-q).$$

A bit simplified this gives

$$L=\frac{m}{2} (\dot{q}-q)^2.$$

4. Aug 18, 2011

### vrinda mukund

thank u sir!!!

5. Aug 19, 2011

### jewbinson

An important point here is that the Lagrangian is always a function of q, dq/dt, and time, whereas the Hamiltonian is always a function of q, p and time. So to get from the Hamiltonian to the Lagrangian we must get rid of p, and to get from the Lagrangian to the Hamiltonian we must get rid of dq/dt