# Proving one of the canonical Hamilton equations

I have a homework question asking me to prove that $\frac{\partial \mathcal{H}}{\partial t}=-\frac{\partial\mathcal{L}}{\partial t}$, and the hint is to first consider a system with one degree of freedom where the equation for the Hamiltonian simplifies to $\mathcal{H}(q,p,t)=p\dot{q}(q,p,t)-\mathcal{L}(q,\dot{q}(q,p,t),t)$. Now I tried to take the partial derivative with respect to time but I'm not sure that I'm doing it right, for my first step I get $$\frac{\partial\mathcal{H}}{\partial t}=p\frac{\partial \dot{q}(q,p,t)}{\partial t}\frac{\partial q}{\partial t}-\frac{\partial \mathcal{L}(q,\dot{q}(q,p,t),t)}{\partial t}\frac{\partial q}{\partial t}\frac{\partial \dot{q}(q,p,t)}{\partial t}\frac{\partial q}{\partial t}$$
I'll spare you the details of simplifying, but I get stuck at $$\frac{\partial\mathcal{H}}{\partial t}=-\frac{\partial \mathcal{L}}{\partial t}\Big(\frac{\partial ^2q}{\partial t^2}\frac{\partial\dot{q}}{\partial t}-\frac{\partial q}{\partial t}\Big)$$ So in theory, the stuff in the parenthesis should equal one if I'm doing this right, but I'm unsure if I am. Any help would be greatly appreciated!

• The dimensions in your last expression don't seem to be right; can you go back and carefully check dimensions at every step? – knzhou Jan 15 '18 at 22:13
• What do you mean by the dimensions don't seem to be right? – redsox133 Jan 15 '18 at 22:15
• What @knzhou means is that if you look at the terms inside the parentheses, then the space and time dimensions don't match. The first term is $L^2T^{-4}$, while the second term is $LT^{-1}$. I am sure if you check for errors you will arrive at the right answer. – Sayan Mandal Jan 15 '18 at 22:22
• Oh ok, turns out I forgot a two in the exponent of the denominator of the term on the left, but I do see what you mean. – redsox133 Jan 15 '18 at 22:25
• Also does that mean the first step appears to be correct? – redsox133 Jan 15 '18 at 22:25

Your opening non inline equation is also incorrect on dimensional grounds, the first factor by $LT^{-1}$ and the second by $L^3 T^{-4}$.

For a one dimensional system as you are considering here, $H=H(q,p,t)$, and so one has $$dH = \frac{\partial H}{\partial q}dq + \frac{\partial H}{\partial p}dp + \frac{\partial H}{\partial t}dt\,\,\,\,\,\,(1)$$ generically.

From the explicit realisation of the hamiltonian function as a legendre transform of the lagrangian, as you have written in your question, we also find $$dH = p \,d \dot{q} + dp \, \dot q - \left(\frac{\partial L}{\partial q}dq + \frac{\partial L}{\partial \dot q}d \dot q + \frac{\partial L}{\partial t}dt\right)$$

This can be simplified in favour of writing the single generalised momenta in terms of the generalised velocity $p = \partial L/\partial \dot q$ to obtain $$dH = dp \, \dot q - \frac{\partial L}{\partial q}dq - \frac{\partial L}{\partial t}dt\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,(2)$$

Comparing $(1)$ and $(2)$ will give you your desired relation, in addition to two other equations which collectively comprise Hamilton's equations.

You can also proceed more directly using your legendre transform. Since there is explicit and implicit instances of $t$ in the legendre transform, it is fruitful to extract a total derivative of $H$ with respect to $t$. So, $$\frac{d H}{dt} = p \frac{d \dot q}{dt} - \frac{dL}{dt} = p \frac{d \dot q}{dt} - \left(\frac{\partial L}{\partial \dot q} \frac{d \dot q}{dt} + \frac{\partial L}{\partial t} \right) = -\frac{\partial L}{\partial t}.$$

Using $(1)$ together with the Hamilton's equations, you find in fact $dH/dt = \partial H/\partial t$ obtaining again $$\frac{\partial H}{\partial t} = -\frac{\partial L}{\partial t}$$

• This helped me figure it out, I eventually got it. Turns out I didn't do chain rule properly, once I fixed that the problem worked itself out fairly easily. Thanks! – redsox133 Jan 26 '18 at 1:49
• No worries :) if you feel your question has been answered please accept my answer to close the issue. – CAF Jan 26 '18 at 6:39