<s>[INST] Finding x in matrix algebra The question asked me to calculate $|A|$ for the given matrix below and state whether or not it is invertible.
$$
        \left(
        \begin{matrix}
        1 & 0 & 2 & 1\\
        0 & x & x & x\\
        x & x & 3x & 1\\
        0 & x & x & 0\\
        \end{matrix}
        \right)
$$
I got my answer to be $-2x^3 + 2x^3 = 0$, indicating that the matrix is not invertible because the determinant is a zero, regardless of the value of $x$.
However, I'm not certain whether I'm right after doing all the calculations. Could you help me verify?
 [/INST] Recall that performing row replacement operations does not affect the determinant. Hence, if we replace row $3$ with (row $3$ + $(-x) \cdot $ row $1$), then replace row $3$ with (row $3$ - row$2$) and replace row $4$ with (row $4$ - row $2$), we obtain:
$$
        \begin{vmatrix}
        1 & 0 & 2 & 1\\
        0 & x & x & x\\
        x & x & 3x & 1\\
        0 & x & x & 0\\
        \end{vmatrix}
=
        \begin{vmatrix}
        1 & 0 & 2 & 1\\
        0 & x & x & x\\
        0 & x & x & 1-x\\
        0 & x & x & 0\\
        \end{vmatrix}
=
        \begin{vmatrix}
        1 & 0 & 2 & 1\\
        0 & x & x & x\\
        0 & 0 & 0 & 1-2x\\
        0 & 0 & 0 & -x\\
        \end{vmatrix}
$$
but since this last matrix is upper triangular, its determinant is the product of the diagonal entries. But one of the diagonal entries is a zero, so $\det A = 0$, as you computed.
</s>