# Equivalence between Hamiltonian and Lagrangian Mechanics

I'm reading a proof about Langrangian => Hamiltonian and one part of it just doesn't make sense to me.

The Lagrangian is written $L(q, \dot q, t)$, and is convex in $\dot q$, and then the Hamiltonian is defined via the Legendre transform $$H(p,q,t) = \max_{\dot q} [p \cdot \dot q - L(q, \dot q, t)]$$

Under the right conditions there exists a function $\dot Q (p,q,t)$ such that $$H(p,q,t) = p \cdot \dot Q(p,q,t) - L(q, \dot Q(p,q,t), t)$$ i.e. when some $\dot Q(p,q,t)$ satisfies $p = \frac{\partial L}{\partial \dot q}\rvert_{(q, \dot Q(p,q,t), t)} = \frac{\partial L}{\partial \dot q}(q, \dot Q(p,q,t), t)$ (Finding this function is usually called "inverting p")

By taking partials in the $p$ variable and using the relationship, we can obtain the relationship $$\dot Q = \frac{\partial H}{\partial p}$$

Because of the notation I chose, I get the strong urge to say $\dot q = \frac{\partial H}{\partial p}$ , and in fact this is what the textbook does. But have we proved this?

In other words, how can we deduce that $$q'(t) = \frac{\partial H}{\partial p}(p(t), q'(t), t)$$ for any differentiable vector valued function $q$? (or maybe there are more conditions we need on $q$? Here $$p(t) = \frac{\partial L}{\partial \dot q}(q(t), q'(t), t)$$ according to Lagrange's equations.

-
What does your notation $\frac{\partial L}{\partial \dot q} (q, \dot Q(p,q,t), t)$ mean? The way it's written it looks like $L$ doesn't depend on $\dot q$, so that partial derivative should be zero. – Nathaniel Mar 31 '14 at 6:55
Sorry, it means with respect to the second variable. You do the partial with the second variable and then substitute $\dot Q$. I wrote it that way because that's how it's usually written in physics books. – Mark Mar 31 '14 at 7:04
I see, thanks. (I would write it $\left.\frac{\partial L(q,\dot q, t)}{\partial \dot q}\right|_{\dot Q(p,q,t)}$, but then I often find myself notating things differently from the conventions physicists use.) – Nathaniel Mar 31 '14 at 7:29
It is the other way around, the usual definition is p=∂L\∂q'. Then you can express dq\dt in terms of p and q. – Urgje Mar 31 '14 at 9:18
Which textbook are you using? I've never seen $p$ defined that way before. It's always defined as $\partial L/\partial\dot{q}$, or some variant thereof, in the texts I've seen. – webb Apr 2 '14 at 17:19

Ok, let us start from scratch. A function $g: \mathbb R^n \to \mathbb R$ with $f \in C^2(\mathbb R^n)$ is said to be convex if its Hessian matrix (i.e. the one with coefficients $\partial^2 f/\partial x_i \partial x_j$) is everywhere (strictly) positively defined.

Let $\Omega \subset \mathbb R \times \mathbb R^n$ be an open set and focus on a jointly $C^2$ Lagrangian function $\Omega \times \mathbb R^n \ni (t,q,\dot{q}) \mapsto L(t, q, \dot{q}) \in \mathbb R$.

For fixed $(t,q) \in \Omega$, $L$ is assumed to be convex as a function of $\dot{q}$. In other words $\mathbb R^n \ni \dot{q} \mapsto L(t, q, \dot{q}) \in \mathbb R$ is supposed to be convex.

Referring to either systems made of points of matters or solid bodies, convexity arises form the structure of the kinetic energy part of Lagrangians, which are always of the form $T(t, q, \dot{q}) - V(t, q)$, even considering generalized potentials $V(t,q, \dot{q})$ with linear dependence on $\dot{q}$, as is the case for inertial or electromagnetic forces or inertial forces also in the presence of holonomic ideal constraints.

The associated Hamiltonian function is defined as the Legendre transformation of $L$ with respect to the variables $\dot{q}$. In other words:

$$H(t,q,p) := \max_{\dot{q} \in \mathbb R^n}\left[p\cdot \dot{q} - L(t, q, \dot{q})\right]\qquad (1)$$

Within our hypotheses on $L$, from the general theory of Legendre transformation, it arises that, for fixed $(t,q) \in \Omega$, a given $p \in \mathbb R^n$ is associated with exactly one $\dot{q}(p)_{t,q} \in \mathbb R^n$ where the maximum of the RHS in (1) is attained (for $n=1$ the proof is quite evident, it is not for $n>1$).

Since $\dot{q}(p)_{t,q}$ trivially belongs to the interior of the domain of the function $\mathbb R^n \ni \dot{q} \mapsto p\cdot \dot{q} - L(t, q, \dot{q})$, it must be:

$$\left.\nabla_{\dot{q}} \right|_{\dot{q}= \dot{q}(p)_{t,q}} \left( p\cdot \dot{q} - L(t, q, \dot{q})\right) =0\:.$$ In other words (always for fixed $t,q$): $$p = \left.\nabla_{\dot{q}} \right|_{\dot{q}(p)_{t,q}} L(t, q, \dot{q})\:, \quad \forall \dot{q} \in \mathbb R^n\qquad (2)$$

As a consequence, (always for fixed $(t,q)\in \Omega$) the map $\mathbb R^n \ni p \mapsto \dot{q}(p)_{t,q} \in \mathbb R^n$ is injective, because it admits a right inverse given by the map $\mathbb R^n \ni \dot{q} \mapsto \nabla_{\dot{q}} L(t, q, \dot{q})$ which, in turn, is surjective. However the latter map is also injective, as one easily proves using the convexity condition and the fact that the domain $\mathbb R^n$ is trivially convex too. The fact that the $\dot{q}$-Hessian matrix of $L$ is non-singular also implies that the map (2) is $C^1$ with its inverse.

Summing up, the map (2) is a $C^1$ diffeomorphism from $\mathbb R^n$ onto $\mathbb R^n$ and, from (1), we have the popular identity describing the interplay of the Hamiltonian and Lagrangian functions as:

$$H(t,q,p) = p\cdot \dot{q} - L(t, q, \dot{q})\qquad (3)$$

which holds true when $p \in \mathbb R^n$ and $\dot{q} \in \mathbb R^n$ are related by means of the $C^1$ diffeomorphism from $\mathbb R^n$ onto $\mathbb R^n$ (for fixed $(t,q)\in \Omega$): $$p = \nabla_{\dot{q}} L(t, q, \dot{q})\:, \quad \forall \dot{q} \in \mathbb R^n\qquad (4)\:.$$

By construction, $H= H(t,q,p)$ is a jointly $C^1$ function defined on $\Gamma := \Omega \times \mathbb R^n$. I stress that $L$ is defined on the same domain $\Gamma$ in $\mathbb R^{2n+1}$. The open set $\Gamma$ is equipped by the diffeomorphism: $$\psi: \Gamma \ni (t,q, \dot{q}) \mapsto (t,q, p) \in \Gamma \qquad (4)'$$ where (4) holds.

Let us study the relationship between the various derivatives of $H$ and $L$.

I remark that I will not make use of Euler-Lagrange or Hamilton equations anywhere in the following.

Consider a $C^1$ curve $\gamma: (a,b) \ni t \mapsto (t, q(t), \dot{q}(t)) \in \Gamma$, where $t$ has no particular meaning and $\dot{q}(t)\neq \frac{dq}{dt}$ generally. The diffeomorphism $\psi$ transform that curve into a similar $C^1$ curve $t \mapsto \psi(\gamma(t)) = \gamma'(t)$ I will also indicate by $\gamma': (a,b) \ni t \mapsto (t, q(t), p(t)) \in \Gamma$.

We can now evaluate $H$ over $\gamma'$ and $L$ over $\gamma$ and compute the total temporal derivative taking (3) and (4) into account, i.e. we compute:

$$\frac{d}{dt} H(t, q(t),p(t)) = \frac{d}{dt}\left(p(t) \dot{q}(t) - L(t,q(t),p(t)) \right)\:.$$

Computations gives rise almost immediately to the identity, where both sides are evaluated on the respective curve:

$$\frac{\partial H}{\partial t} + \frac{dq}{dt}\cdot \nabla_q H + \frac{dp}{dt}\cdot \nabla_p H = \frac{dp}{dt}\dot{q} + p \frac{d\dot{q}}{dt} -\frac{\partial L}{\partial t} - \frac{dq}{dt}\cdot \nabla_q L - \frac{d\dot{q}}{dt}\cdot \nabla_{\dot{q}} L \:.$$ In the RHS, the second and the last term cancel each other in view of (4), so that: $$\frac{\partial H}{\partial t} + \frac{dq}{dt}\cdot \nabla_q H + \frac{dp}{dt}\cdot \nabla_p H = \frac{dp}{dt}\dot{q} -\frac{\partial L}{\partial t} - \frac{dq}{dt}\cdot \nabla_q L \:.$$ Rearranging the various terms into a more useful structure: $$\left(\frac{\partial H}{\partial t}|_{\gamma'(t)} + \frac{\partial L}{\partial t}|_{\gamma(t)}\right) + \frac{dq}{dt}\cdot \left( \nabla_q H|_{\gamma'(t)} + \nabla_q L|_{\gamma(t)}\right) + \frac{dp}{dt}\cdot \left(\nabla_p H|_{\gamma'(t)} - \dot{q}|_{\gamma(t)}\right) =0\:.\qquad (5)$$

Now observe that actually, since $\gamma$ is generic, $\gamma(t)$ and $\gamma'(t)= \psi(\gamma(t))$ are generic points in $\Gamma$ (however connected by the transformation (4)). Moreover, given the point $(t,q, \dot{q}) = \gamma(t) \in \Gamma$, we are free to choose the derivatives $\frac{dq}{dt}$ and (using the diffeomorphism) $\frac{dp}{dt}$ as we want, fixing $\gamma$ suitably. If we fix to zero all these derivatives, (5) proves that, if $(t,q, \dot{q})$ and $(t,q,p)$ are related by means of (4):

$$\left(\frac{\partial H}{\partial t}|_{(t,q,p)} + \frac{\partial L}{\partial t}|_{(t,q, \dot{q})}\right) =0\:.$$

This result does not depend on derivatives $dq/dt$ and $dp/dt$ since they do not appear as arguments of the involved functions. So this result holds everywhere in $\Gamma$ because $(t,q, \dot{q})$ is a generic point therein. We conclude that (5) can be re-written as:

$$\frac{dq}{dt}\cdot \left( \nabla_q H|_{\gamma'(t)} + \nabla_q L|_{\gamma(t)}\right) + \frac{dp}{dt}\cdot \left(\nabla_p H|_{\gamma'(t)} - \dot{q}|_{\gamma(t)}\right) =0\:.\qquad (5)'$$

where again, we are considering a generic curve $\gamma$ as before. Fixing such curve such that all components of $\frac{dq}{dt}$ and $\frac{dp}{dt}$ vanish except for one of them, for instance $\frac{dq^1}{dt}$, we find:

$$\left(\frac{\partial H}{\partial q^1}|_{(t,q,p)} + \frac{\partial L}{\partial q^1}|_{(t,q, \dot{q})}\right) =0\:,$$

if $(t,q, \dot{q})$ and $(t,q,p)$ are related by means of (4), and so on.

Eventually we end up with the following identities, valid when $(t,q, \dot{q})$ and $(t,q,p)$ are related by means of (4)

$$\frac{\partial H}{\partial t}|_{(t,q,p)} =- \frac{\partial L}{\partial t}|_{(t,q, \dot{q})}\:, \quad \frac{\partial H}{\partial q^k}|_{(t,q,p)} =- \frac{\partial L}{\partial q^k}|_{(t,q, \dot{q})}\:, \quad \frac{\partial H}{\partial p_k}|_{(t,q,p)} = \dot{q}^k\:. \quad (6)$$ The last identity is the one you asked for. As you see, the found identities rely upon the Legendre transformation only and they do not consider Euler-Lagrangian equations or Hamilton ones.

However, exploiting these identities, it immediately arises that $\gamma$ verifies EL equations: $$\frac{d}{dt} \frac{\partial L}{\partial \dot{q}^k} - \frac{\partial L}{\partial q^k}=0\:,\quad \frac{dq^k}{dt} = \dot{q}^k\quad k=1,\ldots, n$$ if and only if the transformed curve $\gamma'(t) := \psi(\gamma(t))$ verifies Hamilton equations. $$\frac{d p_k}{dt} = -\frac{\partial H}{\partial q^k} \:, \quad \frac{dq^k}{dt} = \frac{\partial H}{\partial p_k}\quad k=1,\ldots, n\:.$$

Indeed, starting from a curve $\gamma(t) = (t, q(t), \dot{q}(t))$, the first EL equation, exploiting (4) (which is part of the definition of $\psi$) and the second identity in (6), becomes the first Hamilton equation for the transformed curve $\psi (\gamma(t))$. Moreover, the second EL equation, making use of the last identity in (6), becomes the second Hamilton equation for the transformed curve. This procedure is trivially reversible, so that, starting from Hamilton equations, you can go back to EL equations.

The first identity in (6) it not used here. However it implies that the system is or is not invariant under time translations simultaneously in Lagrangian and Hamiltonian formulation (in both cases, that invariance property implies the existence of a constant of motion which is nothing but $H$ represented with the corresponding variables either Lagrangian or Hamiltonian).

As a final comment notice that (3) and the last identity in (6) (which is nothing but the inverse function of (2) at fixed $(t,q)$) imply $$L(t, q, \dot{q}) = \nabla_p H(t,q,p) \cdot p - H(t,q,p)\:,$$ where (2) is assumed to connect Lagrangian and Hamiltonian variables.

-
When you are studying time derivative, did you mean to write $\frac{d}{dt} H(t, q(t),p(t)) = \frac{d}{dt}\left(p(t) \dot{q}(t) - L(t,q(t),\dot q(t)) \right)\:.$ – Mark Apr 4 '14 at 19:23
Also I think some of the subsequent signs are wrong. Do you need minus instead of plus in the last two terms of $\frac{\partial H}{\partial t} + \frac{dq}{dt}\cdot \nabla_q H + \frac{dp}{dt}\cdot \nabla_p H = \frac{dp}{dt}\dot{q} + p \frac{d\dot{q}}{dt} -\frac{\partial L}{\partial t} + \frac{dq}{dt}\cdot \nabla_q L + \frac{d\dot{q}}{dt}\cdot \nabla_{\dot{q}} L \:.$ – Mark Apr 4 '14 at 19:29
You say we may choose $q(t)$ and $p(t)$ so that their time derivatives are zero, but we started by fixing $\dot q(t)$ which completely determines $p(t)$ by the diffeomorphism right? – Mark Apr 4 '14 at 19:31
And how can you obtain identities after fixing $p$ and $q$ such that their time derivatives are zero, but then vary $p$ and $q$ and say that the identities you had before still hold true? – Mark Apr 4 '14 at 22:14
I have corrected the signs, the answer to all your questions is YES. I do not understand your last question, could you be more specific? – Valter Moretti Apr 4 '14 at 22:25

I) Lagrangian formalism. Let us suppress position dependence $q^i$ and explicit time dependence $t$ in the following, and also assume that the Lagrangian $L=L(v)$ is a smooth function of the velocities $v^i$, where $i=1, \ldots, n$. Define functions

$$\tag{1} g_i(v)~:=~\frac{\partial L(v)}{\partial v^i}, \qquad i=1, \ldots, n;$$ $$\tag{2} e_i(v,a)~:=~\frac{\partial g_i(v)}{\partial t}+ v^j\frac{\partial g_i(v)}{\partial q^j}+ a^j\frac{\partial g_i(v)}{\partial v^j}, \qquad i=1, \ldots, n;$$ and $$\tag{3} h(v,p)~:=~p_i v^i -L(v).$$

In eqs. (1)-(3), the velocities $v^i$, the accelerations $a^i$ and the momenta $p_i$ are free variables.

II) Lagrangian eqs. of motion. The Lagrange eqs. reads

$$\tag{4} \frac{\partial L(v)}{\partial q^i} ~\stackrel{\text{EL eq.}}{\approx}~ \frac{dg_i(v)}{dt} ~=~\frac{\partial g_i(v)}{\partial t}+ \dot{q}^j\frac{\partial g_i(v)}{\partial q^j}+ \dot{v}^j\frac{\partial g_i(v)}{\partial v^j}~\stackrel{(2)+(5)}{\approx}~e_i(v,\dot{v}),$$

where we have identified

$$\tag{5} v^i~\approx~\dot{q}^i, \qquad i=1, \ldots, n.$$

[The $\approx$ sign means equality modulo equations of motion.]

III) Legendre transformation. Within the Lagrangian framework, the momenta are defined as

$$\tag{6} p_i~=~g_i(v), \qquad i=1, \ldots, n.$$

Here we will only discuss regular$^1$ Legendre transformations, i.e. we will assume that it is possible to invert the relations (6) as

$$\tag{7} v^i~=~f^i(p), \qquad i=1, \ldots, n,$$

where

$$\tag{8} \text{The functions f and g are each others inverse functions}.$$

IV) Hamiltonian. Next define the Hamiltonian as the Legendre transform of the Lagrangian:

$$\tag{9} H(p)~\stackrel{(3)}{:=}~ \sup_v h(v,p).$$

The stationary point of $h(v,p)$ wrt. $v^i$ reads

$$\tag{10} \frac{\partial h(v,p)}{\partial v^i}~=~0 \qquad \stackrel{(1)+(3)}{\Leftrightarrow} \qquad p_i~=~g_i(v) \qquad \stackrel{(8)}{\Leftrightarrow} \qquad v^i~=~f^i(p).$$

This implies that the Hamiltonian (9) is

$$\tag{11} H(p)~\stackrel{(9)+(10)}{=}~h(f(p),p) ~\stackrel{(3)}{=}~ p_i f^i(p) -(L\circ f)(p).$$

[To be precise, there are convexity assumptions to be made to make definition (9) work. For a discussion of convexity in the context of Lagrangian and Hamiltonian formalism, see also e.g. this Phys.SE post. Here we will from now on simply assume formula (11) as a working definition for the Hamiltonian.]

V) Hamilton's eqs. of motion. Then

$$\frac{\partial H(p)}{\partial p_i} ~\stackrel{(11)}{=}~ f^i(p) + p_j \frac{\partial f^j(p)}{\partial p_i} - \frac{\partial (L\circ f)(p)}{\partial p_i}$$ $$\tag{12}~\stackrel{\text{Chain rule}}{=}~ f^i(p) + \left(p_j -g_j\circ f(p)\right)\frac{\partial f^j(p)}{\partial p_i} ~\stackrel{(8)}{=}~f^i(p) ~\stackrel{(7)}{=}~v^i~\stackrel{(5)}{\approx}~\dot{q}^i,$$

and

$$-\frac{\partial H(p)}{\partial q^i} ~\stackrel{(11)}{=}~ \frac{\partial (L\circ f)(p)}{\partial q^i} - p_j \frac{\partial f^j(p)}{\partial q^i}$$ $$~\stackrel{\text{Chain rule}}{=}~ \left(\frac{\partial L}{\partial q^i}\circ f\right)(p) +\left(g_j\circ f(p)-p_j \right)\frac{\partial f^j(p)}{\partial q^i}$$ $$~\stackrel{(8)}{=}~\left(\frac{\partial L}{\partial q^i}\circ f\right)(p) ~\stackrel{(4)}{\approx}~ e_i\left(f(p),\frac{df(p)}{dt}\right)$$ $$~\stackrel{(2)}{=}~(\partial_t g_i)\circ f(p) + f^j(p)\left(\frac{\partial g_i}{\partial q^j}\circ f\right)(p) + \frac{df^j(p)}{dt} \left(\frac{\partial g_i}{\partial v^j}\circ f\right)(p)$$ $$\tag{13}~\stackrel{\text{Chain rule}}{=}~ \frac{d(g_i\circ f)(p)}{dt} ~\stackrel{(8)}{=}~\dot{p}_i.$$

Equation (12) and (13) are Hamilton's eqs. of motion.

--

$^1$ A singular Legendre transformation leads to primary constraints.

-
Interesting. I had some trouble understanding the notation (like why sometimes the index is below and other times it's above) but the squiggly equals sign makes it more clear what Lagrangian/Hamiltonian theory is trying to say. But it was not clear that your definition of the Hamiltonian coincides with the usual definition using a Legendre transform. – Mark Apr 3 '14 at 3:48
I'm also confused about (3). Is $p$ a function? If so of which variables? – Mark Apr 3 '14 at 3:53
The momenta $p_i$ are free variables in the Hamiltonian formalism. I updated the answer. – Qmechanic Apr 3 '14 at 3:56

Alternatively, there exists an extended approach to the Legendre transformation between the Lagrangian and Hamiltonian formalism, cf. e.g. Ref. 1. Let us suppress explicit time dependence $t$ from the notation in the following. Consider the extended Lagrangian

$$\tag{1} L_E(q,\dot{q},v,p)~:=~ p_i(\dot{q}^i-v^i)+L(q,v)~=~p_i\dot{q}^i-h(q,v,p),$$

$$\tag{2} h(q,v,p)~:=~ p_i v^i-L(q,v),$$

$$\tag{3} H(q,p)~:=~ \sup_v h(q,v,p).$$

Here it is important that positions $q^i$, velocities $v^i$, and momenta $p_i$ are treated as independent variables in the corresponding extended stationary action principle.

The Euler-Lagrange eqs. for the extended Lagrangian (1) read

$$\tag{4q} \dot{p}_i~\approx~ \frac{\partial L(q,v)}{\partial q^i}~=~- \frac{\partial h(q,v,p)}{\partial q^i},$$

$$\tag{4v} 0~\approx~p_i-\frac{\partial L(q,v)}{\partial v^i}~=~\frac{\partial h(q,v,p)}{\partial v^i},$$

$$\tag{4p} \dot{q}^i~\approx~v^i~=~\frac{\partial h(q,v,p)}{\partial p_i}.$$

1. On one hand, by integrating out the $v^i$ variables, the extended Lagrangian (1) becomes the so-called Hamiltonian Lagrangian $$\tag{5} L_H(q,\dot{q},p)~:=~ p_i\dot{q}^i-H(q,p).$$ The Euler-Lagrange eqs. for the Hamiltonian Lagrangian (5) are the Hamilton's eqs of motion.

2. On the other hand, by integrating out the $p_i$ variables, we get $v^i \approx\dot{q}^i$, cf. eq. (4p). Eliminating the $v^i$ variables as well, the extended Lagrangian becomes the usual Lagrangian $$\tag{6} L(q,\dot{q}),$$ which leads to the usual Lagrange eqs. of motion.

Since the Hamiltonian and Lagrangian approaches (5) and (6) belong to the same extended formalism (1), the two approaches are equivalent. Also note that the complications with implicit dependencies in the standard treatment of the Legendre transformation simplify considerably in the extended formalism (1).

References:

1. D.M. Gitman and I.V. Tyutin, Quantization of fields with constraints, (1990), Section 2.1.
-
note that due to its dependence on $\dot q^i$, $L_E$ is not a function on some (extended) phase space, but a functional(?!) – Christoph Jul 5 '14 at 20:30
I updated the answer. – Qmechanic Jul 5 '14 at 20:54
so we just vary $v,p$ independently and do the integration by parts on $\delta\dot q$ as usual to end up with $\delta S = \int(\dot q-v)\delta p + (\partial L/\partial q - \mathrm dp/\mathrm dt)\delta q + (\partial L/\partial v - p)\delta v + \text{boundary terms}$; I'll have to meditate on that for a bit... – Christoph Jul 5 '14 at 21:19

The gist of the response before the edit remains valid. The hamiltonian is defined as $$H(q,p,t) \equiv p \dot{q} - L(q,\dot{q},t),$$ the Legendre trasform of $L$. The Legendre transform takes $p$ to $\dot{q}$, because $L$ is convex, and this map is defined by $p = \partial L /\partial \dot{q}$. From the latter equation it is obvious that the map is bijective (this can also be seen by the plot if you vary $p$ instead of $\dot{q}$, which I did inadvertently before the edit).

The point of the maximization of this is to define the conjugate momentum, i.e. to define a bijective map between $\dot{q}$ and $p$. If you make a plot of this process, everything should become clear. You don't need the extra variables, simple dependence of the functions on $\dot{q}$, $p$ should suffice.

-
I think you are missing something. What does $\dot q$ mean in your formula for the Hamiltonian, who is only a function of $p, q, t$? – Mark Apr 3 '14 at 3:06
$p=p(q,\dot{q},t)$, I still don't see what the problem is. You pick a $\dot{q}$ and Legendre transform gives you a $p$, it is really that simple. – auxsvr Apr 3 '14 at 6:49
It is only after you've found $p$ that you can define the function $\dot{Q}$, but then there's no reason to define it, because you already have what you were looking for. – auxsvr Apr 3 '14 at 7:09
The trouble is that $\dot q$ is supposed to mean something, right? It's supposed to mean that you can replace $\dot q$ with the derivative of $q$, and the Hamiltonian equalities will workout. – Mark Apr 4 '14 at 21:00
$\dot{q} = \partial H / \partial p$ is valid regardless of whether $\dot{q}$ is a derivative or not. It could be any function, but if it isn't a derivative of $q$, then this is not the equation of Hamilton. – auxsvr Apr 4 '14 at 22:47