In a $2k \times 2k $ matrix all the entries on the main diagonal are $c$, and the rest of all the entries are $d$.
How do you get the determinant of the matrix?
In a $2k \times 2k $ matrix all the entries on the main diagonal are $c$, and the rest of all the entries are $d$.
How do you get the determinant of the matrix?
Hint
$$\begin{vmatrix}c & d & d & d \\ d & c & d & d \\ d& d & c& d \\d & d & d & c\end{vmatrix}=\begin{vmatrix}c+3d & d & d & d \\c+3d & c & d & d \\c+3d& d & c& d \\c+3d& d & d & c\end{vmatrix}=(c+3d)\begin{vmatrix}1 & d & d & d \\1 & c & d & d \\1& d & c& d \\1& d & d & c\end{vmatrix}=(c+3d)\begin{vmatrix}1 & d & d & d \\0 & c-d & 0 & 0 \\ 0& 0 & c-d& 0\\0& 0 & 0 & c-d\end{vmatrix}=(c+3d)(c-d)^3.$$
Consider the $n\times n$ matrix $J_n$ having all $1$ as coefficients. Then your matrix can be written as $A=dJ_n-(d-c)I_n$, where $I_n$ is the $n\times n$ identity. If $p(X)=\det(dJ_n-XI_n)$ is the characteristic polynomial of $dJ_n$, then $$ \det A=p(d-c) $$ Now, for $d\ne0$, the matrix $dJ_n$ has the eigenvalue $nd$; the $0$ eigenvalue has geometric multiplicity $n-1$, so also algebraic multiplicity $n-1$, because $nd$ has algebraic multiplicity at least $1$ (hence exactly $1$). Therefore the characteristic polynomial is $$ p(X)=(0-X)^{n-1}(nd-X) $$ and therefore $$ \det A=p(d-c)=(c-d)^{n-1}(nd-d+c) $$ The formula also holds for $d=0$, when $dJ_n-(d-c)I_n=cI_n$.
Slight overkill, but another way to do this is to note that the given matrix is circulant, whose determinant has a closed form expression. Specializing to the OP's matrix, we are led to a geometric sum, which gives the determinant value equal to $(c-d)^{2k-1}\left(c + (2k-1)d\right)$.
Let $e$ be the all one vector of length $2k$.
If $c=d$, I am sure you know the solution.
If $c \neq d$:
The matrix can be written as $$(c-d)I_{2k}+(de)e^T$$
Hence by matrix determinant lemma:
\begin{align} \det((c-d)I_{2k}+(de)e^T)&=(1+e^T\frac{1}{c-d}I_{2k}(de))\det((c-d)I_{2k)}\\ &=\left(1+\frac{2kd}{c-d}\right)(c-d)^{2k} \\ &=(c-d)^{2k-1}(c-d+2kd)\\ &=(c+(2k-1)d)(c-d)^{2k-1} \end{align}
Note: matrix determiant lemma: $$\det(A+uv^T)=(1+v^TA^{-1}u)det(A)$$
Let $E $ be the matrix will all entries equal to $1$. Then $A=dE+(c-d)I $. So the eigenvalues of $A $ are of the form $d\lambda_j+c-d $, where $\lambda_1,\ldots,\lambda_{2k} $ are the eigenvalues of $E $.
Since $E^2=2kE $, its eigenvalues satisfy $\lambda^2=2k\lambda $, so possible eigenvalues are $2k$ and $0$. As $E$ is rank-one ($E=ee^T $, where $e $ is the vector with all entries equal to one), the eigenvalues are $$2k,0,\ldots,0. $$ Then the eigenvalues of $A=dE+(c-d)I $ are $$ 2dk+(c-d), (c-d),\ldots, (c-d). $$ and $$\det A=(2dk+c-d)(c-d)^{2k-1}. $$