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

Jul 3, 2016

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

#### Explanation:

$\left(\begin{matrix}1 & 1 \\ 2 & 5\end{matrix}\right) \left(\begin{matrix}x \\ y\end{matrix}\right) = \left(\begin{matrix}1 \\ 4\end{matrix}\right)$

We want to reduce the coefficient matrix to echelon form. We use elementary row operations to achieve this, particularly the one that allows us to add a scalar multiple of one row to another.

We're going to add "$- 2$" times the first row to the second row, resulting in:

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

Multiplying out gives:

$x + y = 1$
$3 y = 2$

$\implies y = \frac{2}{3} , x = \frac{1}{3}$

Jul 3, 2016

It is worth the time learning this method.
$x = \frac{1}{3} \mathmr{and} y = \frac{2}{3}$

#### Explanation:

There is some beautiful maths involved in solving simultaneous equations using matrices.

It involves the concept that a 2x2 matrix multiplied by its inverse gives the unit or identity matrix which is $\left(\begin{matrix}1 & 0 \\ 0 & 1\end{matrix}\right)$

In the same way that $5 + 0 = 5$ and $5 \times 1 = 5$,

any 2x2 matrix multiplied by the unit matrix stays the same.

So if we can find the inverse of the matrix which represents the coefficients in the equations we are solving, we can multiply that inverse matrix on both sides of the equation which will give the following:

((?,?),(?,?))((1,1),(2,5))((x),(y)) = ((?,?),(?,?))((1),(4))

((1,0),(0,1))((x),(y)) =((?,?),(?,?))((1),(4))

Which gives ((x),(y)) =((?,?),(?,?))((1),(4))

Once we calculate the product on the right side,this gives the solution for x and y directly.

Let's find the inverse matrix
of $\left(\begin{matrix}a & b \\ c & d\end{matrix}\right) \Rightarrow \text{ it is } \frac{1}{a d - b c} \left(\begin{matrix}d & - b \\ - c & a\end{matrix}\right)$

of $\left(\begin{matrix}1 & 1 \\ 2 & 5\end{matrix}\right) \Rightarrow \text{it is } \frac{1}{5 - 2} \left(\begin{matrix}5 & - 1 \\ - 2 & 1\end{matrix}\right)$

$= \frac{1}{3} \left(\begin{matrix}5 & - 1 \\ - 2 & 1\end{matrix}\right) = \textcolor{red}{\left(\begin{matrix}\frac{5}{3} & - \frac{1}{3} \\ - \frac{2}{3} & \frac{1}{3}\end{matrix}\right)}$

Multiply on both sides of the equation:

$\textcolor{red}{\left(\begin{matrix}\frac{5}{3} & - \frac{1}{3} \\ - \frac{2}{3} & \frac{1}{3}\end{matrix}\right)} \left(\begin{matrix}1 & 1 \\ 2 & 5\end{matrix}\right) \left(\begin{matrix}x \\ y\end{matrix}\right) = \textcolor{red}{\left(\begin{matrix}\frac{5}{3} & - \frac{1}{3} \\ - \frac{2}{3} & \frac{1}{3}\end{matrix}\right)} \left(\begin{matrix}1 \\ 4\end{matrix}\right)$

Now multiplying as usual with matrices, leads to

$\left(\begin{matrix}1 & 0 \\ 0 & 1\end{matrix}\right) \left(\begin{matrix}x \\ y\end{matrix}\right) = \left(\begin{matrix}\frac{1}{3} \\ \frac{2}{3}\end{matrix}\right)$ or just $\left(\begin{matrix}x \\ y\end{matrix}\right) = \left(\begin{matrix}\frac{1}{3} \\ \frac{2}{3}\end{matrix}\right)$

So, $x = \frac{1}{3} \mathmr{and} y = \frac{2}{3}$

Despite the fact that this looks horrible, with a bit of perseverance and practice, it can be done quite easily. I have had students for whom this was their method of choice in solving simultaneous equations.

Jul 3, 2016

It is worth the time learning this method.
$x = \frac{1}{3} \mathmr{and} y = \frac{2}{3}$