<s>[INST] how to solve this linear system of three equations using Cramer's rule? I have a 3-by-3 matrix,
A=$\left [ \begin{matrix}   
    1 & 2 & 3 \\
    1 & 0 & 1 \\
    1 & 1 & -1\\
   \end{matrix} \right]$
the known terms are (-6, 2, -5), at the right of "=" symbol.
(1) I've calculated the determinant,
(2) I've used Cramer's rule to find x, y, and z.
but the result isn't correct (the right solutions is (x, y,z) = (1, -5, 1)).
(1) determinant of A,
I used row operations: row 3 <-> row 2. I swapped the rows. (therefore the determinant is $-\det A$).
(2) row 2 <-- $row 2 - row 1$ and I got:
A=$\left [ \begin{matrix}   
    1 & 2 & 3 \\
    0 & -1 & -4 \\
    1 & 1 & -1\\
   \end{matrix} \right]$
then, I used Laplace in the first column, and I got:
$-\det A$=$\left [ \begin{matrix}   
    -1 & -4 \\
    0 & 1  \\
   \end{matrix} \right]$ + $\left [ \begin{matrix}   
    2 & 3 \\
    -1 & -4  \\
   \end{matrix} \right]$,
doing algebra here, I get: -1-(-8+3) = -6 but it was -detA, and therefore detA = 6.
I used Cramer's rule, therefore I put the known terms in first column, then in second, and so on.
x = A=$\left [ \begin{matrix}   
     -6 & 2 & 3 \\
     2 & 0 & 1 \\
     -5 & 1 & -1\\
   \end{matrix} \right] $ (this matrix divided by the determinant of the original matrix)
x is equal to 3, it should've been equal to 1.
y = A=$\left [ \begin{matrix}   
      1 & -6 & 3 \\
      0 & 2 &  1 \\
      1 & -5 & -1\\
   \end{matrix} \right] $ (this matrix divided by the determinant of the original matrix)
-2-6-6-5 = -14-5 = -19 it should have been equal to -5. (Sarrus' rule)
z = A=$\left [ \begin{matrix}   
      1 & 2 & -6 \\
      0 & 0 &  2 \\
      1 & 1 & -5\\
   \end{matrix} \right] $ (this matrix divided by the determinant of the original matrix)
4-2 = 2. it should've been equal to 1. (Sarrus' Rule).
 [/INST] The determinant of$$A_x=\begin{bmatrix}-6&2&3\\2&0&1\\-5&1&-1\end{bmatrix}$$is $6$, which is equal to $\det(A)$. Therefore, $\frac{\det(A_x)}{\det(A)}=1$, which is what you should have got.
</s>