Matrix 1
Consider the determinant polynomials
$$
\begin{align}
p_n(x)
&=
\det\begin{bmatrix}
1&x&x&\cdots&x\\
-x&1&x&\cdots&x\\
-x&-x&1&\cdots&x\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
-x&-x&-x&\cdots&1
\end{bmatrix}\tag{1a}\\[6pt]
&=
\det\begin{bmatrix}
1-x&0&0&\cdots&1+x\\
-x&1&x&\cdots&x\\
-x&-x&1&\cdots&x\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
-x&-x&-x&\cdots&1
\end{bmatrix}\tag{1b}\\[6pt]
&=
\det\begin{bmatrix}
\color{#C00}{2}&0&0&\cdots&\color{#090}{1+x}\\
0&1&x&\cdots&x\\
0&-x&1&\cdots&x\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
\color{#090}{1-x}&-x&-x&\cdots&1
\end{bmatrix}\tag{1c}\\[30pt]
&=\color{#C00}{2p_{n-1}(x)}+\color{#090}{\left(x^2-1\right)p_{n-2}(x)}\tag{1d}
\end{align}
$$
Explanation:
$\text{(1a)}$: definition
$\text{(1b)}$: add column $n$ to column $1$
$\text{(1c)}$: add row $n$ to row $1$
$\text{(1d)}$: expand the determinant on column $1$:
$\phantom{\text{(1d):}}\quad$ the $(1,1)$ term is $2$ and the $(1,1)$ minor is $p_{n-1}(x)$
$\phantom{\text{(1d):}}$ the $(n,1)$ term is $1-x$; expand the $(n,1)$ minor on row $1$:
$\phantom{\text{(1d):}}\quad$ the $(1,n-1)$ term is $1+x$ and the $(1,n-1)$ minor is $p_{n-2}(x)$
Start with $p_0(x)=p_1(x)=1$ and compute the first several polynomials:
$$
\begin{align}
p_0(x)&=1\\
p_1(x)&=1\\
p_2(x)&=1+x^2\\
p_3(x)&=1+3x^2\\
p_4(x)&=1+6x^2+x^4\\
p_5(x)&=1+10x^2+5x^4\\
p_6(x)&=1+15x^2+15x^4+x^6
\end{align}\tag2
$$
From the binomial coefficients in $(2)$, we can start to see a pattern:
$$
p_n(x)=\frac{(1+x)^n+(1-x)^n}2\tag3
$$
Equation $(3)$ can be verified using $\text{(1d)}$ and induction. Setting $x=\frac ab$ and multiplying the whole matrix by $b$ gives
$$
\det\begin{bmatrix}
b&a&a&\cdots&a\\
-a&b&a&\cdots&a\\
-a&-a&b&\cdots&a\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
-a&-a&-a&\cdots&b
\end{bmatrix}
=\frac{(b+a)^n+(b-a)^n}2\tag4
$$
Matrix 2
Note that any vector orthogonal to $\begin{bmatrix}1&1&1&\cdots&1\end{bmatrix}$ is multiplied by $b$ (on any subspace orthogonal to a given vector, that vector can be subtracted from each column of the matrix without changing the action on that subspace). $\begin{bmatrix}1&1&1&\cdots&1\end{bmatrix}$ is multiplied by $an+b$. Thus,
$$
\det\begin{bmatrix}
a+b&a&a&\cdots&a\\
a&a+b&a&\cdots&a\\
a&a&a+b&\cdots&a\\
\vdots&\vdots&\vdots&\ddots&\vdots\\
a&a&a&\cdots&a+b
\end{bmatrix}
=b^{n-1}(an+b)\tag5
$$