# Two masses attached to a spring

I'm trying to understand the solution of the following problem.

Two masses $m_{1}$ and $m_{2}$ slide freely in a horizontal frictionless track and are connected by a spring whose force constant is $K$. Find the the frequency of oscilatory motion for this system.

In the solutions manual, it is considered that $x_{1}$ and $x_{2}$ are the coordinates of $m_{1}$ and $m_{2}$, respectively, and the length of the spring at equilibrium is $l$. Then, it is defined that, the equations of motion for each mass are:

$$m_{1}\ddot x_{1} = -k(x_{1} - x_{2} + l), \\ m_{2}\ddot x_{2} = -k(x_{2} - x_{1} - l).$$

And, with some algebraic manipulations, we arrive at the answer.

My question is about the right hand side of these two equations. Why is the displacement in the restoring force equal to the difference between the positions plus the length of the spring in the first equation and minus on the second? What is the behavior of the system during the move? What changes in the analysis when I consider the frictional force? Could I consider that this motion has some relationship with the center of mass of the system?

-
Are you sure that there shouldn't be a $-l$ in the equation of motion for mass $2$? The forces you have written down do not seem to be equal in magnitude (which would contradict newton's third law). –  joshphysics Apr 21 '13 at 19:53
The second equation in the solutions manual is wrong. In the solution the next step is isolate the variable $x_{1}$ and the result is $x_{1} = \frac{m_{2}\ddot x_{2} + kx_{2} - kl}{k}$ Impossible obtain this with the $+l$ –  Example Mo Apr 21 '13 at 20:03

Given a spring with spring constant $k$ whose extension is in the direction $x$, the magnitude of the force that the spring exerts is given by $$|F| = k|L-l|$$ where $L$ is its length and $l$ is its equilibrium length. Now, imagine that the two masses are at positions $x_1$ and $x_2$ with $x_2>x_1$, then the length of the spring is given by $L = x_2 - x_1$ so that the magnitude of the force exerted by the spring is given by $$|F| = k|(x_2-x_1) - l|$$ Now, if $x_2 - x_1>l$, then the spring is stretched in which case the mass on the right feels a force of this magnitude to the left, and the mass on the left feels a force of the same mangitude to the right; \begin{align} F_1 = k(x_2-x_1 - l) \\ F_2 = -k(x_2 - x_1 - l) \end{align} This results in the following two equations of motion \begin{align} m\ddot x_1 = -k(x_1-x_2 + l) \\ m \ddot x_2 = -k(x_2 - x_1 - l) \end{align} Essentially, the difference in the sign of $l$ can be attributed to Newton's third law; the forces on each mass must be equal and magnitude, but opposite in direction.
If friction were included on the surface, say for the sake of concreteness that the coefficient of kinetic friction is $\mu_k$, then each object experiences a force equal in magnitude to $\mu_k m_1g$ for mass 1 and $\mu_k m_2 g$ for mass $2$. The sign of the friction force term must be chosen so as to always give a friction force that is opposite the direction of motion. One way to do this is to multiply the force's magntiude by $-\dot x/|\dot x|$ which is $-1$ when the object is moving to the right, and $+1$ when the object is moving to the left.