If the applied forces are conservative, they can be written as the gradient of a potential energy:
\begin{align}
\vec{F}_i=-\nabla V_i = -\left(\frac{\partial V_i}{\partial x}\hat{x}+\frac{\partial V_i}{\partial y}\hat{y}+\frac{\partial V_i}{\partial z}\hat{z}\right)
\tag{3.31}\end{align}
The virtual work done by such a force is thus:
\begin{align}
\delta W &= \sum_{i=1}^N \vec{F}_i\cdot\delta\vec{r}_i\\
&=-\sum_{i=1}^N(\nabla V_i)\cdot\delta\vec{r}_i\\
&=-\sum_{i=1}^N \left(\frac{\partial V_i}{\partial x}\hat{x}+\frac{\partial V_i}{\partial y}\hat{y}+\frac{\partial V_i}{\partial z}\hat{z}\right)(\delta x\hat{x}+\delta y\hat{y}+\delta
z\hat{z})\\
&=-\sum_{i=1}^N\left(\frac{\partial V_i}{\partial x}\delta x+\frac{\partial V_i}{\partial y}\delta y+\frac{\partial V_i}{\partial z}\delta z\right)\\
&=-\sum_{i=1}^N \delta V_i\end{align}
the negative of the change in potential energy, which makes sense. We can then write D’Alembert’s principle as:
\begin{align}
\sum_{i=1}^N \vec{F}_i\cdot\delta\vec{r}_i-\sum_{i=1}^N m_i\ddot{\vec{r}}_i\cdot\delta\vec{r}_i&=0\\
\sum_{i=1}^N\delta V_i +\sum_{i=1}^N m_i\ddot{\vec{r}}_i&\cdot\delta\vec{r}_i=0\end{align}
We now consider a special case of the virtual displacement, namely, the case when \(\delta\vec{r}_i=d\vec{r}_i\). Since we are free to choose any virtual displacement, we can choose the one that coincides with the true displacement in time. In the generalized coordinates, we can always choose \(\delta q = dq\) without loss of generality. However, this does not always imply that \(\delta \vec{r}_i=d\vec{r}_i\). We can only do this in the “scleronomic” case, when the generalized coordinates to not depend explicitly on time:
\begin{align}
\vec{r}_i&=\vec{r}_i(q_1,\dots q_n)\\
\frac{\partial \vec{r}_i}{\partial t}&= 0\\
\therefore \delta q=dq\to \delta \vec{r}_i&=d\vec{r}_i\end{align}
In the “rheonomic” case, when the transformations depend on time:
\begin{align}
\vec{r}_i&=\vec{r}_i(q_1,\dots q_n,t)\\
\frac{\partial \vec{r}_i}{\partial t}&\neq 0\\
\therefore \delta q=dq\not\to \delta \vec{r}_i&= d\vec{r}_i\end{align}
Similarly, the variation of the potential, \(\delta V\), will equal the true change in the potential, if the potential energy does not depend explicitly on time:
\begin{align}
V&=V(q_1,\dots ,q_n)\\
\frac{\partial V}{\partial t}&=0\\
\therefore \delta q=dq\to \delta V&=dV\end{align}
Keeping in mind that the following only holds for a scleronomic system when the potential energy does not depend on time, we can write the variations as true differentials with respect to time:
\begin{align}
\sum_{i=1}^N\delta V_i +\sum_{i=1}^N m_i\ddot{\vec{r}}_i \cdot\delta\vec{r}_i&\to \sum_{i=1}^N dV_i +\sum_{i=1}^N m_i\ddot{\vec{r}}_i\cdot d\vec{r}_i\\
&=\sum_{i=1}^N dV_i+\sum_{i=1}^N m_i\ddot{\vec{r}}_i\cdot d\vec{r}_i \frac{dt}{dt}\\
&=\sum_{i=1}^N dV_i+\sum_{i=1}^N m_i\ddot{\vec{r}}_i\cdot \dot{\vec{r}}_i dt\\
&=\sum_{i=1}^N dV_i+\sum_{i=1}^N \frac{1}{2}m_i\frac{d}{dt}(\dot{r}_i^2) dt\\
&=\sum_{i=1}^N dV_i+\sum_{i=1}^N \frac{1}{2}m_i d(\dot{r}_i^2)\\
&=\sum_{i=1}^N dV_i+\sum_{i=1}^N dT_i\\
&=d\sum_{i=1}^N V_i+d\sum_{i=1}^N T_i\\
&=d(V+T)=0\\
\therefore \int d(V+T)=V+T &\equiv E = \text{constant}
\tag{3.37}\end{align}
where we have introduced the kinetic energy, \(T_i\) for each particle (and its potential energy, \(V_i\)), as well as the total kinetic and potential energies of the system, \(T\), and, \(V\). We have implicitly assumed that the masses \(m_i\) are constant in time. We can see that in the specific case of a system that is scleronomic in potential energy and in transformation equations, the quantity \(E=T+V\) is a constant of motion. Of course, we can identify this with the conservation of energy of the system, and the usual conditions for energy to be conserved.