In matrix form, the system is
![\begin{bmatrix}1&2&-1\\1&2&1\\-1&-1&2\end{bmatrix}\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix}=\begin{bmatrix}-4\\2\\6\end{bmatrix}](https://img.qammunity.org/2020/formulas/mathematics/middle-school/gp20ift4k1o6tgfv3bd7a46irtkf6ddppd.png)
Solving this "using matrices" is a bit ambiguous but brings to mind two standard methods.
Compute the inverse of the coefficient matrix using the formula
![\mathbf A^(-1)=\frac1{\det\mathbf A}\mathbf C^\top](https://img.qammunity.org/2020/formulas/mathematics/middle-school/9f2dcmqyybvui10yp71hg6gwhazpqvsmwg.png)
where
is the coefficient matrix,
is its determinant,
is the cofactor matrix, and
denotes the matrix transpose.
We compute the determinant by a Laplace expansion along the first column:
![\det\mathbf A=\begin{vmatrix}1&2&-1\\1&2&1\\-1&-1&2\end{vmatrix}](https://img.qammunity.org/2020/formulas/mathematics/middle-school/hodno4b2pctkii2ce2p606z7qzrhdjwb69.png)
![\det\mathbf A=\begin{vmatrix}2&1\\-1&2\end{vmatrix}-\begin{vmatrix}2&-1\\-1&2\end{vmatrix}-\begin{vmatrix}2&-1\\2&1\end{vmatrix}](https://img.qammunity.org/2020/formulas/mathematics/middle-school/b1ng655dm9y4rd0pf82vh6k4u02qjp8ehn.png)
![\det\mathbf A=5-3-4=-2](https://img.qammunity.org/2020/formulas/mathematics/middle-school/t09igg4d3vcc3g91b5ecq6jmn7n99f1ofy.png)
The cofactor matrix is
![\mathbf C=\begin{bmatrix}5&-3&1\\-3&1&-1\\4&-2&0\end{bmatrix}\implies\mathbf C^\top=\begin{bmatrix}5&-3&4\\-3&1&-2\\1&-1&0\end{bmatrix}](https://img.qammunity.org/2020/formulas/mathematics/middle-school/ylfkz7f1h53vvocn31e8zgkxnfmpso9z81.png)
which makes the inverse
![\mathbf A^(-1)=\begin{bmatrix}-5/2&3/2&-2\\3/2&-1/2&1\\-1/2&1/2&0\end{bmatrix}](https://img.qammunity.org/2020/formulas/mathematics/middle-school/3a8sn2ucbossy1do2ygn8iwkmrapnk0nsw.png)
Finally,
![\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix}=\mathbf A^(-1)\begin{bmatrix}-4\\2\\6\end{bmatrix}\implies\boxed{x_1=1,x_2=-1,x_3=3}](https://img.qammunity.org/2020/formulas/mathematics/middle-school/ycgx1fpo5gkoi5epi62trn00tfnyvo9bl3.png)
- Gauss-Jordan elimination:
Take the augmented matrix
![\begin{bmatrix}1&2&-1&-4\\1&2&1&2\\-1&-1&2&6\end{bmatrix}](https://img.qammunity.org/2020/formulas/mathematics/middle-school/n1ji1xqa83admfsvp5ijh2ayq70jh2p44z.png)
Subtract row 1 from row 2, and -(row 1) from row 3:
![\begin{bmatrix}1&2&-1&-4\\0&0&2&6\\0&1&1&2\end{bmatrix}](https://img.qammunity.org/2020/formulas/mathematics/middle-school/ykpi7gfevs6q0tu4eqy2ex274xw01pr1qa.png)
Multiply row 2 by 1/2:
![\begin{bmatrix}1&2&-1&-4\\0&0&1&3\\0&1&1&2\end{bmatrix}](https://img.qammunity.org/2020/formulas/mathematics/middle-school/8qoletwwrv2x7tll9dgj0uis6th5mka5s1.png)
The second row tells us that
![x_3=3](https://img.qammunity.org/2020/formulas/mathematics/middle-school/8vvfhljrg8iq90o0kgov1c97cjtlzbdwhz.png)
Then in the third row,
![x_2+x_3=2\implies x_2=-1](https://img.qammunity.org/2020/formulas/mathematics/middle-school/445yyv1nspgjj4gu5xp5kex0jb5vw4s52o.png)
Then in the first row,
![x_1+2x_2-x_3=-4\implies x_1=1](https://img.qammunity.org/2020/formulas/mathematics/middle-school/udqef0xx04semg2i1vq9uk2h1j1e914w5h.png)