\documentclass[12pt]{article} % BB Feb 1 2010.
\textheight 9.0in
\textwidth  6.0in
\topmargin -0.4in  
\headsep    0.4in  
\oddsidemargin  0.25in  
\evensidemargin 0.25in  

\def\sqr#1#2{{\vcenter{\hrule height.#2pt
   \hbox{\vrule width.#2pt height#1pt \kern#1pt
      \vrule width.#2pt}
   \hrule height.#2pt}}}
\def\square{{\mathchoice\sqr64\sqr64\sqr{4.2}3\sqr{3.0}3}}
\def\undertext#1{$\underline{\smash{\hbox{#1}}}$}
\pagestyle{empty}

\begin{document}

\begin{center}
{\bf ADVANCED DYNAMICS --- PHY 4241/5227}\\\vspace {2mm} 
{\bf HOME AND CLASS WORK -- SET 3}\\%
\end{center}
\setcounter{equation}{0}

Solution for assignment 12: \bigskip

With 
$$ H = \left(\sum_j\dot{q}_j\,\frac{\partial L}{\partial\dot{q}_j} 
     - L \right) $$
we find
$$ dH\ =\ \sum_j \left[ 
 d \left(\frac{\partial L}{\partial\dot{q}_j}\right)\,\dot{q}_j +
 \frac{\partial L}{\partial\dot{q}_j}\,d\dot{q}_j -
 \frac{\partial L}{\partial\dot{q}_j}\,d\dot{q}_j -
 \frac{\partial L}{\partial q_j}\,dq_j \right]\ .               $$
The two central terms cancel out. Using Euler-Lagrange and the
definition of the generalized momentum, we have
$$ \frac{\partial L}{\partial q_j}\ =\ \frac{d~}{dt}
 \frac{\partial L}{\partial\dot{q}_j}\ =\ \dot{p}_j $$
and, therefore,
$$ dH\ =\ \sum_j\left( \dot{q}_j\,dp_j - \dot{p}_j\,dq_j\right)\ . $$
From this we read off Hamilton's equations:
$$ \frac{\partial H}{\partial p_j}\ =\ \dot{q}_j~~~{\rm and}~~~
   \frac{\partial H}{\partial q_j}\ =\ - \dot{p}_j\ .              $$
\end{document}
