How to find eigenvalues of the matrix This is a question from our end-semester exam:

How to find the eigenvalues of the given matrix:

M=\begin{bmatrix}
5,1,1,1,1,1\\
1,5,1,1,1,1\\
1,1,5,1,1,1\\
1,1,1,5,1,1\\
1,1,1,1,4,0\\
1,1,1,1,0,4\\
\end{bmatrix}
I know that $4$ is an eigenvalue of $M$ with multiplicity atleast $3$ since $M-4I$ has $4$ identical rows.
Is there any way to find all eigenvalues of this matrix? I could find only $3$ out of $6$.
 A: For block matrices, you can use Schur complement:
$$0=\det(M-I\lambda)=\begin{vmatrix}A&B\\ C&D\end{vmatrix}=\det(D)\cdot \det(A-B\cdot D^{-1}\cdot C)= \\
\begin{vmatrix}4-\lambda&0\\ 0&4-\lambda\end{vmatrix}\cdot \det\left(A-B\cdot \begin{pmatrix}\frac1{4-\lambda}&0\\ 0&\frac1{4-\lambda}\end{pmatrix}\cdot C\right)=\\
\small(4-\lambda)^2\det\left(\begin{pmatrix}5-\lambda&1&1&1\\ 1&5-\lambda&1&1\\ 1&1&5-\lambda&1\\ 1&1&1&5-\lambda\end{pmatrix}-\frac2{4-\lambda}\begin{pmatrix}1&1&1&1\\ 1&1&1&1\\ 1&1&1&1\\ 1&1&1&1\end{pmatrix}\right)=\\
\small\frac1{(4-\lambda)^2}\cdot \det\begin{pmatrix}\lambda^2-9\lambda+18&2-\lambda&2-\lambda&2-\lambda\\ 2-\lambda&\lambda^2-9\lambda+18&2-\lambda&2-\lambda\\ 2-\lambda&2-\lambda&\lambda^2-9\lambda+18&2-\lambda\\ 2-\lambda&2-\lambda&2-\lambda&\lambda^2-9\lambda+18\end{pmatrix}=\\
\small \frac{\lambda^2-12\lambda+24}{(4-\lambda)^2}\cdot \det\small{\begin{pmatrix}1&1&1&1\\ 2-\lambda&\lambda^2-9\lambda+18&2-\lambda&2-\lambda\\ 2-\lambda&2-\lambda&\lambda^2-9\lambda+18&2-\lambda\\ 2-\lambda&2-\lambda&2-\lambda&\lambda^2-9\lambda+18\lambda\end{pmatrix}}=\\
\small\frac{\lambda^2-12\lambda+24}{(4-\lambda)^2}\cdot\det\small{\begin{pmatrix}\lambda^2-8\lambda+16&0&0\\ 0&\lambda^2-8\lambda+16&0\\ 0&0&\lambda^2-8\lambda+16\end{pmatrix}}=\\
\frac{\lambda^2-12\lambda+24}{(4-\lambda)^2}\cdot (4-\lambda)^6=0 \Rightarrow \\
(4-\lambda)^4\cdot (\lambda^2-12\lambda+24)=0\Rightarrow \\
\lambda_{1,2,3,4}=4, \lambda_{5,6}=2(3\pm \sqrt{3}).$$
A: Let $x=(1,1,1,1,0,0)^T$ and $y=(0,0,0,0,1,1)^T$. Then
$$
M=4I+(x+y)(x+y)^T-yy^T=4I+xx^T+xy^T+yx^T.
$$
Since $x\perp y$, $M$ is orthogonally similar to
$$
4I+\|x\|^2e_1e_1^T+\|x\|\|y\|(e_1e_2^T+e_2e_1^T)=4I+\left(\begin{bmatrix}4&\sqrt{8}\\ \sqrt{8}&0\end{bmatrix}\oplus0\right).
$$
Hence the spectrum of $M$ is
$$
4+\{2+\sqrt{12},\ 2-\sqrt{12},0,0,0,0\}=\{6+\sqrt{12},\ 6-\sqrt{12},4,4,4,4\}.
$$
Edit. The characteristic polynomial of $M$ over $\mathbb R$ is thus $p(x)=(x-4)^4(x^2-12x+24)$. As $\mathbb Z$ is a subring of $\mathbb R$, the characteristic polynomial over $\mathbb Z$ is also $p$. If the entries of $M$ are taken from a general commutative ring $R$ instead, since there is a ring homomorphism from $\mathbb Z$ to $R$, the characteristic polynomial of $M$ over $R$ is still $p$.
