How to prove that $ \delta \frac{dq_i}{dt} = \frac{d \delta q_i}{dt} $? During the proof of least action principle my prof used the equation $ \delta \frac{dx}{dt} = \frac{d \delta x}{dt} $. We were not proved this equality. I was curious to know why this is true so I tried but I couldnt go any further neither did I find anything on the internet. Any help would be appreciated
 A: You need to understand the definition of $\delta$. First let $q(t)$ be given. A variation of $q(t)$ is by definition a one-parameter family of curves $\tilde{q}(t;\epsilon)$ with the property that $$\tilde{q}(t;0)=q(t)\tag{1}.$$
In that case the first variation $\delta q(t)$ is defined by the equation $$\delta q(t)=\dfrac{\partial}{\partial \epsilon}\bigg|_{\epsilon=0}\tilde{q}(t;\epsilon)\tag{2}.$$
In other words: if you Taylor expand $\tilde{q}(t;\epsilon)$ to first order in $\epsilon$ you get
$$\tilde{q}(t;\epsilon)=q(t)+\epsilon \delta q(t)\tag{3}.$$
Now differentiating (3) with respect to $t$ you get the variation of $\frac{dq}{dt}$. Expanding the left-hand side you will have $$\widetilde{\frac{dq}{dt}}=\frac{dq}{dt}+\epsilon \delta \left(\frac{dq}{dt}\right)\tag{4}$$
while expanding the right-hand side you will have
$$\dfrac{\partial}{\partial t}\left(q(t)+\epsilon \delta q(t)\right)=\frac{dq}{dt}+\epsilon \dfrac{d}{dt}\delta q(t)\tag{5}.$$
Equating (4) and (5) as (3) allows you to do gives $$\delta\left(\frac{dq}{dt}\right)=\frac{d}{dt}\delta q(t)\tag{6}.$$
A: We consider a change
$$q(t) \rightarrow q'(t) = q(t) + \delta q(t),$$
where $\delta q(t)$ is some arbitrary function (maybe subject to some constraints, e.g. we might require that it vanishes at the boundaries of integration).
The time derivative of our new function is now
$$\frac{d q'}{d t} = \frac{d q}{d t} + \frac{d }{d t}\delta q.$$
Thus the change  in the time derivative is $\frac{d}{d t} \delta q$.
But the change in the time derivative is also precisely what is meant by the notation $\delta \left(\frac{d q}{d t}\right)$. In other words,
$$\delta \left(\frac{d q}{d t}\right) \equiv \frac{ d q'}{d t} - \frac{ d q}{ d t} = \frac{d}{dt} \delta q.$$
