Derive the equations of motion for arbitrarily many coupled harmonic oscillators with alternating masses


 * 1) Find the Lagrangian for a chain of alternating masses \(m_A\) and \(m_B\) with a period \(a\) and position label \(n\): \(\mathcal{L}=\sum_{n=1}^N \left(\frac{m_A}{2}\left(m\dot{x}_n^{(A)}\right)^2 + \frac{m_B}{2}\left(m\dot{x}_n^{(B)}\right)^2 - \frac{k_s}{2}\left(x_{n+1}^{(A)} - x_{n}^{(B)}\right)^2 - \frac{k_s}{2}\left(x_{n}^{(A)} - x_{n}^{(B)}\right)^2\right)\)
 * 2) Use the Euler-Lagrange equations, \(\frac{\partial}{\partial t}\frac{\partial \mathcal{L}}{\partial \dot{x}_m^{(A)}} - \frac{\partial \mathcal{L}}{\partial x_m^{(A)}} = 0\) and \(\frac{\partial}{\partial t}\frac{\partial \mathcal{L}}{\partial \dot{x}_m^{(B)}} - \frac{\partial \mathcal{L}}{\partial x_m^{(B)}} = 0\): \(m_A\ddot{x}_n^{(A)} = k_s\left(x_n^{(B)} - 2x_n^{(A)}+x_{n-1}^{(B)}\right)\) \(m_B\ddot{x}_n^{(B)} = k_s\left(x_n^{(A)} - 2x_n^{(B)}+x_{n-1}^{(A)}\right)\)
 * 3) Diagonalise.
 * 4) Find the Fourier transform for \(x_n\): \(x_n^{(A)}=\frac{1}{\sqrt{N}}\sum_k e^{-ikna}x_k^{(A)}\)
 * 5) Multiply the first equation of motion by \(e^{ikna}\) and sum over \(n\): \(\frac{n_A}{\sqrt{N}}\sum_n\ddot{x}_n^{(A)}e^{ikna} = \frac{k_s}{\sqrt{N}}\sum_n\left(x_n^{(B)}e^{ikna} - 2x_n^{(A)}e^{ikna} + x_{n-1}^{(B)}e^{ikna}\right)\)
 * 6) Substitute the Fourier transform and shift the rightmost summation: \(m_A\ddot{x}_k^{(A)} = k_s\left(x_k^{(B)} - 2x_k^{(A)} + \frac{1}{\sqrt{N}}\sum_{n\prime} {x_{n\prime}}^{(B)}e^{ik(n\prime+1)a}\right)\)
 * 7) Move the \(n'=1\) term outside the summation: \(m_A\ddot{x}_k^{(A)} = k_s\left(x_k^{(B)} - 2x_k^{(A)}e^{ikna} + \frac{e^{ika}}{\sqrt{N}}\sum_{n\prime} x_{n\prime}^{(B)}e^{ikn\prime a}\right)\)
 * 8) Simplify: \(m_A\ddot{x}_k^{(A)} = k_s\left(x_k^{(B)} - 2x_k^{(A)} + e^{ika} x_{k}^{(B)}\right)\)
 * 9) Repeat for the other equation of motion: \(m_B\ddot{x}_k^{(B)} = k_s\left(x_k^{(A)} - 2x_k^{(B)} + e^{ika} x_{k}^{(A)}\right)\)
 * 10) Assume \(x\) has time dependence \(x_k^{(A)}(t)= x_k^{(A)}(0)e^{i\omega_t k}\). Then \(\ddot{x}_k^{(A)} = -\omega_k^2x_k^{(A)}\). \(-m_A\omega^2x_k^{(A)} = k_s\left(x_k^{(B)} - 2x_k^{(A)} + e^{ika} x_{k}^{(B)}\right)\)
 * 11) Simplify: \(\left(m_A\omega^2 - 2k_s \right) x_k^{(A)} + \left(k_s + k_se^{ika}\right) x_{k}^{(B)} = 0\) \(\left(m_B\omega^2 - 2k_s \right) x_k^{(B)} + \left(k_s + k_se^{ika}\right) x_{k}^{(A)} = 0\)
 * 12) Write in matrix format: \(\begin{pmatrix}m_A\omega_k^2 - 2k_s & k_s + k_se^{ika} \\k_s + k_se^{ika} & m_B\omega_k^2 - 2k_s \end{pmatrix} \begin{pmatrix} x_k^{(A)} \\ x_k^{(B)} \end{pmatrix} = 0\)
 * 13) Find the value of \(\omega_k\) for which the determinant of the matrix is non-zero: \(\omega_k = \sqrt{\frac{k_s(m_A + m_B)}{m_Am_B}}\sqrt{1\pm\sqrt{1-\frac{4m_Am_B}{\left(m_A + m_B\right)^2} \sin^2\frac{ka}{2}}}\)