I have two similar questions.
- How to calculate the determinant of the following $n \times n$ matrix?
$$\begin{vmatrix} a & b & \dots & b & b\\ -b & a & \dots & b & b\\ \vdots & \vdots & \ddots & \vdots & \vdots\\ -b & -b & ... & a & b\\ -b & -b & ... & -b & a \end{vmatrix}$$
- How to calculate the determinant of the following $n \times n$ matrix?
$$\begin{vmatrix} a+b & a & \dots & a\\ a & a + b & \dots & a\\ \vdots & \vdots & \ddots & \vdots \\ a & a & \dots & a + b \end{vmatrix}$$
For the second one, I have seen this, but I don't understand the part where $$\det M_n = \det M_{n - 1} - r(n-1) N_{n - 1}$$ Why minus shouldn't it be something like $(-1)^{i+j}$?
You can use Gaussian elimination to simplify the determinants so that it becomes upper triangular. Once you do that, the determinant will simply be the product of the entries on the diagonal. This is a straightforward process which can be applied to both of your questions.
Gaussian elimination consists of three things:
Multiply any row or column by any scalar. This has the effect of multiplying the value of the determinant by that number.
Interchange any row or column of the determinant. This has the effect of multiplying the value of the determinant by -1.
Add to a row the corresponding entries of any other row all multiplied by any scalar. This second row is unchanged--this process only alters the first. (This also works for columns.) The value of the determinant is unchanged when this is done.
Using these three actions, it's possible to make the determinant in question upper triangular, which means that all entries below the diagonal are zero. Example: in your first determinant, add to each row the corresponding entries of the first row multiplied by b/a. This will make all the entries in the first column below the main diagonal zero. Just repeat the same sort of thing until it's upper triangular, multiply the entries on the main diagonal, look back over the steps you took to reach that point so that you know how the value of the determinant has changed, and adjust accordingly. This process may sound tedious, but it's much quicker than an expansion by minors approach and I think will lead you to a general equation.