I'm not sure whether this is better suited to the physics site, but I'm trying here first.
My analytical mechanics professor, while discussing some generalized coordinate $q(x(t),y(t))$, used the following identity:$$\frac{\partial q}{\partial x} = \frac{\partial \dot{q}}{\partial \dot{x}}$$
and I couldn't understand why/whether it is true? My assumption was that we could construct a proof along these lines:
By the chain rule: $$\dot{q}=\frac{\partial q}{\partial t}=\frac{\partial q}{\partial x}\frac{\partial x}{\partial t}+\frac{\partial q}{\partial y}\frac{\partial y}{\partial t}$$ So taking the derivative by $\dot{x}=\frac{\partial x}{\partial t}$ we get: $$\frac{\partial \dot{q}}{\partial \dot{x}}=\frac{\partial }{\partial \dot{x}}(\frac{\partial q}{\partial x}\dot{x})+\frac{\partial }{\partial \dot{x}}(\frac{\partial q}{\partial y}\dot{y})=\frac{\partial q}{\partial x}+0=\frac{\partial q}{\partial x}$$
But I can't convince myself that I can take the partial derivative with respect to $\dot{x}$ in this way.
I tried to apply this identity to an example but this only confused me further: $$q(x(t))=x^2, x(t)=t^2\quad$$$$ \frac{\partial q}{\partial x}=2x=2t^2\quad \dot{x}=2t, \dot{q}=4t^3=\frac{\dot{x}^3}{2}\quad $$$$\frac{\partial \dot{q}}{\partial \dot{x}}=\frac{3\dot{x}^2}{2}=6t^2\not=\frac{\partial q}{\partial x}$$