Video Transcript
In this video, weβll learn how to
solve a system of three linear equations using the inverse of the matrix of
coefficients. Now, actually, by this stage, you
probably have a number of methods that you might use to help you solve systems of
linear equations. One of those is the elimination
method, which involves adding or subtracting equations with the aim of eliminating a
variable and then solving that leftover equation for the variable that remains. That can, however, be quite
long-winded when it comes to working with more than two variables.
And so we have an alternative. This alternative involves writing
the system of equations in matrix form. And we end up then with the
equation π΄π± equals π, where for a system of three equations π΄ is a
three-by-three matrix. And then π± can be our column
matrices or column vectors. We then multiply both sides of this
equation by the inverse of π΄, remembering of course the order in which we do this
matters. Then, recalling that the product of
a matrix and its inverse is the identity matrix, we then find that πΌπ± is equal to
the inverse of π΄ times π. In other words, π± is equal to the
inverse of π΄ times π.
Now, here π± is the column matrix
that contains the variables weβre looking to find the values of. So what we need to do is figure out
how we set up these equations so that this process works. Letβs take a system of three linear
equations. Now, we could generalize this, but
actually weβre only interested in three linear equations in this video. The unknowns here or the variables
are π₯, π¦, and π§. Then, the coefficients are π with
our subscripts. π΄ is then the coefficient
matrix. And itβs made up of the elements π
sub one one, π sub one two, π sub one three, all the way through to π sub three
three. The vector π± is then π₯, π¦,
π§. It contains our variables. And then the vector π is π sub
one, π sub two, and π sub three. Itβs these values.
Now, the reason that we can use
these matrices and vectors is that when we then go back and multiply the matrix π΄
with the vector π±, weβre essentially finding the dot product of the elements in the
first row of our matrix and then the first column or the only column of vector π±,
which gives us this first linear equation. Then, we go back and we multiply
the second row of matrix π΄ with the column vector π±. And we get our second linear
equation. Finally, we repeat that with our
third row, multiplying each element by the vector π±. And we get our third linear
equation. So now that we know how to write
the system of equations in matrix form, letβs just practice that process.
Consider the system of
equations. Express the system as a single
matrix equation.
Remember, a matrix equation can be
used to help us solve systems of linear equations. It will be of the form π΄π± equals
π, where π΄ is called the coefficient matrix, π± is a column vector containing the
variables of our equation, and π contains all of the constants in the equation. So letβs identify first the
coefficient matrix. Thatβs the matrix that weβre going
to call π΄. We have three equations with three
variables. And so matrix π΄ is going to be a
three-by-three matrix. The elements in the first row of
matrix π΄ are the coefficients of π, π, and π, respectively in our first
equation.
We see that the coefficients are
two, two, and four. And so that is the first row of our
matrix. The elements in the second row of
matrix π΄ are the coefficients of π, π, and π in our second equation. Those are negative one, negative
one, and negative one. And so those are the elements in
the second row of our matrix. Weβre going to repeat this process
for the third row of our matrix, looking for the coefficients of π, π, and π in
our third equation. We now see that those are two,
five, and six. And so weβve identified our
coefficient matrix. Itβs two, two, four; negative one,
negative one, negative one; and two, five, six.
Weβre then going to look at the
vector π±. Itβs a variable vector. And so we need to list the
variables in our equation. Those are π, π, and π. And it is in fact really important
that we write them in that order. We need it to be the case that when
we multiply the matrix π΄ by the column vector π±, we end up with the original
expressions two π plus two π plus four π, negative π negative π negative π,
and so on. If we were to mix these variables
around, weβre not going to end up with the exact same equation.
Finally, weβre interested in the
constant vector π that contains all of the constants from our equations. Once again, we need to give them in
the correct order. And so we find vector π is four,
14, 10. We write this as a single matrix
equation by putting it back into the form π΄π± equals π. And when we do, we see that the
matrix equation we need is two, two, four; negative one, negative one, negative one;
two, five, six times the vector π, π, π equals the vector four, 14, 10.
So now that weβve seen how to
actually express the system as a matrix equation, letβs look at how we can use the
inverse matrix to solve a system of three equations.
Solve the given matrix equation
using the inverse of a matrix.
Remember, given a matrix equation
π΄π± equals π, where π± and π are column vectors, we can solve by multiplying both
sides by the inverse of π΄. Now, of course, order does matter
when multiplying, so we write this as shown. But since the inverse of π΄ times
π΄ is just the identity matrix, we find that this becomes π± equals the inverse of
π΄ times π. And so letβs define the matrix π΄
to be this square matrix in our question. The column vector π± is the
variable vector, and π is a constant vector. And this means we can solve this
equation by finding the inverse of our matrix π΄. So how do we find the inverse of a
three-by-three matrix?
One method we have is to augment
matrix π΄ with the identity matrix. When we do, it looks a little
something like this. And our job is to perform
elementary row operations until matrix π΄ becomes the identity matrix. Note of course that this isnβt the
only method we can choose to find the inverse of a matrix. Itβs very much personal preference
and as long as we get the same value for the inverse, no matter which method we
choose, then it really doesnβt matter.
So we define each of our rows as
shown. And remember, weβre allowed to add
or subtract the rows or multiply them by scalars. We can even swap rows. And this is usually a little bit
like solving a puzzle. There isnβt necessarily just one
route we can take. The first thing that weβre going to
do is add the values in the row π two to all of the values in the row π one. And so the values in π two and π
three are actually going to remain unchanged for now. One plus one is two, negative one
plus one is zero, and negative one plus negative one is negative two. Of course, we need to do the same
on the right-hand side. One plus zero is one, zero plus one
is one, and zero plus zero is zero.
Next, weβre going to subtract each
of the elements in row two from the elements in row three. This will have the effect of making
this element and this element equal to zero. And it will make this element equal
to one, which is really useful. That is the identity matrixβs final
row.
Now, of course, in this occasion,
π one and π two remain unchanged. One minus one is zero, one minus
one is zero, and zero minus negative one is one. Then, on the right-hand side, we
get zero, negative one, and one. Now, we might notice that if we
double each of the elements in row three and add them to the elements in row one,
weβre going to get rid of two of the elements. This element will remain zero, and
this will become zero. Two add two lots of zero is two,
zero add two lots of zero is zero, and negative two add two lots of one is zero. We repeat the process on the
right-hand side. We get one here, negative one here,
and two here.
Now, this looks really good so
far. We notice that our bottom row
already looks like the identity matrix. And we might notice that if we
halve all of the elements in the top row, that will look like the identity matrix
too. So letβs do that step now. When we perform this step, we get
one, zero, zero as the first row on the left-hand side. And then we halve each of the
elements on the right-hand side. We get a half, negative a half, and
then a half of two is just one. So the first row and last row look
great.
Letβs deal with the middle row. We might spot that if we subtract
row one from row two, this element will become zero. But also if we add row three to row
two, this element will also become zero. That gives us the middle row we
require on the left-hand side. Letβs repeat the process on the
right-hand side. The first element on this row will
be zero minus a half plus zero, which is negative one-half. Then we get one minus negative a
half plus negative one, which is a half. And finally, we have zero minus one
plus one, which is zero.
And now we have the identity matrix
on the left-hand side. So the matrix we have on the
right-hand side is the inverse of π΄. And weβre now ready to solve the
equation. Letβs clear some space. We know that the variable vector π±
will be equal to the inverse of π΄ times the constant vector π. So thatβs as shown. We can now say that π₯ will be
equal to the dot product of the elements in the first row in our matrix inverse π΄
and the elements in the column vector π. So π₯ will be a half times nine
plus negative a half times negative 11 plus one times six, which is equal to 4.5
plus 5.5 plus six, or 16.
We can then do the same for π¦. Itβs the dot product of the
elements on the second row and our column vector π. So itβs negative a half times nine
plus a half times negative 11 plus zero times six. Thatβs negative 4.5 minus 5.5,
which of course is negative 10. We now do this one more time to
find the value of π§. Itβs the dot product of these
elements in this row with these elements in this vector. Thatβs zero times nine plus
negative one times negative 11 plus one times six, which is 11 plus six, or 17. And so weβve solved our
equation. We found π₯ is equal to 16, π¦ is
equal to negative 10, and π§ is equal to 17.
In our final example, weβre going
to look at combining these two examples to help us use matrices to solve a system of
equations.
Use matrices to solve the following
system of equations.
Remember, if we can write our
system of equations in the form π΄π± equals π, where π΄ is the coefficient matrix,
π± is the column vector that contains all of the variables, and π is the constant
vector, then we can multiply both sides of this equation by the inverse of π΄. And when we do, we find that the
variable vector π± is equal to the inverse of π΄ times π.
And so to solve our system of
equations, we need to set it up in this form and then find the inverse of our
coefficient matrix. We have three equations with three
variables. And so vector π΄ is going to be
three by three. Weβre going to list the
coefficients of our variables in order from our first equation. Itβs negative one, eight, and
negative three. These are simply the coefficients
shown.
In our second equation, theyβre
four, negative three, and eight. And in our third equation, thereβre
six, negative 12, and 19. Then the vector π± contains all of
our variables. Itβs π₯, π¦, π§. And of course our constant vector
contains our constants negative 10, 12, and 18. So our first job is to find the
inverse of the matrix π΄.
There are of course a number of
ways to do this. One is to augment it with the
identity matrix and perform elementary row operations. We might even choose to use a
calculator. But letβs recall how we can use the
minors, cofactors, and adjugate method. We begin by finding the matrix of
minors. We ignore the values on the row and
column weβre looking at and calculate the determinant of the remaining values. So for the first element on the
first row, weβre going to do negative three times 19 minus eight times negative 12,
which is 39. We then ignore all elements on the
first row and second column. And we work out four times 19 minus
eight times six, which is 28. Finally, we ignore elements on the
first row and third column. And we work out four times negative
12 minus negative three times six. And we get negative 30.
Continuing the process, and the
matrix of minors is as shown. We then find the matrix of
cofactors using that sort of checkerboard pattern. This involves changing the sign of
the second element in the first row, the first and third elements in our second row,
and the second element in our third row. Next, we find the adjugate. The elements on a diagonal stay the
same, and then we simply swap the positions of all of the rest. We go directly across that
diagonal. So we swap negative 116 and
negative 28, 55 and negative 30, and negative four and 36.
Then our final step is to multiply
this by one over the determinant of π΄. We can use the values of the matrix
of minors to do so. Weβre going to multiply each of the
elements in the top row of our original matrix by the cofactor for the same
location. So we multiply negative one by
39. We then subtract the product of
eight and 28. And then we add the product of
negative three and negative 30. And so the determinant of π΄ is
negative 173. And so we find the inverse of π΄ is
negative one over 173 times that adjugate.
Letβs clear some space, and weβre
now able to solve our system of equations. π± is therefore equal to the
inverse of π΄ times π, which is as shown. Now, we could multiply each of the
elements inside the inverse of π΄ by negative one over 173. Or we can do that right at the
end. Letβs begin by finding the dot
product of the elements in the first row of our inverse and the vector π. When we do, we get negative one
over 173 times 39 times negative 10 minus 116 times 12 plus 55 times 18, which is
negative 792. So π₯ is negative one over 173
times negative 792, which is the same as 792 over 173.
We then do the same for π¦, this
time finding the dot product of the elements on this row with our vector, giving us
negative one over 173 times 196, which is negative 196 over 173. Letβs do this for π§ by finding the
dot product of the elements on the third row of the inverse and the column vector
π. And this time, we get negative one
over 173 times 210 or negative 210 over 173.
And so weβve found the values of
π₯, π¦, and π§. Letβs put them back into vector
form. It is in fact easier to do so by
taking out that constant factor of one over 173. And so weβve solved our system of
equations. In vector form, we can say that π₯,
π¦, π§ is equal to one over 173 times the vector 792, negative 196, negative
210.
Weβre now going to recap the key
points from this lesson. In this lesson, we learned that we
can represent a system of three equations as a matrix equation. If π΄ is the coefficient matrix, π±
is the variable vector, and π is the constant vector, then our equation is of the
form π΄π± equals π. And by multiplying both sides of
this equation by the inverse of π΄, we find that π± is equal to the inverse of π΄
times π.
For a system of three linear
equations of the form π sub one one π₯ plus π sub one two π¦ plus π sub one three
π§ equals π one and so on, the coefficient matrix is π sub one one, π sub one
two, π sub one three; π sub two one, π sub two two, π sub two three; π sub
three one, π sub three two, π sub three three. The variable vector is π₯, π¦,
π§. And the constant vector is π one,
π two, π three.