Finding the components of the tensor for potential and kinetic energy

I believe this is the "missing link", stated in a less abstract fashion than in the above comment: https://en.wikipedia.org/wiki/Quadratic_form . Some programs in physics cover that in undergraduate algebra courses, some leave it for later. Notably, this method doesn't apply just to tensors, it's a general connection between symmetric matrices (of spaces $\mathcal{M}_{n\times n}({ℝ})$, since they are quadratic) and equations.

If you have an expression like $Q\left({\xi }_{1},\dots ,{\xi }_{n}\right)=\sum _{{i}_{i}j=1}^{n}{\alpha }_{ij}{\xi }_{i}{\xi }_{j}$ , which you do since the lagrangian of small oscillations has quadratic terms of both $x$ and $\stackrel{.}{x}$, you may transform the quadratic form of the potential energy (your first expression) into a symmetric matrix by putting values of ${\alpha }_{ii}$ on the diagonal (in this case the coefficients are ${\alpha }_{11}=k$, ${\alpha }_{22}=2k$, and ${\alpha }_{33}=k$, and, because the coefficients are symmetric (see definition), the matrix is symmetric as well. Hence, other elements are put in their appropriate position ( in this case ${\alpha }_{12}={\alpha }_{21}=-k$, ${\alpha }_{23}={\alpha }_{32}=-k$, ${\alpha }_{13}={\alpha }_{31}=0$). Note also that the matrix coefficients of nondiagonal elements are half of the ${\alpha }_{ij}$ coefficients from the quadratic form, since they are represented twice in the matrix.

Hope this helps, if needed I will give some more examples.