It looks like the first equation that you refer to is a special case of Hamilton's principle, where the potential energy is taken to be constant. In the case of [tex]U = c[/tex], the Lagrangian is simply [tex](1/2)mv^2 + c[/tex], and hamilton's principle becomes
[tex]\delta \int \frac{1}{2} mv^2 {\mathrm d}t = 0 \Longrightarrow \delta \int mv^2 {\mathrm d}t = 0[/tex].
Since [tex]dt = {dx}/{v}[/tex], this is equivalent to
[tex]\delta \int mv {\mathrm d}x = 0[/tex].
This is usually written in the form
[tex]\delta \int p {\mathrm d}q = 0[/tex]
to emphasize that q is a generalized coordinate.