# How do you solve p-3q=-1 and 5p+16q=5 using matrices?

Mar 27, 2016

$p = - \frac{1}{31}$

$q = \frac{10}{31}$

#### Explanation:

When written in matrix form, the system of linear equations looks like this.

$\left(\begin{matrix}1 & - 3 \\ 5 & 16\end{matrix}\right) \left(\begin{matrix}p \\ q\end{matrix}\right) = \left(\begin{matrix}- 1 \\ 5\end{matrix}\right)$

We multiply the inverse on both sides.

${\left(\begin{matrix}1 & - 3 \\ 5 & 16\end{matrix}\right)}^{- 1} \left(\begin{matrix}1 & - 3 \\ 5 & 16\end{matrix}\right) \left(\begin{matrix}p \\ q\end{matrix}\right) = {\left(\begin{matrix}1 & - 3 \\ 5 & 16\end{matrix}\right)}^{- 1} \left(\begin{matrix}- 1 \\ 5\end{matrix}\right)$

$\left(\begin{matrix}1 & 0 \\ 0 & 1\end{matrix}\right) \left(\begin{matrix}p \\ q\end{matrix}\right) = {\left(\begin{matrix}1 & - 3 \\ 5 & 16\end{matrix}\right)}^{- 1} \left(\begin{matrix}- 1 \\ 5\end{matrix}\right)$

$\left(\begin{matrix}p \\ q\end{matrix}\right) = {\left(\begin{matrix}1 & - 3 \\ 5 & 16\end{matrix}\right)}^{- 1} \left(\begin{matrix}- 1 \\ 5\end{matrix}\right)$

The inverse of a $2 \times 2$ matrix $A = \left(\begin{matrix}a & b \\ c & d\end{matrix}\right)$ is given by

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

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

In this question, $A = \left(\begin{matrix}1 & - 3 \\ 5 & 16\end{matrix}\right)$,

• $a = 1$
• $b = - 3$
• $c = 5$
• $d = 16$

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

$= \frac{1}{31} \left(\begin{matrix}16 & 3 \\ - 5 & 1\end{matrix}\right)$

So,

$\left(\begin{matrix}p \\ q\end{matrix}\right) = {\left(\begin{matrix}1 & - 3 \\ 5 & 16\end{matrix}\right)}^{- 1} \left(\begin{matrix}- 1 \\ 5\end{matrix}\right)$

$= \frac{1}{31} \left(\begin{matrix}16 & 3 \\ - 5 & 1\end{matrix}\right) \left(\begin{matrix}- 1 \\ 5\end{matrix}\right)$

$= \frac{1}{31} \left(\begin{matrix}- 1 \\ 10\end{matrix}\right)$

$= \left(\begin{matrix}- \frac{1}{31} \\ \frac{10}{31}\end{matrix}\right)$

This means $p = - \frac{1}{31}$ and $q = \frac{10}{31}$.

You can check your answer by substituting the values of $p$ and $q$ into the original equations.

$\left(- \frac{1}{31}\right) - 3 \left(\frac{10}{31}\right) = - 1$

$5 \left(- \frac{1}{31}\right) + 16 \left(\frac{10}{31}\right) = 5$