In "Classical Mechanics" by Goldstein and "A Students Guide to Lagrangians and Hamiltonians" by Hamill I noticed that both the virtual displacement derivatives and the normal displacement derivatives are used at different points of the proof, as shown below. My question is why can this mixing of real & virtual derivatives be done?
To simplify the equations it is assumed there is only one mass and one associated generalised variable with $x=x(q,t)$, with $\dot{x}$ meaning differential with respect to time.
The virtual displacement $\delta x$ is used to set up the virtual work equation via:
$$\delta x = \frac {\partial x}{\partial q} \delta q, \qquad \delta t=0, \tag{1}$$
being substituted into ($F$ is force, $a$ is acceleration):
$$(F/m) \delta x = a \delta x = a \frac {\partial x}{\partial q} \delta q.\tag{2}$$
The following equations (3) and (4) are used to transform the acceleration $a$ in the rhs of (2) into a form based on the kinetic energy $T$, using the usual velocity differential equation with possible explicit $t$-dependence:
$$v=\dot{x} = \frac {\partial x}{\partial q} \dot{q} + \frac {\partial x}{\partial t} \tag{3}$$
to derive:
$$ \frac {\partial v}{\partial \dot{q}} = \frac {\partial x}{\partial q}. \tag{4}$$
So it looks like virtual displacements are used in (1) & (2) and real displacements $$\delta x = \frac {\partial x}{\partial q} \delta q+ \frac {\partial x}{\partial q}\delta t \tag{5}$$$$\delta x = \frac {\partial x}{\partial q} \delta q + \frac {\partial x}{\partial t} \delta t \tag{5}$$ are used in (3) & (4) parts of d'Alembert derivation of Lagrange equations.