Gram-Schmidt Orthogonalisation for scalars I'm reading Chapter 11 (Normal Modes) of Classical Mechanics (5th ed.) by Berkshire and Kibble and came across this on pg. 253:

The kinetic energy in terms in terms of the generalised coordinates is given by:
$$T=\frac{1}{2}a_{11}\dot{q_1}^2+a_{12}\dot{q_1}\dot{q_2}+\frac{1}{2}a_{22}\dot{q_2}^2.$$
It is a considerable simplification to choose the co-ordinates to be orthogonal, and this can always be done. For instance, we may set
$$q_1'=q_1+\frac{a_{12}}{a_{11}}q_2,$$
so that
$$T=\frac{1}{2}a_{11}\dot{q_1}'^2+\frac{1}{2}a_{22}'\dot{q_2}^2 \,\,\text{with}\,\,a_{22}'=a_{22}-\frac{a_{12}^2}{a_{11}}.$$
A similar procedure can be used in the general case. (It is called the
Gram–Schmidt orthogonalization procedure.) We may first eliminate the
cross products involving $\dot{q}_1$ by means of the transformation to
$$q_i'=q_i+\frac{1}{a_{ii}}\sum^{n}_{r \neq i}a_{ir}q_r. \tag{1}$$

From the vector definition of Gram–Schmidt
$$\boldsymbol{b'}=\boldsymbol{b}-(\boldsymbol{b} \cdot \boldsymbol{a})\hat{a}$$
I'd expect something like $$q_i'=q_i-\sum_{r\neq i}^n\frac{a_{ir}q_r}{a_{rr}}. \tag{2}$$
Could someone explain where (1) comes from?
EDIT
Also, I noticed that the expression for the kinetic energy has the resemblance of the metric tensor:
$$ds^2=g_{\mu \nu}dx^{\mu}dx^{\nu} \iff T=\frac{1}{2}a_{11}\dot{q_1}^2+a_{12}\dot{q_1}\dot{q_2}+\frac{1}{2}a_{22}\dot{q_2}^2. $$ so that $$g_{ij}=\frac{1}{2}a_{ij}$$
Does that mean it is possible to obtain (1) by a transformation to the rectangular coordinates with something like
$$\frac{\partial^2x^n}{\partial \bar{x}^i\bar{x}^j}=-\frac{\partial x^p}{\partial \bar{x}^i}\frac{\partial x^q}{\partial \bar{x}}^j \Gamma^n_{pq} \to \frac{\partial^2q_n}{\partial q'_i \partial q'_ j}=-\sum_{p, r}\frac{\partial q_p}{\partial q'_i}\frac{\partial q_r}{\partial q'_j} \Gamma^n_{pr} $$?  where $\bar{x}^i$ are coordinates in the rectangular system.
 A: You are misreading the orthogonalization involved. Your authors state clearly they wish to eliminate all cross terms involving $\dot{q_1}\equiv \boldsymbol{b}$ terms, where
$ \boldsymbol{a}\equiv a_{12} \dot{q_2}+ a_{13} \dot{q_3}+ ...$ .
That is,
$$
\frac{1}{2}a_{11} \boldsymbol{b}^2+ \boldsymbol{b}  \boldsymbol{a}+...= \frac{1}{2}a_{11} \left (\boldsymbol{b}+{1\over a_{11}}\boldsymbol{a}\right )^2+...= \frac{1}{2}a_{11} (\boldsymbol{b}')^2+...,
$$
where the ellipses ... represent terms independent of $\boldsymbol{b}$. The bold symbols are not vectors.
So the coefficient of the square of $\boldsymbol{b}$ is special and distinctly outside the definition of $\boldsymbol{a}$. (The authors remind you you could have started from any i instead of 1.)  So (1) is right and (2) is wrong. Recall you have to modify the coefficients of all quartic components of   $\boldsymbol{a}$ accordingly. I ignored the time derivatives for simplicity: you may remove them and reinsert them where appropriate.
As for your differential geometric proposal, well, this is a rigid change of variables, and I, not sure what you'd be proposing. You might, instead, think of all this as the nonorthogonal diagonalization of a symmetric matrix.
