# Lagrange's equation derivation Kinetic energy

I'm trying to reach Lagrange's equations by D'alembert's principle.

$$\sum_{i=1}^N (m_i\ddot{\mathbf{x}}_i - \mathbf{F}_i)·\frac{\partial\ddot{\mathbf{x}}_i}{\partial q^\alpha}=0$$ or $$\sum_{i=1}^N m_i\ddot{\mathbf{x}}_i·\frac{\partial\ddot{\mathbf{x}}_i}{\partial q^\alpha} = \sum_{i=1}^N{\mathbf{F}_i}·\frac{\partial\ddot{\mathbf{x}}_i}{\partial q^\alpha}$$

I know all the process but there's a point that I don't understand, when I reach: $$\sum_{i=1}^N m_i\ddot{\mathbf{x}}_i·\frac{\partial\ddot{\mathbf{x}}_i}{\partial q^\alpha}=\sum_{i=1}^N \left[ \frac{d}{dt}\left( m_i\mathbf{v}_i ·\frac{\partial\mathbf{v}_i}{\partial\dot{q}^\alpha} \right)-m_i\mathbf{v}_i·\frac{\partial\mathbf{v}_i}{\partial q^\alpha} \right]=\frac{d}{dt}\frac{\partial T}{\partial \dot{q}^\alpha}-\frac{\partial T}{\partial q^\alpha}$$

Because $T=\frac{1}{2}\sum_i^N m_i v_i^2$ is the total kinetic energy of the system of particles.

But I can't see it clearly why $$\sum m_i \mathbf{v}_i·\frac{\partial\mathbf{v}_i}{\partial q^\alpha}\equiv \frac{\partial T}{\partial q^\alpha}$$

there shouldn't be a $2$ factor somewhere?

I think that it is indeed right. This is because you derive both v's with respect to q in the dot product using the product rule, as follows $$\frac{\partial}{\partial q}\left(\frac{1}{2}mv^2\right)=\frac{\partial}{\partial q} \left(\frac{1}{2}mv\cdot v\right) = \frac{m}{2}\frac{\partial v}{\partial q} \cdot v + \frac{m}{2}v\cdot\frac{\partial v}{\partial q} = mv\cdot \frac{\partial v}{\partial q}$$ (remembering of course that the the dot product is symmetric).