
On the top of Figure we have $\:n+1\:$ ideal springs and $\:n\:$ particles in equilibrium. The constants of the springs are $\:k_{\rho}\: (\rho=1,2,\cdots, n+1) \:$ with equilibrium lengths $\:\ell_{\rho}\:(\rho=1,2,\cdots, n+1 )\:$ and the particle masses $\:m_{\rho}\:(\rho=1,2,\cdots, n)$. Disturbing the system from this equilibrium, the equation of motion of the particle $\:m_{\rho}\:$ is
\begin{equation}
m_{\rho}\ddot{x}_{\rho}
=-k_{\rho}\left(x_{\rho}-x_{\rho-1} \right)+k_{\rho+1}\left(x_{\rho+1}-x_{\rho} \right)
\tag{01}
\end{equation}
where $\:x_{\rho}(t)\:$ the displacement of this particle from its equilibrium position, see in the middle of above Figure. We set $\:x_{0}(t)=0\:$ and $\:x_{n+1}(t)=0\:$ for the extreme fixed points A and B respectively.
Equation (01) may be written as
\begin{equation}
m_{\rho}\ddot{x}_{\rho}-k_{\rho}x_{\rho-1} +\left(k_{\rho}+k_{\rho+1} \right)x_{\rho}-k_{\rho+1}x_{\rho+1}=0
\tag{02}
\end{equation}
or
\begin{equation}
\mathrm{M}\ddot{\mathbf{x}}+\mathrm{K}\mathbf{x}=0
\tag{03}
\end{equation}
where
\begin{equation}
\mathbf{x}=
\begin{bmatrix}
x_{1}\\
x_{2}\\
x_{3}\\
\vdots\\
x_{n-1}\\
x_{n}
\end{bmatrix}
\in \mathbb{R}^{n}
\tag{04}
\end{equation}
$\:\mathrm{M}\:$ the $\:n \times n\:$ diagonal matrix
\begin{equation}
\mathrm{M}=
\begin{bmatrix}
m_{1} & 0 & 0 & \cdots & 0 & 0 \\
0 & m_{2} & 0 & \cdots & 0 & 0 \\
0 & 0 & m_{3} & \cdots & 0 & 0 \\
\vdots & \vdots & \vdots & \cdots & \vdots & \vdots \\
0 & 0 & 0 & \cdots & m_{n-1} & 0 \\
0 & 0 & 0 & \cdots & 0 & m_{n}
\end{bmatrix}
\tag{05}
\end{equation}
and $\:\mathrm{K}\:$ the $\:n \times n\:$ tridiagonal symmetric matrix
\begin{equation}
\mathrm{K}=
\begin{bmatrix}
(k_{1}+k_{2}) & -k_{2} & 0 & \cdots & 0 & 0 \\
-k_{2} & (k_{2}+k_{3}) & -k_{3} & \cdots & 0 & 0 \\
0 & -k_{3} & (k_{3}+k_{4}) & \cdots & 0 & 0 \\
\vdots & \vdots & \vdots & \cdots & \vdots & \vdots \\
0 & 0 & 0 & \cdots & (k_{n-1}+k_{n}) & -k_{n} \\
0 & 0 & 0 & \cdots & -k_{n} & (k_{n}+k_{n+1})
\end{bmatrix}
\tag{06}
\end{equation}
Equation (03) yields
\begin{equation}
\ddot{\mathbf{x}}+\left(\mathrm{M}^{-1}\mathrm{K}\right)\mathbf{x}=0
\tag{08}
\end{equation}
or
\begin{equation}
\ddot{\mathbf{x}}+\mathrm{S}\mathbf{x}=0, \qquad \mathrm{S}\equiv \mathrm{M}^{-1}\mathrm{K}
\tag{09}
\end{equation}
Now if $\:\mathrm{S}=\mathrm{M}^{-1}\mathrm{K}\:$ is diagonalizable with eigenvalues $\:\lambda_{\rho}\:(\rho=1,2,\cdots, n)$ and $\:\mathrm{P}\:$ a invertible matrix which diagonalizes it then
\begin{equation}
\mathrm{P}^{-1}\mathrm{S} \mathrm{P} = \rm{diag}\left(\lambda_{1},\lambda_{2},\cdots,\lambda_{n}\right)
\tag{10}
\end{equation}
Defining
\begin{equation}
\mathbf{y}\equiv\mathrm{P}^{-1}\mathbf{x}
\tag{11}
\end{equation}
and multiplying (09) by $\:\mathrm{P}^{-1}\:$, we have
\begin{equation}
\ddot{\mathbf{y}}+\left(\mathrm{P}^{-1}\mathrm{S} \mathrm{P}\right)\mathbf{y}=0
\tag{12}
\end{equation}
that is $\:n \:$ independent differential equations
\begin{equation}
\ddot{y}_{\rho}+\lambda_{\rho}y_{\rho}=0, \quad \rho=1,2,\cdots, n
\tag{13}
\end{equation}
Note that taking the inner product of (03) with the "velocity" $\:n-$vector $\:\dot{\mathbf{x}} \:$
\begin{equation}
\dot{\mathbf{x}}=
\begin{bmatrix}
\dot{x}_{1}\\
\dot{x}_{2}\\
\dot{x}_{3}\\
\vdots\\
\dot{x}_{n-1}\\
\dot{x}_{n}
\end{bmatrix}
\in \mathbb{R}^{n}
\tag{14}
\end{equation}
we have
\begin{equation}
\langle\mathrm{M}\ddot{\mathbf{x}},\dot{\mathbf{x}}\rangle+\langle\mathrm{K}\mathbf{x},\dot{\mathbf{x}}\rangle=0
\tag{15}
\end{equation}
that is the equation of conservation of energy
\begin{equation}
\dfrac{ \mathrm{d} }{\mathrm{d}t }\left[\frac12\langle\mathrm{M}\dot{\mathbf{x}},\dot{\mathbf{x}}\rangle+\frac12\langle\mathrm{K}\mathbf{x},\mathbf{x}\rangle\right]=0
\tag{16}
\end{equation}
related to the question.
For the special case of a common spring constant $\:k_{\rho}=k \: (\rho=1,2,\cdots, n+1) \:$ and common particle mass $\:m_{\rho}=m \: (\rho=1,2,\cdots, n) \:$, equation (08) gives
\begin{equation}
\ddot{\mathbf{x}}+\omega_{o}^{2}\,\mathrm{\Xi}\,\mathbf{x}=0
\tag{17}
\end{equation}
where
\begin{equation}
\omega_{o}\equiv \sqrt{\dfrac{k}{m}}= \textrm{fundamental frequency}
\tag{18}
\end{equation}
and $\:\mathrm{\Xi}\:$ the following $\:n \times n\:$ tridiagonal symmetric matrix (a special case of the so-called Toeplitz matrices)
\begin{equation}
\mathrm{\Xi}=
\begin{bmatrix}
2& -1 & 0 & \cdots & 0 & 0 \\
-1 & 2 & -1 & \cdots & 0 & 0 \\
0 & -1 & 2& \cdots & 0 & 0 \\
\vdots & \vdots & \vdots & \cdots & \vdots & \vdots \\
0 & 0 & 0 & \cdots & 2 & -1 \\
0 & 0 & 0 & \cdots & -1& 2
\end{bmatrix}
\tag{19}
\end{equation}
with real positive eigenvalues
\begin{equation}
\xi_{\rho}= 4\sin^{2}\left[ \rho\dfrac{\pi}{2(n+1)} \right]=2\Bigg(1-\cos\left[ \rho\dfrac{\pi}{(n+1)} \right]\Bigg), \quad \rho=1,2,\cdots, n
\tag{20}
\end{equation}
and eigenvectors(1) $\:\mathbf{e}_{\rho}\:$ with $\:\sigma-$component
\begin{equation}
\left(\mathbf{e}_{\rho} \right)_{\sigma}=\sqrt{\dfrac{2}{n+1}}\sin\left( \rho \sigma \dfrac{\pi}{n+1} \right) , \quad \rho,\sigma=1,2,\cdots, n
\tag{21}
\end{equation}
In this special case the system of independent equations (13) is
\begin{equation}
\ddot{y}_{\rho}+\left(\xi_{\rho}\omega_{o}^{2}\right)y_{\rho}=0, \quad \rho=1,2,\cdots, n
\tag{22}
\end{equation}
that is :
The motion of a system of $\:n\:$ particles of the same mass $\:m\:$ connected by $\:n+1\:$ ideal springs of the same constant $\:k\:$, see Figure above, is the superposition of $\:n\:$ independent harmonic oscillations with frequences
\begin{equation}
\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\omega_\rho=\sqrt{\xi_{\rho}}\omega_o=2\omega_o \sin\left[\rho\dfrac{\pi}{2(n+1)} \right],\:\:\omega_{o}\equiv \sqrt{\dfrac{k}{m}} , \:\: \rho=1,2,\cdots,n-1,n
\tag{23}
\end{equation}
as shown in Figure below.

(1) Any $\:n \times n\:$ tridiagonal symmetric Toeplitz matrix has the same eigenvectors !!!
EDIT
For other more general cases a useful theorem from "Matrix Theory" by Joel N.Franklin, is given below unchanged :
Theorem Let $\:\mathrm{M}\:$ and $\:\mathrm{K}\:$ be $\:n \times n\:$ Hermitian matrices. If $\:\mathrm{M}\:$ positive definite, then there is a $\:n \times n\:$ matrix $\:\mathrm{C}\:$ for which
\begin{equation}
\mathrm{C}^{*}\mathrm{M}\mathrm{C}=\mathrm{I} \quad \textrm{and} \quad \mathrm{C}^{*}\mathrm{K}\mathrm{C}=\Lambda= \rm{diag}\left(\lambda_{1},\lambda_{2},\cdots,\lambda_{n}\right)
\tag{t-17}
\end{equation}
The numbers $\:\lambda_{j}\:$ are real. If $\:\mathrm{K}\:$ is positive definite, the $\:\lambda_{j}\:$ are positive. The $\:\lambda_{j}\:$
are generalized eigenvalues satisfying
\begin{equation}
\mathrm{K}\,c^{j}=\lambda_{j}\,\mathrm{M}\,c^{j}, \quad c^{j}\ne 0 \quad (j=1,\cdots, n)
\tag{t-18}
\end{equation}
If $\:\mathrm{K}\:$ and $\:\mathrm{M}\:$ are real, then a real matrix $\:\mathrm{C}\:$, with columns $\:c^{j}\:$, may be found satisfying (t-17) and (t-18).