Understanding a passage involving total and partial derivatives

42 Views Asked by At

I'm reading Michael Betancourt's "A Conceptual Introduction to Hamiltonian Monte Carlo". However my question is just about a particular passage involving total and partial derivatives.

On page 25, he defines:

Because of the decomposition of the joint density, the Hamiltonian, $$H(q,p)\equiv-\log\pi(q,p),$$ itself decomposes into two terms, \begin{align*} H(q,p) & \equiv-\log\pi(p\mid q) -\log\pi(q)\\ & \equiv K(p,q) +V(q). \end{align*}

and then goes on to define Hamilton's Equations:

\begin{align*} \frac{\mathrm{d}q}{\mathrm{d}t} & =+\frac{\partial H}{\partial p}=\frac{\partial K}{\partial p}\\ \frac{\mathrm{d}p}{\mathrm{d}t} &=-\frac{\partial H}{\partial q}=-\frac{\partial K}{\partial q}-\frac{\partial V}{\partial q}. \end{align*}

I don't follow the leftmost equality in each of the two lines above. How does he go from the total derivative $\frac{\text{d} q}{\text{d} t}$ to $+\frac{\partial H}{\partial p}$? From $\frac{\text{d} p}{\text{d} t}$ to $-\frac{\partial H}{\partial q}$?