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

Aug 24, 2016

$x = 1 \mathmr{and} y = 2$

#### Explanation:

We can express this by splitting the equations up into a coefficient matrix with a vector for the variables and a vector for the solutions.

$A \vec{u} = \vec{v}$

where $A$ is the coefficient matrix. Assuming $A$ is invertible we can left multiply both sides of the equation by the inverse of $A$, denoted ${A}^{- 1}$ to obtain

$I \vec{u} = {A}^{- 1} \vec{v}$

where I is the n x n identity matrix.

For a $2 \times 2$ matrix

$A = \left(\begin{matrix}a & b \\ c & d\end{matrix}\right)$

The inverse of $A$ is given by:

${A}^{- 1} = \frac{1}{a d - b c} \left(\begin{matrix}d & - b \\ - c & a\end{matrix}\right)$

In the context of this problem we have

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

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

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

Just to check that this is correct:

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

$= - \frac{1}{2} \left(\begin{matrix}- 2 & 0 \\ 0 & - 2\end{matrix}\right) = \left(\begin{matrix}1 & 0 \\ 0 & 1\end{matrix}\right)$ as required

so we have:

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

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

$\therefore x = 1 \mathmr{and} y = 2$