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).