# How do you solve x-y+2z = -5, -x +3z = 0, and 2x+ y = 1 using matrices?

Jan 11, 2017

The answer is $\left(\begin{matrix}x \\ y \\ z\end{matrix}\right) = \left(\begin{matrix}- \frac{12}{11} \\ \frac{35}{11} \\ - \frac{4}{11}\end{matrix}\right)$

#### Explanation:

Rewrite the equation in matrix form

$\left(\begin{matrix}1 & - 1 & 2 \\ - 1 & 0 & 3 \\ 2 & 1 & 0\end{matrix}\right) \left(\begin{matrix}x \\ y \\ z\end{matrix}\right) = \left(\begin{matrix}- 5 \\ 0 \\ 1\end{matrix}\right)$

Let $A = \left(\begin{matrix}1 & - 1 & 2 \\ - 1 & 0 & 3 \\ 2 & 1 & 0\end{matrix}\right)$

We must find the inverse of matrix $A$

Let's calculate the

$D e t A$ $= | \left(1 , - 1 , 2\right) , \left(- 1 , 0 , 3\right) , \left(2 , 1 , 0\right) |$

$= 1 \cdot | \left(0 , 3\right) , \left(1 , 0\right) | + 1 \cdot | \left(- 1 , 3\right) , \left(2 , 0\right) | + 2 \cdot | \left(- 1 , 0\right) , \left(2 , 1\right) |$

$= - 3 - 6 - 2 = - 11$

As $D e t A \ne 0$, matrix A is invertible

Now, we calculte the matrix of co-factors

$C = \left(\begin{matrix}| \left(0 3\right) & \left(1 0\right) | & - | \left(- 1 3\right) & \left(2 0\right) | & | \left(- 1 0\right) & \left(2 1\right) | \\ - | \left(- 1 2\right) & \left(1 0\right) | & | \left(1 2\right) & \left(2 0\right) | & - | \left(1 - 1\right) & \left(2 1\right) | \\ | \left(- 1 2\right) & \left(0 3\right) | & - | \left(1 2\right) & \left(- 1 3\right) | & | \left(1 - 1\right) & \left(- 1 0\right) |\end{matrix}\right)$

$= \left(\begin{matrix}- 3 & 6 & - 1 \\ 2 & - 4 & - 3 \\ - 3 & - 5 & - 1\end{matrix}\right)$

We calculate the transpose of matrix $C$

${C}^{T} = \left(\begin{matrix}- 3 & 2 & - 3 \\ 6 & - 4 & - 5 \\ - 1 & - 3 & - 1\end{matrix}\right)$

The inverse is

${A}^{-} 1 = {C}^{T} / \det A = - \frac{1}{11} \cdot \left(\begin{matrix}- 3 & 2 & - 3 \\ 6 & - 4 & - 5 \\ - 1 & - 3 & - 1\end{matrix}\right)$

$= \left(\begin{matrix}\frac{3}{11} & - \frac{2}{11} & \frac{3}{11} \\ - \frac{6}{11} & \frac{4}{11} & \frac{5}{11} \\ \frac{1}{11} & \frac{3}{11} & \frac{1}{11}\end{matrix}\right)$

Verification, by doing $A \cdot {A}^{-} 1$

$A \cdot {A}^{-} 1 = \left(\begin{matrix}1 & - 1 & 2 \\ - 1 & 0 & 3 \\ 2 & 1 & 0\end{matrix}\right) \cdot \left(\begin{matrix}\frac{3}{11} & - \frac{2}{11} & \frac{3}{11} \\ - \frac{6}{11} & \frac{4}{11} & \frac{5}{11} \\ \frac{1}{11} & \frac{3}{11} & \frac{1}{11}\end{matrix}\right)$

$= \left(\begin{matrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1\end{matrix}\right) = I$

Now, we can solve our equation

$\left(\begin{matrix}x \\ y \\ z\end{matrix}\right) = \left(\begin{matrix}\frac{3}{11} & - \frac{2}{11} & \frac{3}{11} \\ - \frac{6}{11} & \frac{4}{11} & \frac{5}{11} \\ \frac{1}{11} & \frac{3}{11} & \frac{1}{11}\end{matrix}\right) \cdot \left(\begin{matrix}- 5 \\ 0 \\ 1\end{matrix}\right)$

$= \left(\begin{matrix}- \frac{12}{11} \\ \frac{35}{11} \\ - \frac{4}{11}\end{matrix}\right)$