Determinant of a square matrix in a field \begin{array}{rrrrr|r}
    b & a & a & \cdot \cdot \cdot & a \\
    a & b & a & \cdot \cdot \cdot & a \\
    a & a & b & \cdot \cdot \cdot & a \\
    \cdot & \cdot & \cdot & \space & \cdot\\
\cdot & \cdot & \cdot & \space & \cdot\\
a & a & a & \cdot \cdot  \cdot & b
  \end{array}
I have the above matrix $A\in M_{n\times n}(F)$ where $F$ is a field and $n\geq1$, $a,b\in F$.
I'm trying to find out how to use row operations to make it into an upper triangular matrix in order to figure out the determinant. But I'm not sure how I would approach it.
 A: To find the determinant, rather than transforming the matrix to an upper triangular form, you could express the matrix (of size $n\times n$) as
$$M=(b-a)I_{n\times n}+a\mathbf{1}\cdot\mathbf{1}^T$$
where $I_{n\times n}$ is the identity matrix, and $\mathbf{1}$ is an $n\times 1$ vector all of whose elements are $1$ (note that matrix $a\mathbf{1}\cdot\mathbf{1}^T$ will have rank $1$).
Thus (using the Matrix determinant lemma) one of the eigenvalues of matrix $M$ will be $(b-a)+na$, and the rest (i.e. $n-1$) of the eigenvalues will be $b-a$. Thus the determinant will be $(b-a)^{n-1}(b+(n-1)a)$. 
A: This is a variant of https://math.stackexchange.com/a/1238109/62967
Consider the $n\times n$ matrix $A_a$, with all coefficients equal to $a$. Then $na$ is the only nonzero eigenvalue (if $a\ne0$) because the rank is $1$. So the characteristic polynomial of $A_a$ is
$$
\det(A_a-XI_n)=(0-X)^{n-1}(na-X)=(-1)^{n-1}X^{n-1}(na-X)
$$
Your matrix can be written as $A_a-(a-b)I_n$, so its determinant is the value of the characteristic polynomial for $X=a-b$:
$$
(-1)^{n-1}(a-b)^{n-1}(na-a+b)=(b-a)^{n-1}((n-1)a+b)
$$
