Referring to Wikipedia we have that the equation of motion for a $f(q, p, t)$ comes from the formula \begin{equation} \frac{\mathrm{d}}{\mathrm{d}t} f(p, q, t) = \frac{\partial f}{\partial q} \frac{\mathrm{d}q}{\mathrm{d}t} + \frac {\partial f}{\partial p} \frac{\mathrm{d}p}{\mathrm{d}t} + \frac{\partial f}{\partial t} \tag{1} \end{equation} which is, un the Poisson bracket notation $$ \frac {\mathrm{d}}{\mathrm{d}t} f(p, q, t) = \{f, H\} + \frac{\partial f}{\partial t} \tag{2} $$ Now, many books say that if we want to get the Hamilton equations from here you just have to substitute, respectively for the first and the second equation ($k= 1, \dots, 2\cdot3N$ equations actually, for a system with $N$ particles and $3$ degrees of freedom) $f(q, p, t) = q(t)$ and $f(q, p, t) = p(t)$. So you should get the two equations: $$ \frac {\mathrm{d}}{\mathrm{d}t} q = \{q, H\} + \frac{\partial q}{\partial t}\tag{3} $$ and $$ \frac {\mathrm{d}}{\mathrm{d}t} p = \{p, H\} + \frac{\partial p}{\partial t}\tag{4} $$ So, in order to get back to the Hamilton equations we should have $$\frac{\partial p}{\partial t} = \frac{\partial q}{\partial t} = 0,\tag{5}$$ but why it is so? Why the partial time derivative is zero, if $q$ and $p$ are function of time?

  • $\begingroup$ You probably should settle on a single order for the arguments to your function $f$. As declared in your first sentence, the chain rule application in eqn (1) says "the derivative of $f$ with respect to its first slot times the derivative with respect to time of the thing we are inserting into its second slot, $q$, plus (the same phrase with "first" and "second" swapped and "$q$" replaced with "$p$") plus the derivative of $f$ with respect to its third slot", which is incorrect. $\endgroup$ Commented Dec 3, 2017 at 16:13

4 Answers 4


The confusion stems from a bit of mathematical sloppiness. It's necessary useful sloppiness, because as you'll see in a moment, the full machinery is a pain, but it's helpful to see and keep in the back of your mind when confusions like this arise.

Phase Space Trajectories

I won't go through the trouble of constructing the cotangent bundle to the configuration space and all of that mess - we can start from the intuitive notion of the phase space $\Omega$. A point $x\in\Omega$ can be labeled by the corresponding position $q$ and momentum $p$ (i.e. $x\equiv(q_x,p_x)$). It's important to note that $q$ and $p$ are not functions of time or anything else - they are just numbers which label a particular location in phase space.

From here, we consider the notion of a trajectory through phase space. A trajectory $\gamma$ is a continuous map which takes a real number (the time) and maps it to a point in phase space:

$$\gamma:\mathbb{R} \rightarrow \Omega$$ $$t \mapsto \gamma(t)$$

If we feed $\gamma$ a time, it tells us the location of the system in phase space. As we move forward in time, the trajectory tells us how the state of the system evolves.

Dynamical Variables

A dynamical variable $F$ takes a point in phase space and a value of time and maps them to a real number: $$F :\Omega\times \mathbb{R} \rightarrow \mathbb{R}$$ $$(q,p,t) \mapsto F(q,p,t)$$

Next we introduce the projection functions $\mathcal{Q}$ and $\mathcal{P}$, which map a particular point in phase space to the corresponding values of $q$ and $p$. $$\mathcal{Q}:\Omega\times\mathbb R \rightarrow \mathbb{R} $$ $$(x,t)\mapsto \mathcal{Q}(x,t)\equiv\mathcal{Q}\big(q_x,p_x,t\big) = q_x$$ and $$\mathcal{P}:\Omega\times\mathbb R \rightarrow \mathbb{R} $$ $$(x,t) \mapsto \mathcal{P}(x,t)\equiv\mathcal{P}\big(q_x,p_x,t\big) = p_x$$

Essentially, $\mathcal{Q}$ just takes a point in phase space and a time and tells you the position coordinate while ignoring the momentum coordinate and the time, while $\mathcal{P}$ takes a point in phase space and a time and tells you the momentum while ignoring the position coordinate and the time. Notice that these two functions are particular examples of time-independent dynamical variables, in the sense that $\frac{\partial \mathcal{P}}{\partial t} = \frac{\partial \mathcal{Q}}{\partial t}=0$.

Dynamical Variables Along Phase Space Trajectories

Now we can combine these two concepts. Given a trajectory $\gamma$ and a dynamical variable $F$, we can combine them to form a map $F_\gamma$ which takes a single real number $t$ and returns the value of $F$ at time $t$ along $\gamma$:

$$F_\gamma : \mathbb{R} \rightarrow \mathbb{R}$$ $$ t \mapsto F\big(\gamma(t),t\big)$$

We can apply this definition to $\mathcal{Q}$ and $\mathcal{P}$. Notice that $$\mathcal{Q}_\gamma : \mathbb{R} \rightarrow \mathbb{R}$$ $$ t \mapsto \mathcal{Q}\big(\gamma(t)\big)$$ so $\mathcal{Q}_\gamma(t)$ is the position coordinate of the system at time $t$, while $\mathcal{P}_\gamma(t)$ is the momentum coordinate of the system at time $t$.

Notice that for a given dynamical variable $F$, we can also write that $$F_\gamma(t) = F\big(\gamma(t),t\big) = F\big(\mathcal{Q}_\gamma(t),\mathcal{P}_\gamma(t),t\big)$$

Total Derivatives

Because such maps are functions of a single variable, it makes sense to take a total derivative with respect to time. This is the total rate of change of $F$ along the trajectory $\gamma$:

$$\frac{dF_\gamma}{dt} \equiv \frac{\partial F}{\partial q}\frac{d\mathcal{Q}_\gamma}{dt} + \frac{\partial F}{\partial p}\frac{d\mathcal{P}_\gamma}{dt} + \frac{\partial F}{\partial t}$$

Hamilton's Equations

Hamilton's equations are the differential equations which govern phase space trajectories. Without delving into their derivation, they tell us that $$ \frac{d\gamma}{dt} \equiv \left(\frac{d\mathcal{Q}_\gamma}{dt},\frac{d\mathcal{P}_\gamma}{dt}\right) = \left(\frac{\partial\mathcal{H}}{\partial p},-\frac{\partial\mathcal{H}}{\partial q}\right)$$ where $\mathcal{H}$ is the Hamiltonian - yet another dynamical variable.

Once the Hamiltonian $$\mathcal{H}:\Omega \times \mathbb{R} \rightarrow \mathbb{R}$$ $$(q,p,t) \mapsto \mathcal{H}(q,p,t)$$ has been written down, then all possible phase space trajectories have been determined.

Poisson Bracket

Using Hamilton's equations, we can rewrite the total derivative in the following way: $$ \frac{dF_\gamma}{dt} = \frac{\partial F}{\partial q}\frac{d\mathcal{Q}_\gamma}{dt} + \frac{\partial F}{\partial p}\frac{d\mathcal{P}_\gamma}{dt} + \frac{\partial F}{\partial t} = \left(\frac{\partial F}{\partial q}\frac{\partial \mathcal{H}}{\partial p} - \frac{\partial F}{\partial p}\frac{\partial \mathcal{H}}{\partial q}\right) + \frac{\partial F}{\partial t}$$

This motivates the definition of the Poisson bracket of two dynamical variables: $$ \{A,B\} \equiv \frac{\partial A}{\partial q}\frac{\partial B}{\partial p} - \frac{\partial A}{\partial p} \frac{\partial B}{\partial q}$$

at which point we can rewrite the total derivative formula one last time:

$$\frac{dF_\gamma}{dt} = \{F,H\} + \frac{\partial F}{\partial t}$$

All done! Notice that the right hand side makes no mention of the trajectory $\gamma$, for good reason - once we specify the Hamiltonian and our particular location in phase space, then there's no freedom left in the evolution of the system (and therefore no freedom left in the evolution of any dynamical variable).

The Punchline

We're now equipped to answer your question. Consider the function $\mathcal{Q}$ (the function which takes a phase space point $(q,p)$ and returns its position coordinate $q$), as well as the associated function $\mathcal{Q}_\gamma$ which is associated to a phase space trajectory. We have that

$$\mathcal{Q}(q,p,t) = q$$ so $$\frac{\partial \mathcal{Q}}{\partial q} = 1$$ $$\frac{\partial \mathcal{Q}}{\partial p} = 0$$ $$\frac{\partial \mathcal{Q}}{\partial t} = 0$$

and therefore

$$\frac{d\mathcal{Q}_\gamma}{dt} = \{\mathcal{Q},\mathcal{H}\}+\frac{\partial \mathcal{Q}}{\partial t}$$ $$ = \left(\frac{\partial \mathcal{Q}}{\partial q}\frac{\partial \mathcal{H}}{\partial p} - \frac{\partial \mathcal{Q}}{\partial p}\frac{\partial \mathcal{H}}{\partial q}\right) + \frac{\partial \mathcal{Q}}{\partial t} $$ $$= \frac{\partial \mathcal{H}}{\partial p}$$

and similarly, $$\frac{d\mathcal{P}_\gamma}{dt} = -\frac{\partial \mathcal{H}}{\partial q}$$

So there you have it. When we write everything out in excruciating detail, there is no ambiguity whatsoever. $q$ and $p$ are numbers, not functions, so differentiating them is meaningless. When we do physics, what we're actually differentating are the projection functions $\mathcal{Q}$ and $\mathcal{P}$, as well as their associated functions which are attached to the phase space trajectory $\gamma$ along which the system evolves. Again, it's crucial to notice that $\mathcal{Q}$ and $\mathcal{Q}_\gamma$ are associated with each other, but are not the same thing.

Of course, when I do physics, I don't write all this out - I differentiate $q$ and $p$ just like everybody else. But it's useful to be able to frame problems in this context when those little points of confusion arise.

  • $\begingroup$ Could you give a reference for this. In the lagrangian both q and $\dot{q}$ are explicitly dependent on time. And that looks intuitive enough the coordinates and the generalized coordinates will change only when time changes, thus explicitly dependent on time. What you have written looks good mathematically but still it cannot be that coordinates depend on time implicitly... $\endgroup$
    – Shashaank
    Commented Jun 11, 2020 at 6:06
  • $\begingroup$ @Shashaank Coordinates $q$ and $p$ don't depend on time at all. They are the labels we give to points in (phase) space. What change with time are the functions $Q_\gamma(t)$ and $P_\gamma(t)$, which give the phase space coordinates along the trajectory $\gamma$ at time $t$. $\endgroup$
    – J. Murray
    Commented Jun 11, 2020 at 6:19
  • 1
    $\begingroup$ @Shashaank By convention, to save space and because we're lazy, we use $q$ and $p$ sometimes as spatial coordinates (e.g. $\{A,B\} = \frac{\partial A}{\partial q}\frac{\partial B}{\partial p} - \frac{\partial A}{\partial p}\frac{\partial B}{\partial q}$) and sometimes as dynamical functions ($\dot p = -\frac{\partial H}{\partial q}$), but this can be confusing (as it was for the OP). $\endgroup$
    – J. Murray
    Commented Jun 11, 2020 at 6:22
  • $\begingroup$ I understand that point of yours. But consider the Lagrangian. We write it explicitly as $L(q(t), \dot{q}, t) $. What is this according to you. Do you mean to say that everywhere we write these things the q's the $\dot{q}$'s the p's were never functions of time. The statements like "Lagrangian can change explicitly with time or implicitly if q change with time" that Goldstein and others make is not correct in the true sense regarding your points. In newtonian mechanics x was always a function of time and it's total derivative with time is the same as it's partial derivative time $\endgroup$
    – Shashaank
    Commented Jun 11, 2020 at 6:28
  • 1
    $\begingroup$ @Shashaank To go through all of your questions would require me to write an entirely new answer, and comments are not for extended discussions. If you want to understand how this formalism applies to Lagrangian mechanics, then please ask a new question and I'll answer it. $\endgroup$
    – J. Murray
    Commented Jun 11, 2020 at 6:33
  1. The "partial" time derivative $\frac{\partial}{\partial t}$ means in this context an explicit time differentiation. A function $$(q,p,t)~\mapsto~ f(q,p,t)$$ of phase space and time is said to have an explicit time dependence through its last argument $t$ and an implicit time dependence through the phase space variables $q^i$ and $p_j$. The total time derivative $df/dt$ is then given by OP's eq. (1).

  2. Short explanation: To make OP's eq. (1) also work for the phase space variables $$f(q,p,t)=q^i\quad\text{and}\quad f(q,p,t)=p_j$$ themselves, it is natural (and in practice useful) to pragmatically declare that they depend by definition only implicitly on time.

  3. Longer explanation: Note that physicists (unlike mathematicians) often use the same notation for a function and its value at a point. Therefore it may sometimes becomes difficult to know the list of arguments of a function. In the present case, the notion of phase space variables $q^i$ and $p_j$ can have different list of arguments $$q^i(q,p,t)=q^i\quad\text{and}\quad p_j(q,p,t)=p_j$$ versus $$t~\mapsto~ q^i(t)\quad\text{and}\quad t~\mapsto~ p_j(t)$$ depending on context. Implicit and explicit dependence are strictly speaking only defined in the former case.

  4. See also this Phys.SE post and links therein.

  • $\begingroup$ Ok, I see the mathematical difference between partial derivative and total derivative, my doubt was more about hamiltonian mechanics, in particular about the time dependence of $q_i(t)$ and $p_i(t)$... How can you say that they're dependence is implicit? Do you know some textbook that specify this aspect in a rigorous mathematical way? Thanks anyway $\endgroup$ Commented Dec 2, 2017 at 14:09
  • $\begingroup$ It's just a definition. $\endgroup$
    – Qmechanic
    Commented Dec 2, 2017 at 14:11
  • $\begingroup$ So, $q$s and $p$s depend on time only implicitly by definition, is that right? $\endgroup$ Commented Dec 2, 2017 at 15:43
  • 3
    $\begingroup$ $\uparrow$ Yes. $\endgroup$
    – Qmechanic
    Commented Dec 2, 2017 at 16:27
  • $\begingroup$ @Qmechanic $\theta$ is a generalized coordinate for a simple pendulum. Is it not explicitly dependent on time. $\endgroup$
    – Shashaank
    Commented Jun 11, 2020 at 6:31

I do not agree with the last part of the answer by Qmechanic. From a mathematical standpoint, the phase space variables depend explicitely on time, as time (as a parameter for curves in phase space) is their only functional variable. If we had, let's say $q^{i} (t) = q^{i} (z(t))$, then yes, the time dependence would have been implicit (i.e. through another function $z(t)$).

Coming back to the question in the OP. The functions $q^i (t)$ and $p_i (t)$ have only one independent variable, namely time $t$. The equation of motion for a generic observable on phase space $F (q,p,t)$ does not apply to them, because the time dependence of these functions $q$ and $p$, compared to the one for the observable, is NOT both implicit and explicit, it is only explicit. This can be reworded to say that $q^i (q^i(t),p_i (t), t)$ is not a valid F. It doesn't even make sense mathematically (similarly $p_i (q^i(t),p_i (t), t)$).

  • $\begingroup$ I agree with the first part of your reasoning, but not with the second paragraph, as the function $f$ in the Poisson equation of motion must not be function of both $q$'s and $p$'s, au contraire I can choose any function as $f$, in particular $q$ and $p$, as you can also read in this book under the paraghraph 4.3 The Poisson bracket. $\endgroup$ Commented Dec 2, 2017 at 15:16
  • 1
    $\begingroup$ I know this point you raised is present also in the book of Goldstein, 3rd Ed. p. 297, or Jose & Saletan, p. 218,219. It is not present in the book of Landau & Lifschitz, nor in the mathmetical ones by V.I. Arnold, then Abraham & Marsden "Foundations of mechanics" (2nd Ed.), and also Thirring. I just told you that the arbitrary F with both explicit and implicit time dependence cannot be simply made into p or q, because these have not the same functional dependence of time as the F. $\endgroup$
    – DanielC
    Commented Dec 2, 2017 at 15:52
  • 1
    $\begingroup$ How does the harmonic oscillator Hamiltonian $\frac{p^2}{2m}+\frac{1}{2}kq^2$ depend explicitly on $t$? $\endgroup$ Commented Dec 2, 2017 at 16:25
  • $\begingroup$ @ZeroTheHero is that question for me? $\endgroup$
    – DanielC
    Commented Dec 2, 2017 at 16:32
  • $\begingroup$ @DanielC What would you answer to the above question. I completely agree with what you said and had this doubt for over an year. I think then harmonic oscillator is not an explicit function of time only an implicit one thrrough q and p. Is that right. Is that would you would say too considering our reasoning on these lines is this same $\endgroup$
    – Shashaank
    Commented Jun 10, 2020 at 17:06

One way you can see it, is that through your reasoning you are, in a certain sense, treating the quantities of interest in different mathematical spaces. True, q and p are functions on time, but how would you write the Hamiltonian? The very derivation of these formulas assumes F and H are described as functions of position and momentum. If you want to describe q and p explicitly as functions of time, you must do that consistently, so that you substitute those explicit relations in H and F as well. When you do that, you will end up with functions of t alone, so that partial derivatives of these quantities with respect of q and p, and therefore {F,H} are zero. The partial and total derivatives of F will be the same thing, so that you will end up with the trivial equations

$\frac{dq}{dt}=\frac{dq}{dt}$ and $\frac{dp}{dt}=\frac{dp}{dt}$,

which are true, of course, but the bracket formalism won't be very useful if that description is used. If, on the other hand, we describe the system through the variables q and p, then, of course, q=q(q), p=p(p), they have no explicit time dependence when you see them that way.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.