I was doing a problem and found that if I could get the determinant of this matrix, it would make solution easier. Eventually, I gave up and solved it another way. I am still curious as to how I would go about calculating the determinant of this $n \times n$ matrix:
$$A=\begin{bmatrix} a & 0 & \ldots & 0 & -a\\ 0 & a & \ldots & 0 & -a\\ \vdots & \vdots & \ddots & \vdots & \vdots\\ 0 &0 & \ldots & a & -a \\-a & -a & \ldots & -a & b\end{bmatrix}$$
\begin{eqnarray*} A=\begin{bmatrix} a & 0 & \ldots & 0 & -a\\ 0 & a & \ldots & 0 & -a\\ \vdots & \vdots & \ddots & \vdots & \vdots\\ 0 &0 & \ldots & a & -a \\ -a & -a & \ldots & -a & b \end{bmatrix} \end{eqnarray*} Add each column to the last column \begin{eqnarray*} A=\begin{bmatrix} a & 0 & \ldots & 0 & 0\\ 0 & a & \ldots & 0 & 0\\ \vdots & \vdots & \ddots & \vdots & \vdots\\ 0 &0 & \ldots & a & 0 \\ -a & -a & \ldots & -a & b-(n-1)a \end{bmatrix} \end{eqnarray*} So the determinant is $a^{n-1}(b-(n-1)a)$.