### Video Transcript

In this video, weβll learn how to
express a system of linear equations as a matrix equation. Weβll first remind ourselves of
some of the terminology weβll need, for example, what it means for an equation or
system of equations to be linear. And then weβll see how we can
express such systems in the form of a matrix equation with some examples.

So what do we mean when we say an
equation is linear? The equation π¦ is equal to ππ₯
plus π is a linear equation and describes a straight line. The slope of the line is the
constant π, thatβs the gradient, and the π¦-intercept is the constant π. Thatβs where the line crosses the
π¦-axis. So the equation π¦ is equal to ππ₯
plus π describes a straight line.

But what makes the equation itself
linear? Well, itβs that the order of the
equation, that is the highest exponent of the variable π₯, is one. There are no π₯ squared, π₯ cubed,
or higher exponents of π₯. And so a linear equation is an
equation where the highest exponent of the variable or variables is equal to
one. In two dimensions, this describes a
straight line. If we extend this idea to higher
dimensions, letβs say three dimensions, weβd have something of the form ππ₯ plus
ππ¦ plus ππ§ is equal to π, where π, π, π, and π are constants. This is a linear equation
representing a plane in three dimensions.

And again, what makes this equation
linear is that each of the variables has order one. That is, its highest power in
equation is one. There are also no terms where the
variables multiply by one another, so there are no terms including π₯ times π¦ or π§
times π₯ or π¦ times π§. We might say then that a linear
equation describes a flat line or surface. And a system of linear equations is
a set of π equations with π variables, constant coefficients π ππ where π goes
from one to π and π goes from one to π and a set of constants π π. And our goal here is to write this
system of equations in terms of matrices.

A system of linear equations may or
may not have one or more solutions. So, for example, if our variables
were π₯, π¦, and π§ and we have a system of three equations in these three
variables, the solution to these three equations is π₯ is equal to one, π¦ is equal
to negative one, and π§ is equal to one. And what that means is that these
three values satisfy all three equations. So if we substitute π₯ is equal to
one in each of these equations, π¦ is equal to negative one in each of these
equations, and π§ is equal to one, equation one will evaluate to negative one,
equation two will evaluate to five, and equation three will evaluate to six. And this means that the three
planes described by equations one, two, and three will intersect at this point, one,
negative one, one.

If we have a system of linear
equations, we basically want to find out if there are any solutions, how many β if
there are β and how can we find them. And since we can use matrix methods
to answer these questions, a useful tool in our armory is being able to express
systems of linear equations as matrix equations and vice versa. In the examples that follow, weβre
going to familiarize ourselves with these processes. Letβs look first at an example of a
set of two simultaneous equations in two variables.

Express the simultaneous equations
three π₯ plus two π¦ is equal to 12 and three π₯ plus π¦ is equal to seven as a
matrix equation.

So weβre given a set of two
simultaneous equations in two variables and asked to express this set of equations
in matrix form. And what this requires us to do is
to separate out the coefficients of our variables into one matrix and the variables
themselves into another and the constants on the right-hand side into a third. And because we have two equations
in two variables π₯ and π¦, our coefficient matrix will be a two-by-two matrix, that
is, with two rows and two columns. Our variables matrix will be a
two-by-one column matrix, and our constants again, a two-by-one column matrix.

Itβs important to note that we must
be able to reform our original equations by performing matrix multiplication on the
left-hand side. And remember that multiplying a
matrix with π rows and π columns by a matrix with π rows and π columns will give
us a matrix with π rows and π columns. And for matrix multiplication to
work, the number of columns π in our first matrix must be the number of rows in the
second matrix.

So now we want to find the matrix
equation in this form which, if we multiply it out, reproduces our original system
of equations. So letβs look more closely at our
equations. Itβs important to make sure before
we start putting entries into our matrix that the variables are aligned in our
system of equations so that the π₯βs are above one another and so are the π¦βs. The reason for this is that when we
populate our matrix, weβre going to read off the coefficients of the π₯βs and
π¦βs.

Our coefficients in the first
equation, equation one, are three and two with the constant 12 on the right-hand
side and the three and two from the first row in our coefficient matrix and the 12,
the first element in our matrix on the right-hand side. Similarly, the elements in the
second row of our coefficient matrix are the coefficients in the second equation,
equation two, that is, three and one. And the second element on our
matrix of constant on the right-hand side is seven. This matrix equation is the full
matrix representation of the set of simultaneous equations three π₯ plus two π¦ is
equal to 12 and three π₯ plus π¦ is equal to seven.

If we were to apply matrix
multiplication to the left-hand side of our matrix equation, we would have three π₯
plus two π¦ is equal to 12, which is our first equation one, and three π₯ plus π¦ is
equal to seven, which is our second equation. And weβre back to our original set
of simultaneous linear equations.

Now letβs look at the slightly less
straightforward example.

Express the simultaneous equations
three π₯ minus 24 is negative eight π¦ and π₯ is equal to three minus π¦ as a matrix
equation.

Weβre given a set of simultaneous
linear equations three π₯ minus 24 is negative eight π¦ and π₯ is equal to three
minus π¦, which weβre asked to express as a matrix equation. Since we have two equations in two
variables π₯ and π¦, this means our result should be a matrix equation of the form
shown, that is, a two-by-two matrix of coefficients, a two-by-one matrix of the
variables, and a two-by-one matrix of the constants, remembering that an π-by-π
matrix has π rows and π columns. So in our case, we should have a
two-by-two matrix multiplying a two-by-one matrix equal to a two-by-one matrix.

Remember that for matrix
multiplication to work, we need an π-by-π matrix multiplying an π-by-π matrix to
equal and an π-by-π matrix. The number of columns of the first
matrix and the number of rows of the second must be equal. And our resulting matrix will have
the number of rows of the first and the number of columns of the second. And this works in our case since
our π is equal to two, π is two, and π is one. And so our result will be a
two-by-one column matrix.

Before we can populate our
matrices, however, we need to make sure that our simultaneous equations have a form
where we can easily read the coefficients. What that means is we want our π₯βs
to be aligned and our π¦βs to be aligned and our constants on the right-hand
side. As we can see in our equations, for
example, in equation one we have three π₯ minus 24 is negative eight π¦. So weβll need to move our π¦-term
to the left-hand side and our constant term to the right-hand side. And if we add eight π¦ plus 24 to
both sides, our equation one then becomes three π₯ plus eight π¦ is equal to 24.

Similarly, for our second equation
two, we need to move the π¦-term to the left-hand side. Adding π¦ to both sides gives us π₯
plus π¦ is equal to three. And so, as we can see, both our
π₯-terms and our π¦-terms on the left-hand side and our constants on the right-hand
side are vertically aligned. So now making some room, we can
start to populate our matrix equation.

The coefficients of π₯ and π¦,
thatβs three and eight, form the first row of our two-by-two coefficient matrix. And the constant 24 on the
right-hand side is the first element in our right-hand side column matrix. The coefficients of π₯ and π¦ in
the second equation, which are both one, form the second row of our coefficient
matrix. And the constant three on the
right-hand side of equation two is the second element in our right-hand side column
matrix. So we can see that by aligning our
variables π₯ and π¦, we can simply read off the coefficients and populate our matrix
with these.

And this matrix equation is the
full matrix representation of the set of simultaneous equations three π₯ plus eight
π¦ is 24 and π₯ plus π¦ is three, or equivalently three π₯ minus 24 is negative
eight π¦ and π₯ is equal to three minus π¦. If we were to apply matrix
multiplication to the left-hand side of our matrix equation, we have three π₯ plus
eight π¦ is 24, which is our first equation recovered, and π₯ plus π¦ is equal to
three, which is our second equation.

We can generalize what weβve done
in our two-by-two examples with the following theorem. A system of π linear equations in
the variables π₯ one to π₯ π with coefficients π ππ and constants π π, where
π takes values from one to π and π takes values from one to π, can be written
equivalently as the matrix equation shown, where the coefficient matrix has order π
by π, the matrix of variables has order π by one, and the matrix of constants on
the right-hand side has order π by one. Itβs important when converting our
system of π equations in π variables that the orders in our matrix equation follow
this pattern. Letβs see now how this works for a
set of three equations with three unknowns. And then weβll try the process in
reverse.

Express the following set of
simultaneous equations as a matrix equation. Seven π₯ minus three π¦ plus six π§
is equal to five. Five π₯ minus two π¦ plus two π§ is
equal to 11. Two π₯ minus three π¦ plus eight π§
is equal to 10.

Because weβre given a set of three
equations with three variables π₯, π¦, and π§, to express this in matrix form, we
will have a three-by-three matrix of coefficients. Our matrix equation will have the
form shown, where the matrix on the left-hand side is the coefficient matrix. This multiplies a column matrix of
our variables. And on the right-hand side, we have
a column matrix of the constants. And if we use matrix multiplication
on the left-hand side, we regain our original set of equations.

The first thing we can do is to
check that within our system of equations, the variables are vertically aligned. This then allows us to easily read
off our coefficients. In our case, the variables π₯, π¦,
and π§ are indeed vertically aligned in the three equations, as are the constants on
the right-hand side. So weβre good to go.

In our first equation, equation
one, the coefficients of π₯, π¦, and π§ β that is, seven, negative three, and six β
form the first row of our coefficient matrix. And the associated five on the
right-hand side is the first element in our column of constants. Similarly, the coefficients of π₯,
π¦, and π§ in the second equation, equation two β thatβs five, negative two, and two
β form the second row of our matrix of coefficients. And the constant on the right-hand
side 11 is the second element in our column matrix on the right-hand side. And finally, the coefficients of
π₯, π¦, and π§ in our third equation, equation three β that is two, negative three,
and eight β form the third row of our coefficient matrix. And final constant on the
right-hand side 10 is the third element in our column matrix on the right-hand
side.

This is a full matrix
representation of the system of linear equations seven π₯ minus three π¦ plus six π§ is
equal to five, five π₯ minus two π¦ plus two π§ is equal to 11, and two π₯ minus
three π¦ plus eight π§ is equal to 10. Note the orders of our matrices
where we have a three-by-three times a three-by-one equal to a three-by-one
matrix. Itβs important that the orders are
correct since recall we can perform matrix multiplication if we have an π-by-π
multiplying an π-by-π equal to an π-by-π matrix. The number of columns of the first
matrix must be equal to the number of rows of the second. And the order of the resulting
matrix is the number of rows of the first matrix times the number of columns of the
second.

In our case, π is three, π is
three, and π is one. And if we perform matrix
multiplication on our left-hand side, we obtain our original set of equations.

So far, weβve seen how to express
sets of linear equations in matrix equation form. The matrix of most interest to us
is the coefficient matrix, as from this, we can determine amongst other things
whether or not and if so how many solutions there are to our system. In our next examples, weβre going
to work backwards from the matrix equation form and convert this into our system of
linear equations.

Write down the set of simultaneous
equations that could be solved using the given matrix equation, that is, the
three-by-three matrix with elements one, negative two, negative four, one, zero,
one, three, four, negative eight multiplied by the column matrix π, π, π is equal
to the column matrix 11, six, 10.

Weβre given a matrix equation with
a three-by-three coefficient matrix and a three-by-one column matrix of variables on
the left-hand side and a three-by-one column matrix of constants on the right-hand
side. The fact that our coefficient
matrix has three rows means that weβll have three equations in our system of
equations. And since the coefficient matrix
also has three columns, this confirms that our system has three variables, which we
can see in our column matrix of variables with variables π, π, and π.

In fact, the elements in each row
of our coefficient matrix are the coefficients in one of our equations of the
variables π, π, and π. And all we need to do to form the
first equation is to carry out the first row times column operation in matrix
multiplication, that is, one times π plus negative π times two plus negative four
times π. And this will equal our constant 11
in the first row of the matrix on the right-hand side. And so our first equation is π
minus two π minus four π is equal to 11.

So for our second equation, letβs
do the same thing with the second row of the coefficient matrix. In this case, we have one times π
plus zero times π plus one times π is equal to six. That is, π plus π is equal to
six. And finally, with the third row of
our coefficient matrix, we have three times π plus four times π plus negative
eight times π is equal to 10 on the right-hand side. That is, three π plus four π
minus eight π is equal to 10.

And with these three equations,
then, we can write down the set of simultaneous equations that could be solved using
the given matrix. And these are π minus two π minus
four π is equal to 11, π plus π is equal to six, and three π plus four π minus
eight π is equal to 10. We can check that we do have the
correct system of equations by comparing the coefficients of the variables in each
equation with the relevant row in the original matrix. So for example, in the first
equation, the coefficients of π, π, and π are one, negative two, and negative
four, respectively, which correspond to the elements in the first row of our
coefficient matrix and with the constant 11 on the right-hand side. And we can do the same thing for
the second two equations.

Weβll complete our video on systems
of linear equations by noting some key points. When given a system of linear
equations, we should write these with the variables aligned in columns. The coefficients π ππ of the
variables in each equation then form a row of the coefficient matrix. The matrix equation is then of the
form given, where the coefficients form an π-by-π matrix which multiplies an
π-by-one matrix of variables and is equal to an π-by-one matrix of constants.

Information such as the number of
solutions to the system can be found from the coefficient matrix independently. And if we perform matrix
multiplication on the left-hand side of our matrix equation, we regain our original
system of linear equations.