My latex seems to bug out sometimes so if it looks weird please click on the source but let me continue...
KEtot,2D = \frac{1}{2}(m11\dot{x}12 + m22\dot{x}22 + m12\dot{x}1\dot{x}2)PEtot = \frac{1}{2}(m11{x}12 + m22{x}22 + m12{x}1{x}2)
I took the generalized forms to be:
KEtot,nD =...