Q:

How find this $\det(M_{n})$

Let $n$ be a postive integer, let $a,b,c$ be real numbers, with $a\neq b$, and let $M_{n}$ denote the $2n\times 2n$ matrix whose $(i,j)$ entry $m_{ij}$ is given by
$$m_{ij}=\begin{cases}
x & \text{if } \ i=j\\
a&\text{if }\ i\neq j,i+j=2k,\\
b&\text{if } \ i\neq j,i+j=2k+1
\end{cases}$$
Find the $\det (M_{n})$
I fell this matrix is very ugly, and I can't find it.  Thank you

A:

Let
$$\begin{align}
  u_1 &= \begin{pmatrix}1\\1\\\vdots\\1\\1\end{pmatrix}
& u_2 &= \begin{pmatrix}1\\-1\\\vdots\\1\\-1\end{pmatrix}
\end{align}$$
with $2n$ rows each. 
Furthermore, let
$$ L_n = \frac{a+b}{2}u_1^~ u_1^\top + \frac{a-b}{2}u_2^~ u_2^\top = \begin{pmatrix}a&b&a&b&\cdots&a&b\\b&a&b&a&\cdots&b&a\\\vdots&\vdots&\vdots&\vdots&\ddots&\vdots&\vdots\\a&b&a&b&\cdots&a&b\\b&a&b&a&\cdots&b&a\end{pmatrix}$$
Then
$$M_n = L_n + (x-a)I\tag{*}$$
where $I$ is the $2n\times2n$ identity matrix. 
Note that $u_1$ and $u_2$ are orthogonal eigenvectors of $L_n$ and $M_n$,
in particular,
$$\begin{align}
L_n u_1 &= n(a+b) u_1 & L_n u_2 &= n(a-b) u_2
\end{align}$$
and all other vectors orthogonal to both $u_1$ and $u_2$ are mapped to zero by $L_n$.
Therefore $L_n$ has eigenvalues
$$\begin{align}
\lambda_1 &= n(a+b) & \lambda_2 &= n(a-b) & \lambda_3 = \lambda_4 = \ldots = \lambda_{2n} = 0
\end{align}$$
And by (*), $M_n$ has eigenvalues
$$\begin{align}
\mu_1 &= n(a+b)+(x-a) & \mu_2 &= n(a-b)+(x-a) & \mu_3 = \mu_4 = \ldots = \mu_{2n} = (x-a)
\end{align}$$
The determinant is the product of all eigenvalues, therefore we get
$$\det M_n = \left(n(a+b)+(x-a)\right)\left(n(a-b)+(x-a)\right)(x-a)^{2n-2}$$

