Given, a matrix:
$$\begin{pmatrix} a & b & \ldots & b & b \\ -b & a & \ldots & b & b \\ \ldots & \ldots & \ldots & \ldots & \ldots \\ -b & -b & \ldots & a & b \\ -b & -b & \ldots & -b & a \end{pmatrix}.$$
I need to find a determinant. So initially what I did, was I added the first column to other ones:
$$\begin{pmatrix} a & b+a & \ldots & b+a & b+a \\ -b & a-b & \ldots & 0 & 0 \\ \ldots & \ldots & \ldots & \ldots & \ldots \\ -b & -2b & \ldots & a-b & 0 \\ -b & -2b & \ldots & -2b & a-b \end{pmatrix},$$
then added the last row to the first one
$$\begin{pmatrix} a-b & a-b & \ldots & a-b & 2a \\ -b & a-b & \ldots & 0 & 0 \\ \\ \ldots & \ldots & \ldots & \ldots & \ldots \\ -b & -2b & \ldots & a-b & 0 \\ -b & -2b & \ldots & -2b & a-b\end{pmatrix},$$
then multiplied the first column by 2 and subtracted the second one
$$\frac{1}{2}\cdot\begin{pmatrix} a-b & a-b & \ldots & a-b & 2a \\ -a-b & a-b & \ldots & 0 & 0 \\ \\ \ldots & \ldots & \ldots & \ldots & \ldots \\ 0 & -2b & \ldots & a-b & 0 \\ 0 & -2b & \ldots & -2b & a-b\end{pmatrix},$$
then expanded it using the first column and got:
$$\frac{1}{2}\cdot(a-b)^n + (a+b)\cdot \begin{pmatrix} a-b & a-b & \ldots & a-b & 2a \\ -2b & a-b & \ldots & 0 & 0 \\ \\ \ldots & \ldots & \ldots & \ldots & \ldots \\ -2b & -2b & \ldots & a-b & 0 \\ -2b & -2b & \ldots & -2b & a-b\end{pmatrix}_{(n-1)\times(n-1)}.$$
Then I conjecture that $(n-1)\times(n-1)$ determinant in the latter expression is equal to $(a+b)^(n-1)$, because:
$$ B_{n-1} := \begin{pmatrix} a-b & a-b & \ldots & a-b & 2a \\ -2b & a-b & \ldots & 0 & 0 \\ \\ \ldots & \ldots & \ldots & \ldots & \ldots \\ -2b & -2b & \ldots & a-b & 0 \\ -2b & -2b & \ldots & -2b & a-b\end{pmatrix}_{(n-1)\times(n-1)} (R_{1} - R_{2})$$
$$\begin{pmatrix} a+b & 0 & \ldots & a-b & 2a \\ -2b & a-b & \ldots & 0 & 0 \\ \\ \ldots & \ldots & \ldots & \ldots & \ldots \\ -2b & -2b & \ldots & a-b & 0 \\ -2b & -2b & \ldots & -2b & a-b\end{pmatrix}_{(n-1)\times(n-1)} (C_{1} - C_{2})$$
$$\begin{pmatrix} a+b & 0 & \ldots & a-b & 2a \\ -(a+b) & a-b & \ldots & 0 & 0 \\ \\ \ldots & \ldots & \ldots & \ldots & \ldots \\ 0 & -2b & \ldots & a-b & 0 \\ 0 & -2b & \ldots & -2b & a-b\end{pmatrix}_{(n-1)\times(n-1)} (R_{1}+R_{2})$$
$$\begin{pmatrix} 0 & 0 & \ldots & a-b & 2a \\ -(a+b) & a-b & \ldots & 0 & 0 \\ \\ \ldots & \ldots & \ldots & \ldots & \ldots \\ 0 & -2b & \ldots & a-b & 0 \\ 0 & -2b & \ldots & -2b & a-b\end{pmatrix}_{(n-1)\times(n-1)}.$$
So we have $B_{n-1} = (a+b)\cdot B_{n-2} = (a+b)^{n-1}$. So far it looks okay, but I don't see any mistake, cause the results do not correct when I start plugging in numbers.
Let $U$ be the upper triangular matrix of ones. The matrix in question can be expressed as $$ A_n=aI_n+b(U-U^T)=UB_nU^T $$ where $$ B_n=aU^{-1}(U^{-1})^T+b\left[(U^{-1})^T-U^{-1}\right]. $$ Clearly, we have $\det A_n=\det B_n$ because $\det U=1$. It is straightforward to verify that $$ U^{-1}=\pmatrix{1&-1\\ &\ddots&\ddots\\ &&\ddots&\ddots\\ &&&\ddots&-1\\ &&&&1\\},\quad B_n=\pmatrix{2a&b-a\\ -b-a&\ddots&\ddots\\ &\ddots&\ddots&\ddots\\ &&\ddots&2a&b-a\\ &&&-b-a&a}. $$ Being a tridiagonal matrix, the determinant of $B_n$ satisfies the recurrence relation $\det B_n=2a\det B_{n-1}+(b^2-a^2)\det B_{n-2}$ with initial conditions $\det B_0=1$ and $\det B_1=a$. (If you don’t see this, try Laplace expansion along the first row of $B_n$.) By mathematical induction, it can be proved that $\det B_n=\frac12[(a+b)^n+(a-b)^n]$.