I know that
$$U= \frac{1}{2} \sum_{j,k} A_{jk} q_j q_k \quad \quad T= \frac{1}{2} \sum_{j,k} m_{jk} \dot{q}_j \dot{q}_k $$
and the lagrangian is
$$ \frac{\partial U}{\partial q_k} - \frac{d}{dt} \frac{\partial T}{\partial \dot{q}_k} = 0$$
If I derivate
$$ \frac{\partial U}{\partial q_k} = \frac{\partial}{\partial q_k} (\frac{1}{2} \sum_{j,k} A_{jk} q_j q_k) = \frac{1}{2} \sum_{j,k} A_{jk} (\frac{\partial q_j}{\partial q_k} \delta_{jk} \quad q_k + q_j \quad \frac{\partial q_k}{\partial q_k} \delta_{kk} )$$
and
$$ \frac{\partial T}{\partial \dot{q}_k} = \frac{\partial}{\partial \dot{q}_k} (\frac{1}{2} \sum_{j,k} m_{jk} \dot{q}_j \dot{q}_k) = \frac{1}{2} \sum_{j,k} m_{jk} (\frac{\partial \dot{q}_j}{\partial \dot{q}_k} \delta_{jk} \quad \dot{q}_k + \dot{q}_j \frac{\partial \dot{q}_k}{\partial \dot{q}_k} \delta_{kk})$$
but, the results is
$$ \frac{\partial U}{\partial q_k} = \sum_{j} A_{jk} q_j $$
and
$$ \frac{\partial T}{\partial \dot{q}_k} = \sum_{j} m_{jk} \dot{q}_j $$
I don't understand this, how this happened ? Where is $\frac{1}{2}$?
This is a passage from Marion (Classical Mechanics), I found it curious and tried to solve it, because the derivative was meaningless to me, and the subindexes are very confusing to understand.
The lagrangian is $$ \frac{\partial L}{\partial q_k} - \frac{d}{dt} \frac{\partial L}{\partial \dot{q}_k} = 0$$ but it uses this other relation with $U$ and $T$, How can this be valid?