One (and the simplest) way of getting to equations of motion in Hamiltonian mechanics is through calculus of variation. It is illuminating enough to consider 1-D senario at the beggining, since the higher dimensional case merely needs adding summation. First, we know that by definition:
H=pq˙−L where q is generalized coordinates and p is the corresponding generalized momentum. Of course, L is our old friend Lagrangian L(q,q˙,t).
Then, if we consider imposing variation on q and p so that, if we denote the true path of them as:
{q(t)p(t) We can impose also a variation on them:
{qα(t)=q(t)+γα(t)pα(t)=p(t)+γα′(t) Here, we can thing of gamma's as the difference between true path and altered path at any given time. If our system begins at t1 and ends at t2, we naturally have:
γα(t1)=γα(t2)=0 Because the two ends are known to us. Now, by definition of action, we see that the variation of action is:
δS=dα∂α∂∫t1t2dtL=dα∂α∂∫t1t2dt[pαq˙α−H] Now we want to move the partial derivative into the integration because the variation we impose is not related to time, also bear in mind that the partial derivative would hit term and we will be using chain rule here:
{δS=dα∂α∂∫t1t2dt[pαq˙α−H(p,p˙)]=dα∫dt[∂α∂pαq˙α+pα∂α∂q˙α−∂qα∂H∂α∂qα−∂pα∂H∂α∂pα] Then if we apply inverse by parts to the second term in the bracket, we see that:
∫t1t2dtpα∂α∂q˙α=[pα∂α∂qα]t1t2−∫t1t2dtp˙α∂α∂qα=0−∫t1t2dtp˙α∂α∂qα The term evaluated to zero because we know the ends have no variation.
Plug this result back into the original integration we see that:
0=δS=dα∫dt[∂α∂pαq˙α−p˙α∂α∂qα−∂qα∂H∂α∂qα−∂pα∂H∂α∂pα] If we re-group terms with the same partial derivative together, and argue that since those derivative are not necessariley zero, we must have:
{q˙=∂p∂Hp˙=−∂q∂H Which is what we wanted.