Solution
= Solution
Substituting $y_i=q_i/\sqrt{m_i}$ gives
$$
\boxed{E=\frac12\dot q_a^2+\frac12\dot q_b^2+
\frac{k_1}{2}\left(\frac{q_b}{\sqrt{m_b}}-\frac{q_a}{\sqrt{m_a}}-\bar r\right)^2.}
$$
The shifted equilibrium coordinates satisfy $\bar q_b/\sqrt{m_b}-\bar q_a/\sqrt{m_a}=\bar r$. Expanding about them replaces q by displacements without changing the kinetic metric or the Hessian.