Questions about time derivative of jacobian matrix

I find that in some robotic toolboxs(e.g. FROST https://ayonga.github.io/frost-dev/index.html) they use

to calculate time derivative of jacobian matrix.

Here is my guess about the reason of using this formula:

if this is right, could anyone please tell me how to prove this part which shows that derivative and partial derivative can exchange?

\begin{align} \frac{dJ}{dt} &= \frac{\partial J}{\partial q}\frac{\partial q}{\partial t} \\ \frac{dJ}{dt} &= \frac{\partial J}{\partial q}\frac{d q}{d t}\\ \frac{dJ}{dt} &= \frac{\partial (J \dot q)}{\partial q} \end{align}
In the last line $$\dot q$$ is a constant that can enter the partial differentiation part.