Hamilton's equation and Euler-Lagrange's equation comparison

  • Thread starter JD_PM
  • Start date
  • Tags
    Comparison
In summary, the momentum for a lagrangian is 1/2 times the sum of the momenta of the two components of the Lagrangian.
  • #1
JD_PM
1,131
158
Homework Statement
I will not use summation sign: repeated pair of (upper and lower) indices are summed over: [itex]\sum_{a} A_{a} B^{a} \equiv A_{a}B^{a} = A_{c}B^{c}[/itex] (summed over indices are dummy indices so you can rename them as you like).

Let ##V(q) = 0##. Then the Hamiltonian (##H = T + V##) and the Lagrangian (##L = T - V##) are equal:

$$H = L = 1/2 G_{ab} \dot q^a \dot q^b \ \ \ \ (1)$$

Show that you get ##(1)## either using Hamilton's equation ##\dot{p}_k=\frac{\partial L}{\partial q^k}## or Euler-Lagrange equation ##\frac{d}{dt} \Big(\frac{\partial L}{\partial \dot q^k }\Big) = \frac{\partial L}{\partial q^k}##
Relevant Equations
$$H = L = 1/2 G_{ab} \dot q^a \dot q^b$$

$$\dot{p}_k=\frac{\partial L}{\partial q^k}$$

$$\frac{d}{dt} \Big(\frac{\partial L}{\partial \dot q^k }\Big) = \frac{\partial L}{\partial q^k}$$
We know that the momentum for such a lagrangian is:

$$p_k = \frac{\partial L}{\partial \dot q^k} = 1/2 \Big( G_{ab} \delta_k^a \dot q^b + G_{ab} \delta_k^b \dot q^a\Big) = 1/2 \Big( G_{kb} \dot q^b + G_{ak} \dot q^a\Big) = G_{ak} \dot q^a$$

OK so using Hamilton's equation we get (and recalling that ##L = H## for this particular problem):

$$\dot p_a = -\frac{\partial H}{\partial q^a} = -\partial_a H = -1/2\partial_a G_{cb} \dot q^c \dot q^b \ \ \ \ (2)$$

By using ##\frac{d}{dt} \Big(\frac{\partial L}{\partial \dot q^k }\Big) = \frac{\partial L}{\partial q^k}## we get:

$$\frac{d}{dt} \Big(\frac{\partial L}{\partial \dot q^a }\Big) = \frac{d}{dt}\Big( G_{ab} \dot q^b\Big) = \frac{\partial L}{\partial q^a} = 1/2\partial_a G_{cb} \dot q^c \dot q^b \ \ \ \ (3)$$

Mmm so there's a sign difference between ##(2)## and ##(3)##. They should be equal. Why am I wrong?
 
Physics news on Phys.org
  • #2
I can't figure out what you are trying to do.

All I could think of is

a) Take ##L = \frac 1 2 G_{ab}\dot q^a \dot q^b##

b) Define ##H = p_k\dot{q}^k - L##, where ##p_k = \frac{\partial L}{\partial \dot q^k}##.

c) Show that ##H = L##.

Is that the exercise?
 
  • Like
Likes JD_PM
  • #3
You need to be very careful here. Even if you have no potential energy, the Hamiltonian and Lagrangian cannot be the same because the Hamiltonian is a function of ##q## and ##p## while the Lagrangian is a function of ##q## and ##\dot q##. Since the relation between ##p## and ##\dot q## generally depends on ##q##, the partial derivative of the Hamiltonian wrt q is not equal to the partial derivative of the Lagrangian wrt q. That is, generally
$$
\frac{\partial L}{\partial q} \neq \frac{\partial H}{\partial q}
$$
even if ##H = L## under the identification ##p = \partial L/\partial \dot q##.
 
Last edited:
  • Like
Likes JD_PM
  • #4
PeroK said:
I can't figure out what you are trying to do.

All I could think of is

a) Take ##L = \frac 1 2 G_{ab}\dot q^a \dot q^b##

b) Define ##H = p_k\dot{q}^k - L##, where ##p_k = \frac{\partial L}{\partial \dot q^k}##.

c) Show that ##H = L##.

Is that the exercise?

What you suggest is to do the following exercise:

Show that ##H = L## given ##L = \frac 1 2 G_{ab}\dot q^a \dot q^b##, ##H = p_k\dot{q}^k - L## and ##p_k = \frac{\partial L}{\partial \dot q^k}##

Solution:

$$H = p_a\dot{q}^a - L = G_{ba} \dot q^b \dot q^a - \frac 1 2 G_{ab}\dot q^a \dot q^b = \frac 1 2 G_{ba} \dot q^b \dot q^a$$

So indeed

$$H = L$$

But based on what Orodruin said, this cannot be correct because 'the Hamiltonian and Lagrangian cannot be the same'...
 
  • #5
Orodruin said:
Since the relation between ##p## and ##\dot q## generally depends on ##q##, the partial derivative of the Hamiltonian wrt q is not equal to the partial derivative of the Lagrangian wrt q. That is, generally
$$
\frac{\partial L}{\partial q} \neq \frac{\partial H}{\partial q}
$$
even if ##H = L## under the identification ##p = \partial L/\partial \dot q##.

Mmm I do not get your reasoning, could you please explain your argument based on an example?

Besides, why is the above exercise proposed by PeroK wrongly solved?
 
  • #6
JD_PM said:
What you suggest is to do the following exercise:

Show that ##H = L## given ##L = \frac 1 2 G_{ab}\dot q^a \dot q^b##, ##H = p_k\dot{q}^k - L## and ##p_k = \frac{\partial L}{\partial \dot q^k}##

Solution:

$$H = p_a\dot{q}^a - L = G_{ba} \dot q^b \dot q^a - \frac 1 2 G_{ab}\dot q^a \dot q^b = \frac 1 2 G_{ba} \dot q^b \dot q^a$$

So indeed

$$H = L$$

But based on what Orodruin said, this cannot be correct because 'the Hamiltonian and Lagrangian cannot be the same'...
Technically we have a third function, which I'll call ##H'##:

##H'(q, \dot q) = H(p(q, \dot q), \dot q)##

In this case ##H' = L##.
 
  • Love
Likes JD_PM
  • #7
PS The following appears a lot in physics texts:

You have some function ##\psi(x)##, say, and a change of variable ##x = f(y)##. Which leads to ##\psi(y)##. But, in fact, what we really have is a new function:

##\psi'(y) = \psi(f(y))##

To take an example. If ##\psi(x) = \sin(x)## and ##x = 2y##, then:

##\psi(y) = \sin(y)## (technically, as ##\psi## is simply the sine function)

But:

##\psi'(y) = \sin(2y)##

Is what's really meant. If we are taking about a real wave amplitude, say, then ##y = \pi/4## means ##x = \pi/2## and the amplitude should be ##1## when ##y = \pi/4## . Which it is for ##\psi'## but not for ##\psi##.
 
  • Love
Likes JD_PM
  • #8
JD_PM said:
Solution:


H=pa˙qa−L=Gba˙qb˙qa−12Gab˙qa˙qb=12Gba˙qb˙qa​
This is incorrect because, as already mentioned, the Hamiltonian is a function of q and p, not q and ##\dot q##. You obtain the Hamiltonian from the Lagrangian by insering ##\dot q## as a function of q and p where ##p = \partial L/\partial \dot q##.

Take the simplest example ##L = m \dot q^2/2##. You would find that ##p = m\dot q## and therefore ##\dot q = p/m## leading to ##H = p^2/(2m)##. Here, neither L or H depend on q so the partial derivatives both vanish. However, this would not be the case if you let m depend on q.
 
  • Informative
Likes JD_PM
  • #9
PeroK said:
Technically we have a third function, which I'll call ##H'##:

##H'(q, \dot q) = H(p(q, \dot q), \dot q)##

In this case ##H' = L##.

Oh I think I see it now. The issue is that we get a function (which you labeled ##H'##) which is a function of ##q## and ##\dot q##. By definition this cannot be the Hamiltonian, as ##H(q, p)## is certainly not ##H'(q, \dot q)##. Thus we need to apply a change of variables to get the Hamiltonian out of ##H'(q, \dot q)##; in this case we need ##\dot q = p(q, \dot q)##.

By the way, I think there is a typo in #6;

I get:

$$H'(q, \dot q) = H(q, p(q, \dot q))$$

Where I've used the change of variables ##\dot q = p(q, \dot q)##

Instead of ##H'(q, \dot q) = H(p(q, \dot q), \dot q)##

Do you agree?
 
  • #10
JD_PM said:
Oh I think I see it now. The issue is that we get a function (which you labeled ##H'##) which is a function of ##q## and ##\dot q##. By definition this cannot be the Hamiltonian, as ##H(q, p)## is certainly not ##H'(q, \dot q)##. Thus we need to apply a change of variables to get the Hamiltonian out of ##H'(q, \dot q)##; in this case we need ##\dot q = p(q, \dot q)##.

By the way, I think there is a typo in #6;

I get:

$$H'(q, \dot q) = H(q, p(q, \dot q))$$

Where I've used the change of variables ##\dot q = p(q, \dot q)##

Instead of ##H'(q, \dot q) = H(p(q, \dot q), \dot q)##

Do you agree?

Hmm ... I guess it depends what we mean by the "Hamiltonian". Like the Lagrangian, it takes a different form in different coordinates.

If we take ##L, H, H'## to be specific functions (of specific variables), then we need to stay consistent in what these mean.

The way I defined ##H## in post #3 I think is consistent with post #6.
 
  • Like
Likes JD_PM
  • #11
PeroK said:
Hmm ... I guess it depends what we mean by the "Hamiltonian". Like the Lagrangian, it takes a different form in different coordinates.

Your Hamiltonian is a function of ##p## and ##\dot q##. I think that the Hamiltonian has to be ##H(q, p)## (by definition) instead.
 
  • #12
JD_PM said:
Your Hamiltonian is a function of ##p## and ##\dot q##. I think that the Hamiltonian has to be ##H(q, p)## (by definition) instead.
How do you define it?
 
  • #13
JD_PM said:
Your Hamiltonian is a function of ##p## and ##\dot q##. I think that the Hamiltonian has to be ##H(q, p)## (by definition) instead.
This is correct.

PeroK said:
How do you define it?
What he is saying is that you wrote that the Hamiltonian is a function of ##p## and ##\dot q##. It is a function of ##p## and ##q##.
 
  • Like
Likes JD_PM
  • #14
Orodruin said:
...he...

He/she/bot ... :rolleyes:
 
  • #15
OK So my answer to #1 would be:

This exercise is faulty; let's argue why

It asks to show that

$$H = L = 1/2 G_{ab} \dot q^a \dot q^b \ \ \ \ (1) $$

We know that ##L(q, \dot q) = 1/2 G_{ab} \dot q^a \dot q^b##

But

$$H'(q, \dot q) = p_a\dot{q}^a - L = G_{ba} \dot q^b \dot q^a - \frac 1 2 G_{ab}\dot q^a \dot q^b = \frac 1 2 G_{ba} \dot q^b \dot q^a$$

And of course

$$H'(q, \dot q) \neq H(q, p)$$

Thus ##(1)## should be:

$$H(q, p) \neq H'(q, \dot q) = L(q, \dot q) = 1/2 G_{ab} \dot q^a \dot q^b \ \ \ \ (1) $$

I think I got it! Thank you both :)

WoW I am learning a lot these days...
 
  • Like
Likes PeroK
  • #16
JD_PM said:
Oh I think I see it now. The issue is that we get a function (which you labeled ##H'##) which is a function of ##q## and ##\dot q##. By definition this cannot be the Hamiltonian, as ##H(q, p)## is certainly not ##H'(q, \dot q)##. Thus we need to apply a change of variables to get the Hamiltonian out of ##H'(q, \dot q)##; in this case we need ##\dot q = p(q, \dot q)##.

By the way, I think there is a typo in #6;

I get:

$$H'(q, \dot q) = H(q, p(q, \dot q))$$

Where I've used the change of variables ##\dot q = p(q, \dot q)##

Instead of ##H'(q, \dot q) = H(p(q, \dot q), \dot q)##

Do you agree?

Yes, you're right. The correct functional form of ##H## is as a function of ##q, p##.
 
  • Like
Likes JD_PM

1. What is the difference between Hamilton's equation and Euler-Lagrange's equation?

Hamilton's equation and Euler-Lagrange's equation are two different mathematical approaches used to describe the dynamics of a physical system. While both equations aim to solve for the equations of motion of a system, they differ in the variables they use and the assumptions they make.

2. Which equation is more commonly used in physics?

Euler-Lagrange's equation is more commonly used in physics because it is a more general form of the equations of motion. It can be applied to a wider range of physical systems, including classical mechanics, electromagnetism, and quantum mechanics.

3. What are the variables used in Hamilton's equation and Euler-Lagrange's equation?

Hamilton's equation uses the generalized coordinates and momenta of a system, while Euler-Lagrange's equation uses the generalized coordinates and velocities. The two equations are related through a mathematical transformation known as a Legendre transformation.

4. How do Hamilton's equation and Euler-Lagrange's equation handle constraints?

Both equations can handle constraints, but they use different methods. Hamilton's equation uses Lagrange multipliers to incorporate constraints into the equations, while Euler-Lagrange's equation uses the principle of virtual work to account for constraints.

5. Can Hamilton's equation and Euler-Lagrange's equation be used interchangeably?

No, Hamilton's equation and Euler-Lagrange's equation are not interchangeable. They are mathematically different and have different applications. However, in some cases, they can lead to the same equations of motion for a system.

Similar threads

  • Advanced Physics Homework Help
Replies
15
Views
1K
  • Advanced Physics Homework Help
3
Replies
81
Views
6K
  • Advanced Physics Homework Help
Replies
2
Views
828
  • Advanced Physics Homework Help
Replies
1
Views
902
  • Advanced Physics Homework Help
Replies
11
Views
1K
  • Advanced Physics Homework Help
Replies
16
Views
917
  • Introductory Physics Homework Help
Replies
15
Views
294
Replies
7
Views
5K
  • Advanced Physics Homework Help
Replies
1
Views
1K
  • Advanced Physics Homework Help
Replies
6
Views
2K
Back
Top