How come $\frac{d}{dt}\left(\frac{\partial {r_i}}{\partial {q_j}}\right) = \frac{\partial {\dot r_i}}{\partial {q_j}}$ in Lagrangian mechanics?
Calculus of variations -- how does it make sense to vary the position and the velocity independently?