# Hamiltons Equations of Motion

For an arbitrary function $F(q,p)$ the change of this function $\delta F$ is given by the partial derivative with respect to the independent variables times the change in that variable. \begin{align} \delta F(q,p)= \frac{\partial F}{\partial q} \delta q + \frac{\partial F}{\partial p} \delta p \tag{1} \end{align} A small change in the Hamiltonian is given by \begin{align} \delta H&= \sum_i \dot{q}_i \, \delta p_i + p_i \, \delta\dot{q}_i -\underbrace{\frac{\partial L}{\partial \dot{q}_i}}_{p_i}\delta\dot{q}_i - \underbrace{\frac{\partial L}{\partial q_i}}_{\dot{p}_i} \delta q_i \\ \delta H&= \sum_i \dot{q}_i \, \delta p_i - \dot{p}_i \, \delta q_i \end{align}