Coupled differential equations: how to write in terms of only one coordinate? I have a mass-spring system, which is as follows:
                                    

I have derived the equations which are:
$$
\begin{align}
M_1 \frac{d^2x_1}{dt^2} &= M_1g + k_2(x_2 - x_1 - L_2) - k_1(x_1-L_1)\\
%
M_2 \frac{d^2x_2}{dt^2} &= M_2g - k_2(x_2 - x_1 - L_2)
\end{align}
$$
However they ask me to find an expression for $x_2$ as a function of $x_1$. I cannot think of a way of doing this. It seems that I am missing something, how can I come up with such an expression?
EDIT:
They only said that $x_1(0) = 1$ and $x_2(0) = 2$, all parameters are equal to 1, and the initial momentum is 0, so I assume that the system is released from rest.
 A: Following the general approach given in this link, we can write down the equations of motion and solve for the normal modes.
I am using $x_1$ and $x_2$ as the displacement from equilibrium since it just removes a few $m\cdot g$, $-L_1$ and $-L_2$ terms but otherwise doesn't change the result in any fundamental way. You can then adapt this approach to solve your exact problem.
The equations of motion become:
$$m_1 \ddot x_1 = -k_1 x_1 + k_2(x_2 - x_1)\tag1$$
$$m_2 \ddot x_2 = -k_2(x_2 - x_1)\tag2$$
If we assume that there is a solution, it will be of the form:
$$x_1 = a_1 \cos(\omega t)\tag3$$
$$x_2 = a_2 \cos(\omega t)\tag4$$
where $a_1$ and $a_2$ might be complex (this would allow for arbitrary phase difference between the motion of the two masses) then we can find the relationship between $\omega$, $a_1$ and $a_2$:
$$- m_1 \omega^2 a_1 \cos\omega t = -k_1 a_1 \cos\omega t + k_2(a_2 - a_1)\cos\omega t\\
-m_2 \omega^2a_2 \cos\omega t = -k_2(a_2-a_1)\cos\omega t$$
Dividing out $\cos\omega t$ and rearranging, we get two equations for $a_1$ and $a_2$:
$$\begin{align}\left(-m_1\omega^2 +k_1+k_2\right) a_1 -k_2 a_2 &= 0\tag5\\
k_2 a_1 + \left(m_2 \omega^2 - k_2\right)a_2&= 0 \tag6
\end{align}$$
Since the right hand side is zero for these equations, the only non-trivial solution will be when the determinant on the left is zero, or
$$\left(-m_1\omega^2 +k_1+k_2\right) \left(m_2 \omega^2 - k_2\right)+k_2^2 = 0$$ 
Putting $\omega^2 = \Omega$, we can solve:
$$-m_1 m_2 \Omega^2 + (m_1 k_2 + m_2 (k_1+k_2)) \Omega - k_1 k_2 = 0$$
This leaves us with a messy expression for $\Omega = \omega^2$. 
And then it gets interesting.
From the "assumed solution" (3) and (4) it immediately follows that
$$\frac{x_1}{x_2} = \frac{a_1}{a_2}$$
And we can find the ratio of amplitudes from either equation (5) or (6) by substituting our solution for $\omega^2$:
$$\frac{a_1}{a_2} = \frac{k_2}{-m_1\omega^2 +k_1+k_2}$$
I will leave it up to you to check my math, finish the solution. You might want to make sure that the solution makes sense for a simple case (like - what should happen when $m_1=0$ and $k_1 = k_2$?)
