# How do you solve  x+2y=9 and x+y=1 using matrices?

Feb 27, 2016

One method is to use Cramer's Rule (with determinants)

#### Explanation:

The given equations can be written as a matrix:
$\textcolor{w h i t e}{\text{XXXX")xcolor(white)("X")ycolor(white)("X}} = c$
$\textcolor{w h i t e}{\text{XXX}} \left(\begin{matrix}\textcolor{red}{1} & \textcolor{b l u e}{2} & \null & \textcolor{g r e e n}{9} \\ \textcolor{red}{1} & \textcolor{b l u e}{1} & \null & \textcolor{g r e e n}{1}\end{matrix}\right)$

If $D$ is the determinant formed by the $x$ and $y$ columns of this matrix:
$\textcolor{w h i t e}{\text{XXX}} D = | \left(\textcolor{red}{1} , \textcolor{b l u e}{2}\right) , \left(\textcolor{red}{1} , \textcolor{b l u e}{1}\right) | = \textcolor{red}{1} \times \textcolor{b l u e}{1} - \textcolor{red}{1} \times \textcolor{b l u e}{2} = - 1$

and ${D}_{x}$ is the determinant of the same submatrix but with the $x$ column replaced with the $c$ column
$\textcolor{w h i t e}{\text{XXX}} {D}_{x} = | \left(\textcolor{g r e e n}{9} , \textcolor{b l u e}{2}\right) , \left(\textcolor{g r e e n}{1} , \textcolor{b l u e}{1}\right) | = \textcolor{g r e e n}{9} \times \textcolor{b l u e}{1} - \textcolor{g r e e n}{1} \times \textcolor{b l u e}{2} = 7$

and ${D}_{y}$ is the determinant fo the same submatrix as $D$ but with the $y$ column replaced with the $c$ column
$\textcolor{w h i t e}{\text{XXX}} {D}_{y} = | \left(\textcolor{red}{1} , \textcolor{g r e e n}{9}\right) , \left(\textcolor{red}{1} , \textcolor{g r e e n}{1}\right) | = \textcolor{red}{1} \times \textcolor{g r e e n}{1} - \textcolor{red}{1} \times \textcolor{g r e e n}{9} = - 8$

Cramer's Rule tells us
$\textcolor{w h i t e}{\text{XXX}} x = \frac{{D}_{x}}{D} = \frac{7}{- 1} = - 7$
and
$\textcolor{w h i t e}{\text{XXX}} y = \frac{{D}_{y}}{D} = \frac{- 8}{- 1} = 8$