# How do you solve the system 3x-y+z=5, x+3y+3z=-6, and x+4y-2z=12?

Apr 27, 2017

$x = 3$, $y = \frac{1}{2}$, $z = - \frac{7}{2}$

#### Explanation:

Given:

$\text{(i)} : \textcolor{w h i t e}{\frac{1}{1}} 3 x - y + z = 5$
$\text{(ii)} : \textcolor{w h i t e}{\frac{1}{1}} x + 3 y + 3 z = - 6$
$\text{(iii)} : \textcolor{w h i t e}{\frac{1}{1}} x + 4 y - 2 z = 12$

Note that we can eliminate $z$ by adding or subtracting suitable multiples of $\text{(i)}$ to or from $\text{(ii)}$ and $\text{(iii)}$:

$\text{(iv)" = "(ii)" - 3"(i)} : \textcolor{w h i t e}{\frac{1}{1}} - 8 x + 6 y = - 21$
$\text{(v)" = "(iii)" + 2"(i)} : \textcolor{w h i t e}{\frac{1}{1}} 7 x + 2 y = 22$

Then we can eliminate $y$ by subtracting $3$ times $\text{(v)}$ from $\text{(iv)}$:

$\text{(vi)" = "(iv)"-3"(v)} : \textcolor{w h i t e}{\frac{1}{1}} - 29 x = - 87$

Dividing both sides of $\text{(vi)}$ by $- 29$, we find:

$x = 3$

Substituting this value of $x$ in $\text{(v)}$, we find:

$7 \left(\textcolor{b l u e}{3}\right) + 2 y = 22$

Hence:

$y = \frac{1}{2}$

Then from $\text{(i)}$ we find:

$z = 5 - 3 x + y = 5 - 3 \left(\textcolor{b l u e}{3}\right) + \textcolor{b l u e}{\frac{1}{2}} = - \frac{7}{2}$

$\textcolor{w h i t e}{}$
Matrix formulation

We can represent the original equations as an augmented matrix:

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

The operations we performed above correspond to various row operations:

Subtract $3 \times \text{row1}$ from $\text{row2}$ and add $2 \times \text{row1}$ to $\text{row3}$ to get:

$\left(\begin{matrix}3 & - 1 & 1 & | & 5 \\ - 8 & 6 & 0 & | & - 21 \\ 7 & 2 & 0 & | & 22\end{matrix}\right)$

Subtract $3 \times \text{row3}$ from $\text{row2}$ to get:

$\left(\begin{matrix}3 & - 1 & 1 & | & 5 \\ - 29 & 0 & 0 & | & - 87 \\ 7 & 2 & 0 & | & 22\end{matrix}\right)$

Divide $\text{row2}$ by $- 29$ to get:

$\left(\begin{matrix}3 & - 1 & 1 & | & 5 \\ 1 & 0 & 0 & | & 3 \\ 7 & 2 & 0 & | & 22\end{matrix}\right)$

Subtract $7 \times \text{row2}$ from $\text{row3}$ to get:

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

Divide $\text{row3}$ by $2$ to get:

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

Add $\text{row3}$ to $\text{row1}$ and subtract $3 \times \text{row2}$ to get:

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

Permute the rows, moving $\text{row1}$ to the third row to get:

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

Now the left hand $3 \times 3$ submatrix is an identity matrix, we can read off $x$, $y$ and $z$ from the right hand column.