Finding a "Principle of Least Action" equivalent statement for Hamiltonian Mechanics The least-action principle is a statement in classical physics saying that all bodies in a system follow a trajectory that minimize the following functional (ignoring explicit time dependence for now):
$$
S[L] = \int dt L(x(t), \dot{x}(t)) \qquad\rightarrow\qquad 
\frac{d}{dt}\Big(\frac{\partial L}{\partial \dot{x}}\Big) - \frac{\partial L}{\partial x} = 0.
$$
The Hamiltonian of the same system can be constructed using the Legendre transform:
$$
H(p, x) = \dot{x}\cdot p - L(x, \dot{x})\;;\quad p \equiv \frac{\partial L}{\partial\dot{x}}.
$$
Pedagogically, one first studies Lagrangian Mechanics starting from the least-action principle, and eventually constructs an equivalent Hamiltonian Mechanics framework. But suppose I was a weird physicist who wanted to teach Hamiltonian mechanics first, and then later construct Lagrangian Mechanics. What would be the best way to do this?
 A: Well, if you don't mind explaining before Hamilton-Jacobi's equation then it's not impossible.
From the derivation of the Hamilton-Jacobi equation (see for yourself!) I have that
\begin{equation}
\mathrm{d}\mathcal{S}=p\ \mathrm{d}q-\mathcal{H}\ \mathrm{d}t
\end{equation}
Where $\mathcal{S}$ is the action, $p$ the generalized momentum, $\mathcal{H}$ the Hamiltonian and $q$ the generalized coordinate.
If you check your calculations I suggested you to do beforehand, then you can recognize that solving Hamilton-Jacobi basically imposes that $\mathrm{d}\mathcal{S}$ is an exact differential, i.e. I can write explicitly the following integral
\begin{equation}
\mathcal{S}[q(t)]=\int\left(p\ \mathrm{d}q-\mathcal{H}\ \mathrm{d}t\right)
\end{equation}
Well, then I can impose Hamilton's principle to this action and find an extremal! Note that
\begin{aligned}
\delta(p\ \mathrm{d}q)&=\delta p\ \mathrm{d}q+p\ \mathrm{d}\delta q\\
\delta\mathcal{H}&=\frac{\partial\mathcal{H}}{\partial p}\delta p+\frac{\partial\mathcal{H}}{\partial q}\delta q
\end{aligned}
Now if you do your calculations, if you look closely, the integral splits in two parts that multiply the variations of $p$ and $q$, while one part goes to zero in an integration by parts. Simply impose that those two parts must be simultaneously zero in order to satisfy Hamilton's principle and boom, you're done.
Note that for a completely pedagogical situation it's almost impossible to teach Hamiltonian mechanics before Lagrangian mechanics.

*

*It's much easier to derive HJE if you actually know what is actually a Lagrangian

*The physics gets sometimes lost in the mathematical abstractness, and it's not ideal in a classical mechanics course

*As you see in Lagrangian mechanics, generalized coordinates are not always real coordinates and can mean whatever, when you insert canonical momenta it just goes bonkers. See the Lotka-Volterra equations as an example or just think about this simple canonical transformation
\begin{equation}\left\{
\begin{aligned}
p&=q\\q&=p
\end{aligned}
\right.\end{equation}
I just switched momenta and coordinates, and the new Hamiltonian still solves HJE and the canonical equations of motion. In my honest opinion this idea before even really knowing how analytical mechanics works on the other side of the Legendre transform would almost irreparably confuse me.

Conclusion: Quite hard to do but not impossible, personally wouldn't do it.
A: *

*The Hamiltonian action reads
$$ S_H[q,p]:=\int \! dt\left(p_i\dot{q}^i-H(q,p,t)\right). $$
Its EL equations are Hamilton's equations.


*The equivalence between Lagrangian & Hamiltonian mechanics is discussed in e.g. this Phys.SE post.
