Independence of position and momentum in action Why are position and momentum independent with respect to the Hamiltonian Action $S_H$ given by
$$
S_H = \int_{t_1}^{t_2} (p \dot q - H) dt  \ \ \ ? \tag{1}
$$
While deriving Hamilton's equations from this action by varying the path, we assume that the variation in positions $\delta q$ is independent of the variation in momentum $\delta p$ and hence, we get 2$n$ equations. However, in the Lagrangian Action
$$
S_L = \int_{t1}^{t_2} L dt \tag{2}
$$
we show that the variations in position and velocity are related by
$$
\delta \dot q = \frac{d}{dt} \delta q \tag{3}
$$
How can position and momentum be independent but not position and velocity in the same set-up? Aren't velocity and momentum intrinsically the same thing?
(The Hamiltonian action was referred to in Qmechanics' answer to a similar question, but I couldn't show that the position and momentum are independent for the Hamiltonian action. Any help proving this would be much appreciated.)
 A: *

*Lagrangian mechanics takes place in configuration space with coordinates $q$. The Lagrangian is a function of $q$ and $\dot q$, the latter being the time derivative of the former.


*Hamiltonian mechanics takes place in phase space, with coordinates $(q,p)$. The relationship between the two is one of Hamilton's equation of motion. When deriving these equations of motion from an action principle, you have no choice but to consider them independent variables. For example, with the usual $H(p,q) = \frac{p^2}{2m} + V(q)$, one of Hamilton's equation is :
$$\dot q =  \frac{\partial H}{\partial p} = \frac{p}{m}$$


*There is a connection between the two formalism (when the kinetic term is nice enough) :

*

*from a Lagrangian $L(q,\dot q)$, taking the Legendre transform with respect to $\dot q$ gives a Hamiltonian $H(q,p)$ such that, taken together, both of Hamilton's equations are equivalent to the Euler-Lagrange equation. This means that from the configuration space with coordinate $q$ and Lagrangian function $L(q,\dot q)$, we can build a phase space with coordinates $(q,p)$ and a Hamiltonian function on it $H(q,p)$ such that the dynamics of $q$ under Hamilton's equations of motion is identical to the one under Euler-Lagrange.

*The converse is a bit subtler : from a phase space $(q,p)$ and  a Hamiltonian $H(q,p)$, we take the Legendre transform and define a function $L(q,v) = vp - H(q,p)$. The new variable introduced by the Legendre transform is fixed by $ v = \partial H/ \partial p$ so by Hamilton's equation we see that $v=  \dot q$. Therefore, we can choose to consider only the configuration space $(q)$ and let the dynamics be governed by the Euler-Lagrange equations.



