# Hamiltonian mechanics and conservation of energy?

Can anyone explain to me Hamiltonian mechanics relation to conservation of energy? I'm not very good at mathematics, and I know it's important into understanding Hamiltonian mechanics. However, can it be explained in a simple way?

-

Recall that we say a physical quantity $Q$ is conserved provided its value does not change with time as a system evolves. Mathematically, a physical quantity is just a function that assigns a number $Q(q,p,t)$ to each state (point in phase space plus time) of the system at hand, so conservation of such a quantity can be expressed mathematically as follows: \begin{align} \frac{d}{dt} Q(q(t), p(t),t) = 0 \end{align} for all $(q(t), p(t))$ that are solutions to the equations of motion of the system.

The Hamiltonian $H$ and total energy $E$ of a given system are two such quantities. There is a large class of systems for which the hamiltonian and the total energy are the same, namely $H=E$. In such systems, the energy of the system is conserved if and only if the Hamiltonian of the system is conserved.

-
This answer could be improved by adding that, for not explicitly time-dependent Hamiltonians, the Hamiltonian is always conserved along a trajectory that is a solution to the e.o.m. – ACuriousMind Nov 21 at 14:03
I was recently reminded in bead on rotating ring that the Hamiltonian does not represent the physical energy of the bead. A pitfall worth mentioning? – Keith McClary Nov 21 at 17:54

The time evolution of any quantity $F(q(t),p(t);t)$, where $q,p$ denote the generalized positions and momenta, can be written using the chain rule, Hamilton's equations and the Poisson bracket $\{\cdot,\cdot\}$:

$\frac{\mathrm dF}{\mathrm dt} = \sum_i\left[\frac{\partial F}{\partial q_i}\dot q_i+\frac{\partial F}{\partial p_i}\dot p_i\right]+\frac{\partial F}{\partial t} = \sum_i\left[\frac{\partial F}{\partial q_i}\frac{\partial H}{\partial p_i}-\frac{\partial F}{\partial p_i}\frac{\partial H}{\partial q_i}\right]+\frac{\partial F}{\partial t} = \{F,H\}+\frac{\partial F}{\partial t}$.

A similar equation called Ehrenfest's theorem also holds in quantum mechanics where one considers the time evolution of expectation values and the Poisson bracket is replaced by the commutator.

In particular, for $F=H$ one immediately sees that $\frac{\mathrm dH}{\mathrm dt}=\frac{\partial H}{\partial t}$ as $\{H,H\}=0$. Thus, for a Hamiltonian w/o explicit time-dependence, i.e. when no external energy is fed into the system, the total energy is conserved.

-

Hamiltonian can be written as : $dH=\frac{\partial H}{\partial q_i}dq_i+\frac{\partial H}{\partial p_i}dp_i+\frac{\partial H}{\partial t}dt$.
or,$\frac{dH}{dt}=\frac{\partial H}{\partial q_i}\dot{q_i}+\frac{\partial H}{\partial p_i}\dot{p_i}+\frac{\partial H}{\partial t}$.
We lso know that $\frac{\partial H}{\partial p_i}=\dot{q_i}$ and $\frac{\partial H}{\partial q_i}=-\dot{p_i}$
Putting those in the equation we get ;
$\frac{dH}{dt}=\frac{\partial H}{\partial t}=-\frac{\partial L}{\partial t}$ (because $H=\dot{q_i}pi-L$)
If Lagrangian does not depend explicitly on time then we can say that the Hamiltonian is conserved.

-
1. There should not be any $d$s in front of the dotted terms. 2. You don't answer the question because you don't explain how this is connected to energy conservation. – ACuriousMind Nov 21 at 14:02
Sorry for that mistake. – Swarnadeep Seth Nov 22 at 16:38