# Representing Systems of Linear Equations using Matrices

A system of linear equations can be represented in matrix form using a coefficient matrix, a variable matrix, and a constant matrix.

Consider the system,

$\begin{array}{l}\hfill 2x+3y=8\\ \hfill 5x-y=-2\end{array}$ .

The coefficient matrix can be formed by aligning the coefficients of the variables of each equation in a row. Make sure that each equation is written in standard form with the constant term on right.

Then, the coefficient matrix for the above system is

$\left[\begin{array}{cc}\hfill 2& \hfill 3\\ \hfill 5& \hfill -1\end{array}\right]$ .

The variables we have are $x$ and $y$ . So we can write the variable matrix as $\left[\begin{array}{c}\hfill x\\ \hfill y\end{array}\right]$ .

On the right side of the equality we have the constant terms of the equations, $8$ and $-2$ . The two numbers in that order correspond to the first and second equations, and therefore take the places at the first and the second rows in the constant matrix. So, the matrix becomes $\left[\begin{array}{c}\hfill 8\\ \hfill -2\end{array}\right]$ .

Now, the system can be represented as $\left[\begin{array}{cc}\hfill 2& \hfill 3\\ \hfill 5& \hfill -1\end{array}\right]\left[\begin{array}{c}\hfill x\\ \hfill y\end{array}\right]=\left[\begin{array}{c}\hfill 8\\ \hfill -2\end{array}\right]$ .

Using matrix multiplication you can see that the matrix representation is equivalent to the system of equations.

$\begin{array}{l}\hfill \left[\begin{array}{cc}\hfill 2& \hfill 3\\ \hfill 5& \hfill -1\end{array}\right]\left[\begin{array}{c}\hfill x\\ \hfill y\end{array}\right]=\left[\begin{array}{c}\hfill 2\left(x\right)+3\left(y\right)\\ \hfill 5\left(x\right)+(-1)y\end{array}\right]\\ \hfill \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}=\left[\begin{array}{c}\hfill 2x+3y\\ \hfill 5x-y\end{array}\right]\end{array}$

That is, $\left[\begin{array}{c}\hfill 2x+3y\\ \hfill 5x-y\end{array}\right]=\left[\begin{array}{c}\hfill 8\\ \hfill -2\end{array}\right]$ .

Equating the corresponding entries of the two matrices we get:

$\begin{array}{l}\hfill 2x+3y=8\\ \hfill 5x-y=-2\end{array}$

Now let us understand what this representation means.

If you consider this as a function of the vector $\left[\begin{array}{c}\hfill x\\ \hfill y\end{array}\right]$ , it can be defined as

$f\left(\left[\begin{array}{c}\hfill x\\ \hfill y\end{array}\right]\right)=\left[\begin{array}{cc}\hfill 2& \hfill 3\\ \hfill 5& \hfill -1\end{array}\right]\left[\begin{array}{c}\hfill x\\ \hfill y\end{array}\right]$

Then, by solving the system what we are finding a vector $\left[\begin{array}{c}\hfill x\\ \hfill y\end{array}\right]$ for which $f\left(\left[\begin{array}{c}\hfill x\\ \hfill y\end{array}\right]\right)=\left[\begin{array}{c}\hfill 8\\ \hfill -2\end{array}\right]$ .

This representation can make calculations easier because, if we can find the inverse of the coefficient matrix, the input vector $\left[\begin{array}{c}\hfill x\\ \hfill y\end{array}\right]$ can be calculated by multiplying both sides by the inverse matrix.

In a similar way, for a system of three equations in three variables,

$\begin{array}{l}\hfill {a}_{1}x+{b}_{1}y+{c}_{1}z={d}_{1}\\ \hfill {a}_{2}x+{b}_{2}y+{c}_{2}z={d}_{2}\\ \hfill {a}_{3}x+{b}_{3}y+{c}_{3}z={d}_{3}\end{array}$

The matrix representation would be

$\left[\begin{array}{ccc}\hfill {a}_{1}& \hfill {b}_{1}& \hfill {c}_{1}\\ \hfill {a}_{2}& \hfill {b}_{2}& \hfill {c}_{2}\\ \hfill {a}_{3}& \hfill {b}_{3}& \hfill {c}_{3}\end{array}\right]\left[\begin{array}{c}\hfill x\\ \hfill y\\ \hfill z\end{array}\right]=\left[\begin{array}{c}\hfill {d}_{1}\\ \hfill {d}_{2}\\ \hfill {d}_{3}\end{array}\right]$ .

We can generalize the result to $n$ variables.