The two equations
The Hamiltonian H(q,p,t) generates the motion through Hamilton's canonical equations. They are the beating heart of the whole formalism, and their symmetry — one equation for how position changes, a nearly mirror-image one for how momentum changes — is not an accident.
Hamilton's equations: 2n first-order ODEs, one pair per degree of freedom.
Notice the crucial minus sign in the second equation — it is what makes the flow symplectic rather than a simple gradient descent, and it is the source of every conservation law we will meet. Read the pair as a rule: momentum pushes position forward; the slope of the potential (through H) pushes momentum.
Where they come from
The derivation is a one-line consistency check. Write the total differential of H = \sum p_i\dot q_i - L two ways. Treating H as a function of (q,p,t) gives dH = \sum(\partial H/\partial q_i\,dq_i + \partial H/\partial p_i\,dp_i) + \partial H/\partial t\,dt. Differentiating the definition directly, the \dot q\,dp and p\,d\dot q terms rearrange and the d\dot q pieces cancel because p_i=\partial L/\partial\dot q_i. Matching coefficients term by term, and using the Euler–Lagrange equation \dot p_i = \partial L/\partial q_i, gives exactly Hamilton's equations.
A bonus: the total time rate of H equals its explicit time dependence only.
Worked example: the harmonic oscillator in phase space
Take the mass–spring system executing simple harmonic motion. Its kinetic energy is p^2/2m and its potential is \tfrac12 m\omega^2 q^2, so the Hamiltonian is simply their sum. Let us solve it without ever writing \ddot q.
The oscillator Hamiltonian.
Apply the canonical equations. From \partial H/\partial p = p/m and \partial H/\partial q = m\omega^2 q we read off the two first-order equations directly:
Hamilton's equations for the oscillator.
Differentiate the first and substitute the second: \ddot q = \dot p/m = -\omega^2 q — the familiar SHM equation, recovered. But the phase-space view gives more. Because H=E is constant, every trajectory satisfies p^2/2m + \tfrac12 m\omega^2 q^2 = E: an ellipse. The state circulates around this ellipse forever, sweeping out a fixed area.
Each energy is a nested ellipse in the (q,p) plane.
Cyclic coordinates give conservation for free
Here is where the formalism sparkles. Suppose a coordinate q_i does not appear in H at all — it is called cyclic (or ignorable). Then \partial H/\partial q_i=0, so by Hamilton's second equation its conjugate momentum is constant. You spot a conservation law just by scanning which symbols are absent from H.
A cyclic coordinate implies a conserved conjugate momentum.
This is Noether's theorem wearing its simplest clothes: symmetry becomes conservation. Translational symmetry (no x in H) conserves linear momentum; rotational symmetry (no angle in H) conserves angular momentum; time-translation symmetry (no explicit t) conserves energy. Each conserved momentum lets you eliminate one degree of freedom, shrinking the problem.