Determine all real $x$ that satisfy $\det A=0$ I want to find all real $x$ that satisfy 
$$
  \textrm{det } X=
  \begin{vmatrix}
  x &2 &2 &2\\
  2 &x &2 &2\\
  2 &2 &x &2\\
  2 &2 &2 &x
  \end{vmatrix}\\
$$
My teacher does this by adding the three bottom rows to the top row
$$
\textrm{det } X=
  \begin{vmatrix}
  x+6 &x+6 &x+6 &x+6\\
  2 &x &2 &2\\
  2 &2 &x &2\\
  2 &2 &2 &x
  \end{vmatrix}\\
$$
and then subtracting a row of $2$'s from the bottom three rows
$$
\textrm{det } X=
  (x+6)  
  \begin{vmatrix}
  1 &1 &1 &1\\
  0 &x-2 &0 &0\\
  0 &0 &x-2 &0\\
  0 &0 &0 &x-2
  \end{vmatrix}.
$$
The answer is 
$$
x\in \{-6,2\}.
$$
I think I understand the operations (although subtracting an arbitrary row of numbers from a matrix/determinant row is something I've never seen before, but I don't see why that wouldn't be allowed. Just like you can subtract arbitrary coefficients on both sides of an equation, right?), my main issue is why they are performed. 


*

*Why can't I just in the same way subtract a row of $2$'s from the three bottom rows in the first determinant? If I do that I get a different answer. 

*I know I want a column of all zeroes except one column-element, but why do I need to perform the first operation beforehand? Is it somehow necessary that all the top row elements to be the same, $(x+6)$?

 A: I think you should give a look at gaussian elimination. 
You can only do certain manipulation the the matrix without changing it's determinant (or at least only changing it's sing or by some scalar). This manipulations are as follows: 


*

*Swap two rows multiplies the determinant by $-1$

*Multiplying a row by a non zero scalar $\lambda$, multiplies the determinant as well by the same scalar

*Adding or subtracting multiples of one row to another leaves the determinant untouched 


The algorithm for gaussian elimination goes something like this


*

*If the first row has first element zero than change it with some other row that has fist element not zero, if there aren't go to step 3

*Fore every row $A_i$, not counting the first, $(i
\gt 1)$ multiplay the first row by some coefficient so that the sum of the first row and the row $A_i$ has fist element zero. Substitute the $i$-th row with the sum just calculated 

*Now every element of the fist column, except many for the first one, are zero. Now go to the sub-matrix obtained by eliminating the first row and column and repeat this steps on every submatrix.
At the end of this you should have a triangular or diagonal matrix

A: Another way: the determinant is a fourth-degree polynomial $p(x)$ in variable $x$.
It is easy to see that $p(2) = p(-6) = 0$, like you did.
Then take the derivative:
\begin{align}
p'(x) &= \begin{vmatrix}
  1 &2 &2 &2\\
  0 &x &2 &2\\
  0 &2 &x &2\\
  0 &2 &2 &x
  \end{vmatrix} + \begin{vmatrix}
  x &0 &2 &2\\
  2 &1 &2 &2\\
  2 &0 &x &2\\
  2 &0 &2 &x
  \end{vmatrix} + \begin{vmatrix}
  x &2 &0 &2\\
  2 &x &0 &2\\
  2 &2 &1 &2\\
  2 &2 &0 &x
  \end{vmatrix} + \begin{vmatrix}
  x &2 &2 &0\\
  2 &x &2 &0\\
  2 &2 &x &0\\
  2 &2 &2 &1
  \end{vmatrix} \\
&=4  \begin{vmatrix}
  x &2 &2\\
  2 &x &2\\
  2 &2 &x\\
  \end{vmatrix} \\
\end{align}
Taking derivatives again we get $p''(x) = 4\cdot 3 \begin{vmatrix}
  x &2 \\
  2 &x \\
  \end{vmatrix}$ so we can conclude that $p'(2) = p''(2) = 0$.
Therefore $2$ is a root of $p$ with muliplicity $3$ so $$p(x) = (x-2)^3(x+6)$$
Therefore the zeros are indeed only $-6$ and $2$.
A: "Subtracting a row of 2s" is NOT a valid matrix operation.  But subtracting one row from another is.  Perhaps what your teacher did (or meant to do) is, first subtract the third row from the second to get 
$\left|\begin{array}{ccc} x & 2 & 2 & 2 \\ 0 & x- 2 & 2- x & 0 \\ 2 & 2 & x & 2 \\ 2 & 2 & 2 & x \end{array}\right|$.
Now, subtract the fourth row from the third to get 
$\left|\begin{array}{ccc} x & 2 & 2 & 2 \\ 0 & x- 2 & 2- x & 0 \\ 0 & 0 & x- 2 & 2-x \\ 2 & 2 & 2 & x \end{array}\right|$.
Finally, you can subtract the first row from the fourth to get 
$\left|\begin{array}{ccc} x & 2 & 2 & 2 \\ 0 & x- 2 & 2- x & 0 \\ 0 & 0 & x- 2 & 2-x \\ 2- x & 0 & 0 & x- 2 \end{array}\right|$.
That's almost an "upper triangular" matrix.  We can calculate the determinant reasonably easily by "expanding on the first column:
$x\left|\begin{array}{cc} x- 2 & 2- x & 0 \\ 0 & x- 2 & 2- x \\ 0 & 0 & x- 2 \end{array}\right|$$- 2\left|\begin{array}{cc} 2 & 2 & 2 \\ x- 2 & 2- x & 0 \\ 0 & x- 2 & 2- x \end{array}\right|$.
That first determinant is $x(x- 2)^3$.  For the second we can further expand that three by three determinant on the first column to get $-2\left(2\left|\begin{array}{cc}2- x & 0 \\ x- 2 & 2- x\end{array}\right|- (x- 2)\left|\begin{array}{cc}2 & 2 \\ x- 2 & 2- x\end{array}\right|\right)= -4(2- x)^2- (x- 2)(4- 2x- 2x+ 4)= -4(2- x)^2- (x- 2)(8- 4x)= -4(2- x)^2+ 4(2- x)^2= 0$.
So the determinant of the given matrix is $x(x- 2)^3$.
