Further Maths/Lessons/Matrices/Solving Systems with Matrices
Core Pure · Matrices · Year 1

Solving Systems with Matrices

A system of linear equations is just one matrix equation in disguise — and once you have the inverse, solving it is a single multiplication.

11 min read 2 worked examples

Writing a system as a matrix equation

Definition 3.1 — matrix form of a linear system

A system of linear equations can be written $A\mathbf{x}=\mathbf{b}$, where $A$ is the matrix of coefficients, $\mathbf{x}$ is the column vector of unknowns, and $\mathbf{b}$ is the column vector of constants. If $A$ is non-singular, multiplying both sides on the left by $A^{-1}$ gives $\mathbf{x}=A^{-1}\mathbf{b}$.

Exam technique

Multiplication order matters: you must pre-multiply both sides by $A^{-1}$ (multiply on the left), since $A^{-1}A\mathbf{x}=I\mathbf{x}=\mathbf{x}$ only works that way round.

Example 1 · A 2×2 system
Solve the system $2x+y=5$, $x-y=1$ using matrices.

Write as $A\mathbf{x}=\mathbf{b}$: $\begin{pmatrix}2&1\\1&-1\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix}=\begin{pmatrix}5\\1\end{pmatrix}$.

$\det(A)=2(-1)-1(1)=-3$, so $A^{-1}=\dfrac{1}{-3}\begin{pmatrix}-1&-1\\-1&2\end{pmatrix}$.

$$\begin{pmatrix}x\\y\end{pmatrix}=\frac{1}{-3}\begin{pmatrix}-1&-1\\-1&2\end{pmatrix}\begin{pmatrix}5\\1\end{pmatrix}=\frac{1}{-3}\begin{pmatrix}-6\\-3\end{pmatrix}=\begin{pmatrix}2\\1\end{pmatrix}$$

So $x=2$, $y=1$.

Example 2 · A 3×3 system
Solve $2x+y=3$, $x+y+z=4$, $y+3z=7$ using $M^{-1}$, where $M=\begin{pmatrix}2&1&0\\1&1&1\\0&1&3\end{pmatrix}$ has inverse $M^{-1}=\begin{pmatrix}2&-3&1\\-3&6&-2\\1&-2&1\end{pmatrix}$ (found in the previous lesson).
$$\begin{pmatrix}x\\y\\z\end{pmatrix}=\begin{pmatrix}2&-3&1\\-3&6&-2\\1&-2&1\end{pmatrix}\begin{pmatrix}3\\4\\7\end{pmatrix}=\begin{pmatrix}2(3)-3(4)+1(7)\\-3(3)+6(4)-2(7)\\1(3)-2(4)+1(7)\end{pmatrix}=\begin{pmatrix}1\\1\\2\end{pmatrix}$$

So $x=1$, $y=1$, $z=2$. Checking in the original equations: $2(1)+1=3$ ✓, $1+1+2=4$ ✓, $1+3(2)=7$ ✓.

Common mistake

If $\det(A)=0$, the matrix method fails — the system either has no solutions or infinitely many, and a different technique (elimination, checking for consistency) is needed instead.

Exam-style questions

Question 1 6 marks

Solve the system $3x+2y=16$, $x-y=2$ using matrices.

$A=\begin{pmatrix}3&2\\1&-1\end{pmatrix}$, $\det(A)=3(-1)-2(1)=-5$ (M1, A1)

$A^{-1}=\dfrac{1}{-5}\begin{pmatrix}-1&-2\\-1&3\end{pmatrix}$ (M1)

$\begin{pmatrix}x\\y\end{pmatrix}=\dfrac{1}{-5}\begin{pmatrix}-1&-2\\-1&3\end{pmatrix}\begin{pmatrix}16\\2\end{pmatrix}=\dfrac{1}{-5}\begin{pmatrix}-20\\-10\end{pmatrix}=\begin{pmatrix}4\\2\end{pmatrix}$ (M1, A1)

$x=4$, $y=2$ (A1)

Question 2 4 marks

Using $M^{-1}=\begin{pmatrix}2&-3&1\\-3&6&-2\\1&-2&1\end{pmatrix}$ from Example 2, solve $M\mathbf{x}=\begin{pmatrix}5\\6\\10\end{pmatrix}$.

$\begin{pmatrix}x\\y\\z\end{pmatrix}=\begin{pmatrix}2(5)-3(6)+1(10)\\-3(5)+6(6)-2(10)\\1(5)-2(6)+1(10)\end{pmatrix}=\begin{pmatrix}2\\1\\3\end{pmatrix}$ (M1, A1, A1)

$x=2$, $y=1$, $z=3$ (A1)