I have a doubt regarding the expression of a virtual displacement using generalized coordinates. I will state the definitions I'm taking and the problem.
The system is composed by $n$ points with positions $\mathbf r _i$ and subject to $3n-d$ constraints of the form: $$\phi _j (\mathbf r _1, \mathbf r _2,...,\mathbf r _n,t)=0\qquad (1\leq j \leq 3n-d), \tag{1}$$ that, deriving with respect to time, gives: $$\sum _{i=1} \frac{\partial \phi _j}{\partial \mathbf r _i} \cdot \dot {\mathbf r}_i=-\frac{\partial \phi _j}{\partial t}.\tag{2}$$
According to my notes, a set of possible velocities $(\mathbf v_1,\mathbf v_2,...,\mathbf v_n)$ is one that satisfies the above system of $j$ equations (with $v_i$ in the place of $\dot r _i$), while a set of virtual velocities is one that satisfies the homogeneous system $$\sum _{i=1} \frac{\partial \phi _j}{\partial \mathbf r _i} \cdot \dot {\mathbf r}_i=0.\tag{*}$$ Finally, a virtual displacement is given by the product of a virtual velocity by a quantity $\delta t$, with the dimensions of time.
I have the following problem. Suppose that I have a parametrization of the configuration space at time $t$ in the form: $$\mathbf r _i = \mathbf r _i (q_1,\dots ,q_d;t).$$ That is: $$\phi _j(\{\mathbf r _i (q_1,\dots,q_d;t)\},t)=0$$ for all $q=(q_1,\dots,q_d)\in Q$ and $t\in [t_1,t_2]$. Now, according to my notes, if such a parametrization is given, the general form of a virtual displacement is: $$\delta \boldsymbol r _i =\sum _h \frac{\partial \mathbf r _i}{\partial q _h}\delta q _h.$$
Let $q(t)$ be a curve in the coordinate's space. By taking the total derivative of both sides of the precedent equation, I obtain: $$\sum _i \frac{\partial \phi _j}{\partial \mathbf r _i}\cdot (\sum _h \frac{\partial \mathbf r_i}{\partial q _h} \dot q _h)+\sum _i \frac{\partial \phi _j}{\partial \mathbf r _i}\cdot \frac{\partial \mathbf r _i}{\partial t} +\frac{\partial \phi _j}{\partial t}=0.$$ But the first term is zero because it is the product of the gradients $\nabla _{\mathbf r _i}\phi _j$ with the virtual velocities $\mathbf v _i$. But, in this case, it looks like that the second+third terms should be zero.
I suspect that there's an error, I don't see why the second+term should always give $0$ and I would like a proof check of what I wrote above.