Total time derivatives and partial coordinate derivatives in classical mechanics This may be more of a math question, but I am trying to prove that for a function $f(q,\dot{q},t)$
$$\frac{d}{dt}\frac{∂f}{∂\dot{q}}=\frac{∂}{∂\dot{q}}\frac{df}{dt}−\frac{∂f}{∂q}.\tag{1}$$
As  part of this problem, I have already proved that
$$\frac{d}{dt}\frac{\partial{f}}{\partial{q}}=\frac{\partial{}}{\partial{q}}\frac{df}{dt}\tag{2}$$
through the use of a total derivative expansion for $\frac{df}{dt}$, however I can't seem to figure out where the additional $-\frac{\partial{f}}{\partial{q}}$ term comes from for equation (1).
 A: Careful with interchanging total and partial derivatives. In this context, I'm guessing
you consider $f$ along a curve $q(t)$, then
$$
\dfrac{d}{dt}f(q(t), \dot{q}(t), t) = \dfrac{\partial f}{\partial q}\dot{q}+
\dfrac{\partial f}{\partial \dot{q}}\ddot{q}+\dfrac{\partial f}{\partial t}
$$
Something similar holds for $\tfrac{\partial f}{\partial \dot{q}}(q(t),\dot{q}(t), t)$.
If you write that down explicitly and further compute $\tfrac{\partial}{\partial\dot{q}}\tfrac{df}{dt}$ you should see
the result.
good luck.
A: OP's sought-for commutators
$$\left[\frac{\partial}{\partial \dot{q}^j},\frac{\mathrm d}{\mathrm d t}\right]~\stackrel{(3)}{=}~\frac{\partial}{\partial q^j}\tag{1}$$
and
$$\left[\frac{\partial}{\partial q^j},\frac{\mathrm d}{\mathrm d t}\right]~\stackrel{(3)}{=}~0\tag{2}$$
follow from the explicit formula
$$\frac{\mathrm d}{\mathrm d t}
~=~\frac{\partial}{\partial t}
+\dot{q}^j\frac{\partial}{\partial q^j}
+\ddot{q}^j\frac{\partial}{\partial \dot{q}^j}
+\dddot{q}^j\frac{\partial}{\partial \ddot{q}^j}
+\ldots \tag{3}$$
for the total time derivative. See also e.g. this related Math.SE post & this related Phys.SE post.
