Differential Equations

Systems of Equations

Mass-Spring System

A system of masses connected by springs is a classical system with several degrees of freedom. For example, a system consisting of two masses and three springs has two degrees of freedom. This means that its configuration can be described by two generalized coordinates, which can be chosen to be the displacements of the first and second mass from the equilibrium position.

The motion of the connected masses is described by two differential equations of second order. In the simplest case we can ignore the forces of friction and air resistance and consider only the elastic force that obeys Hooke’s law. It turns out that even such a simplified system has non-trivial dynamic properties. In general, the character of the motion is determined by two eigenfrequencies that depend on the parameters of the system (i.e., the mass of the bodies and spring constants). In addition, the motion of the masses depends strongly on the initial conditions. The effect of these factors can be studied with the help of animation presented below.

Animation is available on desktop screens.

Please use Chrome, FireFox, or Safari to run the animation.

Despite the diverse nature of the movement, the system is linear and, therefore, can be solved exactly. Our next goal is to construct this solution describing in detail all steps.

This system is shown schematically in Figure \(1.\) It consists of two masses \({m_1}\) and \({m_2},\) and three springs with stiffness coefficients \({k_1},\) \({k_2},\) \({k_3}.\) Displacement of the masses from their equilibrium positions is determined by the coordinates \({x_1}\) and \({x_2}.\)

A system consisting of two masses and three springs

Figure 1.

We find now the equations of motion. This can be done directly with the help of Newton’s second law, or using Lagrangian formalism. We will use the second method. Write expressions for the kinetic and potential energy. Note that the total energy in this ideal system is conserved.

\[
{T = \frac{{{m_1}\dot x_1^2}}{2} + \frac{{{m_2}\dot x_2^2}}{2},\;\;}\kern-0.3pt
{{V = \frac{{{k_1}x_1^2}}{2} }+{ \frac{{{k_2}{{\left( {{x_2} – {x_1}} \right)}^2}}}{2} }+{ \frac{{{k_3}x_2^2}}{2}.}}
\]

The dots here (according to Newton’s notation, which is widely used in mechanics and physics) refer to the first derivatives of the coordinates, i.e. velocities of the masses. The Lagrangian of the system is written as follows:

\[
{L = T – V }
= {\frac{1}{2}\left[ {{m_1}\dot x_1^2 + {m_2}\dot x_2^2 – {k_1}x_1^2 }\right.}-{\left.{ {k_2}{{\left( {{x_2} – {x_1}} \right)}^2} – {k_3}x_2^2} \right].}
\]

Compose the differential Lagrange equations:

\[
{\frac{d}{{dt}}\frac{{\partial L}}{{\partial {{\dot x}_i}}} = \frac{{\partial L}}{{\partial {x_i}}}\;\;\text{or}\;\;}\kern-0.3pt
{\frac{d}{{dt}}\frac{{\partial L}}{{\partial {{\dot x}_1}}} = \frac{{\partial L}}{{\partial {x_1}}},\;\;}\kern-0.3pt
{\frac{d}{{dt}}\frac{{\partial L}}{{\partial {{\dot x}_2}}} = \frac{{\partial L}}{{\partial {x_2}}}.}
\]

Find the partial derivatives:

\[
{\frac{{\partial L}}{{\partial {{\dot x}_1}}} = \frac{1}{2} \cdot 2{m_1}{\dot x_1} = {m_1}{\dot x_1},\;\;}\kern-0.3pt
{{\frac{{\partial L}}{{\partial {x_1}}} \text{ = }}\kern0pt{\frac{1}{2}\left[ { – 2{k_1}{x_1} + 2{k_2}\left( {{x_2} – {x_1}} \right)} \right] }
= { – {k_1}{x_1} + {k_2}\left( {{x_2} – {x_1}} \right),}}
\]
\[
{\frac{{\partial L}}{{\partial {{\dot x}_2}}} = \frac{1}{2} \cdot 2{m_2}{\dot x_2} = {m_2}{\dot x_2},\;\;}\kern-0.3pt
{{\frac{{\partial L}}{{\partial {x_2}}} \text{ = }}\kern0pt{\frac{1}{2}\left[ { – 2{k_2}\left( {{x_2} – {x_1}} \right) – 2{k_2}{x_2}} \right] }
= { – {k_2}\left( {{x_2} – {x_1}} \right) – {k_3}{x_2}.}}
\]

As a result, we obtain the following system of equations describing the motion of the masses:

\[
{\left\{ \begin{array}{l}
{{m_1}{{\ddot x}_1} = – {k_1}{x_1} + {k_2}\left( {{x_2} }-{ {x_1}} \right)}\\
{{m_2}{{\ddot x}_2} = – {k_2}\left( {{x_2} – {x_1}} \right) }-{ {k_3}{x_2}}
\end{array} \right.,\;\;}\Rightarrow
{\left\{ \begin{array}{l}
{{{\ddot x}_1} = – \frac{{{k_1}}}{{{m_1}}}{x_1} + \frac{{{k_2}}}{{{m_1}}}{x_2} }-{ \frac{{{k_2}}}{{{m_1}}}{x_1}}\\
{{{\ddot x}_2} = – \frac{{{k_2}}}{{{m_2}}}{x_2} + \frac{{{k_2}}}{{{m_2}}}{x_1} }-{ \frac{{{k_3}}}{{{m_2}}}{x_2}}
\end{array} \right.,\;\;}\Rightarrow
{\left\{ \begin{array}{l}
{{\ddot x}_1} = – \frac{{{k_1} + {k_2}}}{{{m_1}}}{x_1} + \frac{{{k_2}}}{{{m_1}}}{x_2}\\
{{\ddot x}_2} = \frac{{{k_2}}}{{{m_2}}}{x_1} – \frac{{{k_2} + {k_3}}}{{{m_2}}}{x_2}
\end{array} \right..}
\]

This system can be written in matrix form:

\[
{\mathbf{\ddot X} = K\mathbf{X},\;\;}\kern-0.3pt{\text{where}}\;\;
{\mathbf{X} = \left[ {\begin{array}{*{20}{c}}
{{x_1}}\\
{{x_2}}
\end{array}} \right],\;\;}\kern-0.3pt
{\mathbf{\ddot X} = \left[ {\begin{array}{*{20}{c}}
{{{\ddot x}_1}}\\
{{{\ddot x}_2}}
\end{array}} \right],\;\;}\kern-0.3pt
{K = \left[ {\begin{array}{*{20}{c}}
{ – \frac{{{k_1} + {k_2}}}{{{m_1}}}}&{\frac{{{k_2}}}{{{m_1}}}}\\
{\frac{{{k_2}}}{{{m_2}}}}&{ – \frac{{{k_2} + {k_3}}}{{{m_2}}}}
\end{array}} \right].}
\]

We will seek the solution \(\mathbf{X}\left( t \right)\) in the form of harmonic oscillations, i.e. as

\[{\mathbf{X}\left( t \right) = \left[ {\begin{array}{*{20}{c}}
{{x_1}\left( t \right)}\\
{{x_2}\left( t \right)}
\end{array}} \right] }={ \left[ {\begin{array}{*{20}{c}}
{{B_1}}\\
{{B_2}}
\end{array}} \right]{e^{i\omega t}},}\]

where \({{B_1}},\) \({{B_2}}\) are the amplitudes of oscillations of the masses, \(\omega\) are the eigenfrequencies to be determined.

Substituting the trial functions \({x_1}\left( t \right),\) \({x_2}\left( t \right)\) into the matrix equation, we obtain the auxiliary equation that determines the eigenfrequencies:

\[
{\det \left( {K + {\omega ^2}I} \right) = 0,\;\;}\Rightarrow
{\left| {\begin{array}{*{20}{c}}
{ – \frac{{{k_1} + {k_2}}}{{{m_1}}} + {\omega ^2}}&{\frac{{{k_2}}}{{{m_1}}}}\\
{\frac{{{k_2}}}{{{m_2}}}}&{ – \frac{{{k_2} + {k_3}}}{{{m_2}}} + {\omega ^2}}
\end{array}} \right| = 0,\;\;}\Rightarrow
{{\left( {{\omega ^2} – \frac{{{k_1} + {k_2}}}{{{m_1}}}} \right) \cdot}\kern0pt{\left( {{\omega ^2} – \frac{{{k_2} + {k_3}}}{{{m_2}}}} \right) }-{ \frac{{k_2^2}}{{{m_1}{m_2}}} = 0,\;\;}}\Rightarrow
{{{\omega ^4} – \frac{{{k_1} + {k_2}}}{{{m_1}}}{\omega ^2} }-{ \frac{{{k_2} + {k_3}}}{{{m_2}}}{\omega ^2} }
+ {\frac{{\left( {{k_1} + {k_2}} \right)\left( {{k_2} + {k_3}} \right)}}{{{m_1}{m_2}}} }-{ \frac{{k_2^2}}{{{m_1}{m_2}}} = 0,\;\;}}\Rightarrow
{{{\omega ^4} \text{ − }}\kern0pt{ \left( {\frac{{{k_1} + {k_2}}}{{{m_1}}} + \frac{{{k_2} + {k_3}}}{{{m_2}}}} \right){\omega ^2} }
+ {\frac{{\left( {{k_1} + {k_2}} \right)\left( {{k_2} + {k_3}} \right)}}{{{m_1}{m_2}}} }-{ \frac{{k_2^2}}{{{m_1}{m_2}}} = 0.}}
\]

Solving this biquadratic equation, we find the eigenfrequencies. Let us first compute the discriminant:

\[
{D = {\left( {\frac{{{k_1} + {k_2}}}{{{m_1}}} + \frac{{{k_2} + {k_3}}}{{{m_2}}}} \right)^2} }
– {4\left[ {\frac{{\left( {{k_1} + {k_2}} \right)\left( {{k_2} + {k_3}} \right)}}{{{m_1}{m_2}}} }\right.}-{\left.{ \frac{{k_2^2}}{{{m_1}{m_2}}}} \right] }
= {{\left( {\frac{{{k_1} + {k_2}}}{{{m_1}}}} \right)^2} + {\left( {\frac{{{k_2} + {k_3}}}{{{m_2}}}} \right)^2} }
+ {\frac{{2\left( {{k_1} + {k_2}} \right)\left( {{k_2} + {k_3}} \right)}}{{{m_1}{m_2}}} }
– {\frac{{4\left( {{k_1} + {k_2}} \right)\left( {{k_2} + {k_3}} \right)}}{{{m_1}{m_2}}} }
+ {\frac{{4k_2^2}}{{{m_1}{m_2}}} }
= {{\left( {\frac{{{k_1} + {k_2}}}{{{m_1}}} – \frac{{{k_2} + {k_3}}}{{{m_2}}}} \right)^2} }
+ {\frac{{4k_2^2}}{{{m_1}{m_2}}}.}
\]

Then the square of the eigenfrequencies will be described by the formula

\[
{{\omega ^2} \text{ = }}\kern0pt
{\frac{1}{2}\Big\{ {\left( {\frac{{{k_1} + {k_2}}}{{{m_1}}} + \frac{{{k_2} + {k_3}}}{{{m_2}}}} \right) }}\kern0pt
{\pm{ {\Big[ {{{\left( {\frac{{{k_1} + {k_2}}}{{{m_1}}} – \frac{{{k_2} + {k_3}}}{{{m_2}}}} \right)}^2} }}}\kern0pt{{{+\,\frac{{4k_2^2}}{{{m_1}{m_2}}}} }\Big]}^{\frac{1}{2}} \Big\} }
\]

Further, to avoid cumbersome formulas, we consider the simpler case where the stiffness of all springs is the same: \({k_1} = {k_2} =\) \({k_3} = k.\) In addition, we introduce the mass ratio: \(\mu = {\large\frac{{{m_2}}}{{{m_1}}}\normalsize}.\) Then the formula for the square of the frequencies of oscillations takes the form:

\[
{{{\omega ^2} \text{ = }}\kern0pt
= {\frac{1}{2}\Big[ {\left( {\frac{{2k}}{{{m_1}}} + \frac{{2k}}{{{m_2}}}} \right) }}\pm{{ \sqrt {{{\left( {\frac{{2k}}{{{m_1}}} – \frac{{2k}}{{{m_2}}}} \right)}^2} + \frac{{4{k^2}}}{{{m_1}{m_2}}}} } \Big] }
= {k\Big[ {\left( {\frac{1}{{{m_1}}} + \frac{1}{{{m_2}}}} \right) }}\pm{{ \sqrt {{{\left( {\frac{1}{{{m_1}}} – \frac{1}{{{m_2}}}} \right)}^2} + \frac{1}{{{m_1}{m_2}}}} } \Big],\;\;}}\Rightarrow
{{{\omega ^2}{m_2} = k\Big[ {\left( {\frac{{{m_2}}}{{{m_1}}} + \frac{{{m_2}}}{{{m_2}}}} \right) }}\pm{{ \sqrt {{{\left( {\frac{{{m_2}}}{{{m_1}}} – \frac{{{m_2}}}{{{m_2}}}} \right)}^2} + \frac{{m_2^2}}{{{m_1}{m_2}}}} } \Big] }
= {k\Big[ {\mu + 1 \pm \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } } \Big],\;\;}}\Rightarrow
{{{\omega ^2} = \frac{k}{{{m_2}}}\Big[ {\mu + 1 }}\pm{{ \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } } \Big]}}
\]
Dependencies of the eigenfrequencies on the mass ratio

Figure 2.

The obtained expression describes \(2\) eigenfrequencies: \({\omega _1}\) (with the plus sign) and \({\omega _2}\) (with the minus sign). The dependencies of the frequencies \({\omega _1},\) \({\omega _2}\) on the mass ratio \(\mu\) are shown in Figure \(2.\) In the case of equal masses \(\left( {\mu = 1} \right),\) the eigenfrequencies are described by the following compact formulas:

\[{{\omega _1} = \sqrt {\frac{{3k}}{m}} ,\;\;}\kern-0.3pt{{\omega _2} = \sqrt {\frac{k}{m}} .}\]

Note that the frequencies \({\omega _1},\) \({\omega _2}\) are always real numbers. This follows from general physical considerations. Indeed, in the case of the imaginary frequency, there would be a leakage of energy, which contradicts the condition of conservation of energy in the system. This fact, however, can be proved purely mathematically. In fact, the question arises only for the frequency \({\omega _2}.\) The non-negativity condition for \(\omega _2^2\) is given by

\[
{\omega _2^2 \gt 0,\;\;}\Rightarrow
{{\mu + 1 }-{ \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } \gt 0,\;\;}}\Rightarrow
{\mu + 1 \gt \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } .}
\]

The left-hand side of the inequality and the expression under the square root on the right side are always positive. After squaring both sides, we obtain

\[\require{cancel}
{{{\left( {\mu + 1} \right)^2} }\gt{ {\left( {\mu – 1} \right)^2} + \mu ,\;\;}}\Rightarrow
{{\cancel{\mu ^2} + 2\mu + \cancel{1} }\gt{ \cancel{\mu ^2} – 2\mu + \cancel{1} + \mu ,\;\;}}\Rightarrow
{3\mu \gt 0,\;\;}\Rightarrow
{\mu \gt 0,}
\]

which always holds.

Now we find the eigenvector \({\mathbf{H}_1} = {\left( {{H_{11}},{H_{21}}} \right)^T}\) (the superscript \(^T\) denotes transposition) corresponding to the frequency \({\omega _1}.\) It is determined from the matrix-vector equation

\[\left( {K + \omega _1^2I} \right){\mathbf{H}_1} = \mathbf{0}.\]

Consequently,

\[
{\left\{ {\begin{array}{*{20}{l}}
{\Big( { – \frac{2}{{{m_1}}} + \frac{1}{{{m_2}}}\Big[ {\mu + 1 }}}+{{{ \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } } \Big]} \Big){H_{11}} + \frac{1}{{{m_1}}}{H_{21}} = 0}\\
{\frac{1}{{{m_2}}}{H_{11}} }+{ \Big( { – \frac{2}{{{m_1}}} + \frac{1}{{{m_2}}}\Big[ {\mu + 1 }}}+{{{ \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } } \Big]} \Big){H_{21}} = 0}
\end{array}} \right.}
\]

In the latter system, the two equations are linearly dependent (as the determinant of \(K\) is zero at \({\omega ^2} = \omega _1^2\)). Therefore, the coordinates of the eigenvector \({\mathbf{H}_1}\) can be expressed, for example, from the first equation. Let \({H_{11}} = 1.\) Then

\[
{{H_{21} \text{ = }}\kern0pt{ {m_1}\Big( {\frac{2}{{{m_1}}} – \frac{1}{{{m_2}}}\Big[ {\mu + 1 }}}}\kern0pt{{{{+\, \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } } \Big]} \Big) }}
= {{2 – \frac{1}{\mu }\Big[ {\mu + 1 }}+{{ \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } } \Big] }}
= {1 – \frac{{1 + \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } }}{\mu } }
= {\frac{{\mu – 1 – \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } }}{\mu }.}
\]

Thus, the vector \({\mathbf{H}_1}\) has the following coordinates:

\[{ {\mathbf{H}_1} = \left[ {\begin{array}{*{20}{c}}
{{H_{11}}}\\
{{H_{21}}}
\end{array}} \right] }={ \left[ {\begin{array}{*{20}{c}}
1\\
{\frac{{\mu – 1 – \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } }}{\mu }}
\end{array}} \right].}\]

Similarly, we can determine the eigenvector \({\mathbf{H}_2} = {\left( {{H_{12}},{H_{22}}} \right)^T},\) corresponding to the frequency \({\omega _2}.\) In this case, we have the following equation for \({\mathbf{H}_2}:\)

\[\left( {K + \omega _2^2 I} \right){\mathbf{H}_2} = \mathbf{0}.\]

In the expanded form it is written as

\[
{\left\{ {\begin{array}{*{20}{l}}
{\Big( { – \frac{2}{{{m_1}}} + \frac{1}{{{m_2}}}\Big[ {\mu + 1 }}}-{{{ \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } } \Big]} \Big){H_{12}} + \frac{1}{{{m_1}}}{H_{22}} = 0}\\
{\frac{1}{{{m_2}}}{H_{12}} }+{ \Big( { – \frac{2}{{{m_1}}} + \frac{1}{{{m_2}}}\Big[ {\mu + 1 }}}-{{{ \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } } \Big]} \Big){H_{22}} = 0}
\end{array}} \right.}
\]

Assuming \({H_{12}} = 1,\) we find the coordinate \({H_{22}}\) from the first equation:

\[
{{H_{22} \text{ = }}\kern0pt{ {m_1}\Big( {\frac{2}{{{m_1}}} – \frac{1}{{{m_2}}}\Big[ {\mu + 1 }}}}\kern0pt{{{{-\, \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } } \Big]} \Big) }}
= {{2 – \frac{1}{\mu }\Big[ {\mu + 1 }}-{{ \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } } \Big] }}
= {1 – \frac{{1 – \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } }}{\mu } }
= {\frac{{\mu – 1 + \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } }}{\mu }.}
\]

Hence,

\[{{\mathbf{H}_2} = \left[ {\begin{array}{*{20}{c}}
{{H_{12}}}\\
{{H_{22}}}
\end{array}} \right] }={ \left[ {\begin{array}{*{20}{c}}
1\\
{\frac{{\mu – 1 + \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } }}{\mu }}
\end{array}} \right].}\]

Once the eigenfrequencies \({\omega _1},{\omega _2}\) and eigenvectors \({\mathbf{H}_1},\) \({\mathbf{H}_2}\) are found, we can write the general solution of the system. Take into account that each of the eigenvectors corresponds to the square of the eigenfrequency, i.e. two values of frequency with opposite signs. The vector \({\mathbf{H}_1}\) is connected with two frequencies \(\pm{\omega _1},\) and the vector \({\mathbf{H}_2}\) is associated with the frequencies \(\pm{\omega _2}.\) As a result, the general complex solution is represented as the sum of four terms:

\[
{\mathbf{X}\left( t \right) = \left[ {\begin{array}{*{20}{c}}
{{x_1}\left( t \right)}\\
{{x_2}\left( t \right)}
\end{array}} \right] }
= {{C_1}{e^{i{\omega _1}t}}{\mathbf{H}_1} + {C_2}{e^{ – i{\omega _1}t}}{\mathbf{H}_1} }
+ {{C_3}{e^{i{\omega _2}t}}{\mathbf{H}_2} + {C_4}{e^{ – i{\omega _2}t}}{\mathbf{H}_2},}
\]

where \({C_1}, \ldots ,{C_4}\) are constant (in this case complex) numbers. Let these numbers be written as

\[
{{C_1} = {\alpha _1} + i{\beta _1},\;\;}\kern-0.3pt{{C_2} = {\alpha _2} + i{\beta _2},\;\;}\kern-0.3pt
{{C_3} = {\alpha _3} + i{\beta _3},\;\;}\kern-0.3pt
{{C_4} = {\alpha _4} + i{\beta _4}.}
\]

To keep the values of \({x_1}\left( t \right),{x_2}\left( t \right)\) real at any \(t,\) it is necessary to satisfy the following relationships:

\[
{{C_1} = {\bar C_2},\;\; }\Rightarrow{ {\alpha _1} + i{\beta _1} = {\alpha _2} – i{\beta _2},\;\;}\Rightarrow
{\left\{ {\begin{array}{*{20}{l}}
{{\alpha _1} = {\alpha _2}}\\
{{\beta _1} = – {\beta _2}}
\end{array}} \right.,}
\]
\[
{{C_3} = {{\bar C}_4},\;\; }\Rightarrow{ {\alpha _3} + i{\beta _3} = {\alpha _4} – i{\beta _4},\;\;}\Rightarrow
{\left\{ {\begin{array}{*{20}{l}}
{{\alpha _3} = {\alpha _4}}\\
{{\beta _3} = – {\beta _4}}
\end{array}} \right..}
\]

Then the imaginary terms of the general solution will be canceled. Indeed,

\[
{\mathbf{X}\left( t \right) = \left( {{\alpha _1} + i{\beta _1}} \right){e^{i{\omega _1}t}}{\mathbf{H}_1} }
+ {\left( {{\alpha _2} + i{\beta _2}} \right){e^{ – i{\omega _1}t}}{\mathbf{H}_1} }
+ {\left( {{\alpha _3} + i{\beta _3}} \right){e^{i{\omega _2}t}}{\mathbf{H}_2} }
+ {\left( {{\alpha _4} + i{\beta _4}} \right){e^{ – i{\omega _2}t}}{\mathbf{H}_2} }
= {{\alpha _1}\left( {{e^{i{\omega _1}t}} + {e^{ – i{\omega _1}t}}} \right){\mathbf{H}_1} }
+ {i{\beta _1}\left( {{e^{i{\omega _1}t}} – {e^{ – i{\omega _1}t}}} \right){\mathbf{H}_1} }
+ {{\alpha _3}\left( {{e^{i{\omega _2}t}} + {e^{ – i{\omega _2}t}}} \right){\mathbf{H}_2} }
+ {i{\beta _3}\left( {{e^{i{\omega _2}t}} – {e^{ – i{\omega _2}t}}} \right){\mathbf{H}_2}.}
\]

The expressions in the square brackets can be simplified by Euler’s formula:

\[
{{e^{i\omega t}} + {e^{ – i\omega t}} }
= {\cos \left( {\omega t} \right) + \cancel{i\sin \left( {\omega t} \right)} }
+ {\cos \left( { – \omega t} \right) + \cancel{i\sin \left( { – \omega t} \right)} }
= {2\cos \left( {\omega t} \right),}
\]
\[
{{e^{i\omega t}} – {e^{ – i\omega t}} }
= {\cancel{\cos \left( {\omega t} \right)} + i\sin \left( {\omega t} \right) }
– {\cancel{\cos \left( { – \omega t} \right)} – i\sin \left( { – \omega t} \right) }
= {2i\sin \left( {\omega t} \right).}
\]

Hence,

\[
{\mathbf{X}\left( t \right) \text{ = }}\kern0pt{ 2\left[ {{\alpha _1}\cos \left( {{\omega _1}t} \right) – {\beta _1}\sin\left( {{\omega _1}t} \right)} \right]{\mathbf{H}_1} }
+ {2\left[ {{\alpha _3}\cos \left( {{\omega _2}t} \right) – {\beta _3}\sin\left( {{\omega _2}t} \right)} \right]{\mathbf{H}_2}.}
\]

Further, it is convenient to introduce the phase angles \({\varphi _1},{\varphi _2}\) and use the trigonometric identity

\[{\cos \left( {\omega t + \varphi } \right) }={ \cos \omega t\cos \varphi – \sin \omega t\sin \varphi .}\]

As a result, the general solution will be written in the following form:

\[
{\mathbf{X}\left( t \right) = \left( {\begin{array}{*{20}{c}}
{{x_1}\left( t \right)}\\
{{x_2}\left( t \right)}
\end{array}} \right) }
= {{A_1}\cos \left( {{\omega _1}t + {\varphi _1}} \right){\mathbf{H}_1} }
+ {{A_2}\cos \left( {{\omega _2}t + {\varphi _2}} \right){\mathbf{H}_2},}
\]

where the real constants \({A_1},\) \({A_2},\) \({\varphi _1},\) \({\varphi _2}\) depend on the initial displacements and velocities of the masses, and the eigenfrequencies \({\omega_1},\) \({\omega_2}\) and eigenvectors \({\mathbf{H}_1},\) \({\mathbf{H}_2}\) are given by

\[{{\omega _{1,2}} = \sqrt {\frac{k}{{{m_2}}}} {\Big[ {\mu + 1 }}\pm{{ \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } } \Big]^{\large\frac{1}{2}\normalsize}},}\]
\[
{{{\mathbf{H}_1} = \left[ {\begin{array}{*{20}{c}}
{{H_{11}}}\\
{{H_{21}}}
\end{array}} \right] }={ \left[ {\begin{array}{*{20}{c}}
1\\
{\frac{{\mu + 1 – \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } }}{\mu }}
\end{array}} \right],\;\;\;}}\kern-0.3pt
{{{\mathbf{H}_2} = \left[ {\begin{array}{*{20}{c}}
{{H_{12}}}\\
{{H_{22}}}
\end{array}} \right] }={ \left[ {\begin{array}{*{20}{c}}
1\\
{\frac{{\mu + 1 + \sqrt {{{\left( {\mu – 1} \right)}^2} + \mu } }}{\mu }}
\end{array}} \right].}}
\]

The change of the velocities of the masses can be found by differentiating the general solution:

\[
{\mathbf{\dot X}\left( t \right) = \left[ {\begin{array}{*{20}{c}}
{{{\dot x}_1}\left( t \right)}\\
{{{\dot x}_2}\left( t \right)}
\end{array}} \right] }
= { – {A_1}{\omega _1}\sin \left( {{\omega _1}t + {\varphi _1}} \right){\mathbf{H}_1} }
– {{A_2}{\omega _2}\sin\left( {{\omega _2}t + {\varphi _2}} \right){\mathbf{H}_2}.}
\]

From here it follows that if the velocities are zero at the initial time \(t = 0,\) the phase angles \({\varphi _1},\) \({\varphi _2}\) are also zero. Next, we consider just this case. The general solution is the sum of two harmonics with frequencies \({\omega_1},\) \({\omega_2}:\)

\[
{\mathbf{X}\left( t \right) = \left[ {\begin{array}{*{20}{c}}
{{x_1}\left( t \right)}\\
{{x_2}\left( t \right)}
\end{array}} \right] }
= {{A_1}\cos \left( {{\omega _1}t} \right){\mathbf{H}_1} }+{ {A_2}\cos \left( {{\omega _2}t} \right){\mathbf{H}_2}.}
\]

Compute the constants \({A_1},\) \({A_2}\) depending on the initial displacements. Suppose that

\[\mathbf{X}\left( 0 \right) = \left[ {\begin{array}{*{20}{c}}
{{x_1}\left( 0 \right)}\\
{{x_2}\left( 0 \right)}
\end{array}} \right] = \left[ {\begin{array}{*{20}{c}}
{{x_{10}}}\\
{{x_{20}}}
\end{array}} \right].\]

Consequently,

\[
{\mathbf{X}\left( 0 \right) = \left[ {\begin{array}{*{20}{c}}
{{x_{10}}}\\
{{x_{20}}}
\end{array}} \right] }={ {A_1}{\mathbf{H}_1} + {A_2}{\mathbf{H}_2},\;\;}\Rightarrow
{\left\{ {\begin{array}{*{20}{l}}
{{A_1}{H_{11}} + {A_2}{H_{12}} = {x_{10}}}\\
{{A_1}{H_{21}} + {A_2}{H_{22}} = {x_{20}}}
\end{array}} \right..}
\]

This algebraic system can be solved by Cramer’s rule:

\[
{{\Delta = \left| {\begin{array}{*{20}{c}}
{{H_{11}}}&{{H_{12}}}\\
{{H_{21}}}&{{H_{22}}}
\end{array}} \right| }={ {H_{11}}{H_{22}} – {H_{12}}{H_{21}},\;\;\;}}\kern-0.3pt
{{{\Delta _1} = \left| {\begin{array}{*{20}{c}}
{{x_{10}}}&{{H_{12}}}\\
{{x_{20}}}&{{H_{22}}}
\end{array}} \right| }={ {x_{10}}{H_{22}} – {x_{20}}{H_{12}},\;\;\;}}\kern-0.3pt
{{{\Delta _2} = \left| {\begin{array}{*{20}{c}}
{{H_{11}}}&{{x_{10}}}\\
{{H_{21}}}&{{x_{20}}}
\end{array}} \right| }={ {x_{20}}{H_{11}} – {x_{10}}{H_{21}},}}
\]
\[
{{\Rightarrow {A_1} = \frac{{{\Delta _1}}}{\Delta } }={ \frac{{{x_{10}}{H_{22}} – {x_{20}}{H_{12}}}}{{{H_{11}}{H_{22}} – {H_{12}}{H_{21}}}},\;\;\;}}\kern-0.3pt
{{{A_2} = \frac{{{\Delta _2}}}{\Delta } }={ \frac{{{x_{20}}{H_{11}} – {x_{10}}{H_{21}}}}{{{H_{11}}{H_{22}} – {H_{12}}{H_{21}}}}.}}
\]

Thus, at the initial conditions

\[{\mathbf{X}\left( 0 \right) = \left[ {\begin{array}{*{20}{c}}
{{x_{10}}}\\
{{x_{20}}}
\end{array}} \right],\;\;}\kern-0.3pt{\mathbf{\dot X}\left( 0 \right) = \left[ {\begin{array}{*{20}{c}}
0\\
0
\end{array}} \right]}\]

we obtain the following formula for the general solution:

\[
{\mathbf{X}\left( t \right) = \left[ {\begin{array}{*{20}{c}}
{{x_1}\left( t \right)}\\
{{x_2}\left( t \right)}
\end{array}} \right] }
= {{A_1}\cos \left( {{\omega _1}t} \right){\mathbf{H}_1} }
+ {{A_2}\cos \left( {{\omega _2}t} \right){\mathbf{H}_2},}
\]

where the constants \({A_1},\) \({A_2}\) are given by

\[
{{A_1} = \frac{{{x_{10}}{H_{22}} – {x_{20}}{H_{12}}}}{{{H_{11}}{H_{22}} – {H_{12}}{H_{21}}}},\;\;\;}\kern-0.3pt
{{A_2} = \frac{{{x_{20}}{H_{11}} – {x_{10}}{H_{21}}}}{{{H_{11}}{H_{22}} – {H_{12}}{H_{21}}}},}
\]

and the eigenvectors and eigenfrequencies are expressed in terms of the mass ratio \(\mu,\) the mass of the second body \({m_2},\) and the spring constant \(k\) by the above formulas.

The obtained expressions are considerably simplified when both masses are equal. Putting \(\mu = 1,\) we obtain the following formula (for the same initial conditions):

\[
{\mathbf{X}\left( t \right) = \left( {\begin{array}{*{20}{c}}
{{x_1}\left( t \right)}\\
{{x_2}\left( t \right)}
\end{array}} \right) }
= {{A_1}\cos \left( {{\omega _1}t} \right){\mathbf{H}_1} }
+ {{A_2}\cos \left( {{\omega _2}t} \right){\mathbf{H}_2},\;\;\text{where}}
\]
\[
{{\omega _1} = \sqrt {\frac{{3k}}{m}} ,\;\;}\kern-0.3pt{{\omega _2} = \sqrt {\frac{k}{m}} ,\;\;}\kern-0.3pt
{{\mathbf{H}_1} = \left[ {\begin{array}{*{20}{c}}
{{H_{11}}}\\
{{H_{12}}}
\end{array}} \right] = \left[ {\begin{array}{*{20}{r}}
1\\
{ – 1}
\end{array}} \right],\;\;}\kern-0.3pt
{{\mathbf{H}_2} = \left[ {\begin{array}{*{20}{c}}
{{H_{12}}}\\
{{H_{22}}}
\end{array}} \right] = \left[ {\begin{array}{*{20}{c}}
1\\
1
\end{array}} \right],\;\;}\kern-0.3pt
{{A_1} = \frac{{{x_{10}} – {x_{20}}}}{2},\;\;}\kern-0.3pt{{A_2} = \frac{{{x_{10}} + {x_{20}}}}{2}.}
\]

Therefore in the case of equal masses and equal stiffness coefficients, the motion of the masses is given by

\[
{{x_1}\left( t \right) \text{ = }}\kern0pt{ \frac{{{x_{10}} + {x_{20}}}}{2}\cos \left( {\sqrt {\frac{k}{m}} t} \right) }+{ \frac{{{x_{10}} – {x_{20}}}}{2}\cos \left( {\sqrt {\frac{{3k}}{m}} t} \right)}
\]
\[
{{x_2}\left( t \right) \text{ = }}\kern0pt{ \frac{{{x_{10}} + {x_{20}}}}{2}\cos \left( {\sqrt {\frac{k}{m}} t} \right) }-{ \frac{{{x_{10}} – {x_{20}}}}{2}\cos \left( {\sqrt {\frac{{3k}}{m}} t} \right).}
\]

At the beginning of the web-page, you can see an animation showing the character of oscillations of the masses connected by springs for various system parameters \(\mu,\) \(k\) and initial displacements \({x_{10}},\) \({x_{20}}.\) The mass of the second body was set \({m_2} =\) \( 2\,\text{kg}\) in the model. The stiffness \(k\) is measured in \(\large\frac{\text{N}}{\text{m}}\normalsize.\) The displacements of the masses are shown in centimeters on the scale \(1\,\text{cm} =\) \( 1\,\text{pixel}\) (the scale of the graph is \(1\,\text{cm} =\) \(3\,\text{pixels}.\)).

It is seen that the system exhibits a beating phenomenon, in which the energy is distributed cyclically from one mass to another. This is a typical behavior when the two eigenfrequencies are nearly equal. At close initial displacements of one sign, the masses move in phase. Conversely, when the masses have opposite initial displacements we observe an anti-phase movement.

Mass-spring systems are the physical basis for modeling and solving many engineering problems.
Such models are used in the design of building structures, or, for example, in the development of sportswear. Of course, the system of equations in real situations can be much more complex.