Consider the system above ($m_1$, $m_2$, and $m_3$ are connected by springs of stiffnesses $k_1$ and $k_2$, respectively. Also, $m_1 \neq m_2 \neq m_3$). The Lagrangian is
$$L(x_{1},x_{2},x_{3},\dot x_{1},\dot x_{2},\dot x_{3},t) = \frac{1}{2}m_{1}(\dot x_{1})^2+\frac{1}{2}m_{2}(\dot x_{2})^2+\frac{1}{2}m_{3}(\dot x_{3})^2 - \frac{1}{2}k(x_{2}-x_{1})^2-\frac{1}{2}k(x_{3}-x_{2})^2 $$
However, I am required to change variables, in order to avoid crossed terms. I've solved the two masses problem previously, having obtained $q_{1}(x_{1},x_{2}) = x_{2}-x_{1}$ and $q_{2}(x_{1},x_{2}) = m_{1}x_{1}+m_{2}x_{2}$, which did the job. Hence, I tried to apply the same logic to this problem ($q_{1}(x_{1},x_{2},x_{3}) = x_{2}-x_{1}$, $q_{2} (x_{1},x_{2},x_{3}) = x_{3}-x_{2}$ and $q_{3}(x_{1},x_{2},x_{3}) = m_{1}x_{1}+m_{2}x_{2}+m_{3}x_{3}$), which did not eliminate the crossed terms completely. My question is, is there any kind of logic/physical meaning to these changes of variables or is this a 'trial and error' kind of process?