Video Transcript
In this video, we’ll learn how to
solve a system of two linear equations using the inverse of the matrix of
coefficients. Recall that the linear equation in
two dimensions describes a straight line 𝑦 equals 𝑚𝑥 plus 𝑏, where 𝑚 is the
slope or gradient of the line and 𝑏 is the 𝑦-intercept. That’s where the line meets the
𝑦-axis. A system of two linear equations is
a set of two equations describing two straight lines, and a solution to the system
is the single point in the 𝑥𝑦-plane where the two lines intersect. If two lines never meet, then
there’s no solution and the lines are parallel.
Note that our equations may not
necessarily be written in the form 𝑦 is equal to 𝑚𝑥 plus 𝑏. We may have something like the
system shown. These equations both still describe
straight lines, but now we have constants multiplying the 𝑦’s. The 𝑥’s and 𝑦’s are one side, and
the constants are on the other. And the main thing is that we have
two equations describing straight lines, and we want to find a solution, that is,
where they intersect. And there are a few methods we
could use. And in this video, we’re going to
concentrate on using a matrix inverse to find a solution. So let’s see what steps we need to
follow to do this.
Suppose we have a set of two
simultaneous equations, for example, 𝑥 plus 𝑦 is equal to one and four 𝑥 plus
five 𝑦 is equal to six. And let’s call these equations one
and two. Our first step is to make sure that
the variables 𝑥 and 𝑦 are vertically aligned on the left-hand side and our
constants on the right-hand side. This is because we want to be able
to read off our coefficients for our matrix. Our next step is to rewrite the
system as a matrix equation. Since we have two equations in two
unknowns, our coefficient matrix will be a two-by-two matrix. This multiplies a column matrix of
our variables. And on the right-hand side, we have
a column matrix of the constants.
The first row of our coefficient
matrix consists of the coefficients of 𝑥 and 𝑦 in equation one, and these are both
one, and the associated constant on the right-hand side is also one. The second row of our coefficient
matrix is the coefficients of 𝑥 and 𝑦 in equation two, that’s four and five, and
the associated constant on the right-hand side is six. We now have our system represented
in matrix form, and if we were to multiply this out, we would regain our original
equations.
Our third step in solving our
equations is to find the inverse of our coefficient matrix. Recall that for an 𝑛-by-𝑛 matrix
𝐴 which is nonsingular, that means it has an inverse, 𝐴 inverse times 𝐴 is equal
to 𝐴 times 𝐴 inverse is equal to the identity matrix, where the identity matrix
has leading diagonal elements equal to one and every other element equal to
zero. And recall also that for a
two-by-two nonsingular matrix with elements 𝑎, 𝑏, 𝑐, 𝑑, then the inverse of 𝐴
is one over 𝑎𝑑 minus 𝑏𝑐 times the matrix with the elements 𝑑, negative 𝑏,
negative 𝑐, and 𝑎. That is the matrix where 𝑎 and 𝑑
have been swapped and we take the negative of 𝑏 and 𝑐.
And we note that the denominator of
our fraction is actually the determinant of the matrix 𝐴. So how does this help us? Well, notice we have the equation
𝐴𝑥 equal to 𝑏 and we multiply our equation on the left by 𝐴 inverse. We know that 𝐴 inverse times 𝐴 is
the identity matrix. So on the left-hand side we have
𝐼𝑥 and on the right-hand side 𝐴 inverse times 𝑏. The left-hand side simplifies to
𝑥. So we have 𝑥 equal to 𝐴 inverse
𝑏. And this gives us our solution
since, remember, 𝑥 is the column matrix with elements 𝑥, 𝑦. And it’s this that we’re trying to
find. So to solve our system of
equations, we basically need to find the inverse of our coefficient matrix. So let’s apply this to our
example.
We need to find the inverse of our
matrix 𝐴. And if 𝑎 is equal to one, 𝑏 is
equal to one, 𝑐 is equal to four, and 𝑑 is equal to five, we have the fraction one
over one times five minus one times four multiplying the matrix with elements five,
negative one, negative four, and one. Our denominator evaluates to one so
that the inverse of our coefficient matrix has elements five, negative one, negative
four, and one. And if we substitute this into our
equation, we have 𝑥, 𝑦 on the left-hand side. And on the right-hand side, the
inverse of our coefficient matrix, which has elements five, negative one, negative
four, and one, multiplies the column matrix one, six of constants.
Multiplying out our right-hand
side, we have five times one plus negative one times six and negative four times one
plus one times six. And this evaluates to the column
matrix with elements negative one, two so that by equality of matrices, 𝑥 is
negative one and 𝑦 is equal to two. To find the solution to a set of
two simultaneous equations then, we write our equations in matrix equation form, we
find the inverse of our coefficient matrix, we multiply both sides of the equation
on the left by the inverse, multiply out the right-hand side, and this gives us our
solution. So let’s look at another example
where we begin with two simultaneous equations and solve using matrices.
Consider the simultaneous equations
four 𝑥 minus two 𝑦 is equal to zero and three 𝑦 plus five 𝑥 is negative 11. Express the given simultaneous
equations as a matrix equation. Write down the inverse of the
coefficient matrix. And multiply through by the inverse
on the left-hand side to solve the matrix equation.
There are three parts to this
question involving the set of simultaneous equations four 𝑥 minus two 𝑦 is equal
to zero and three 𝑦 plus five 𝑥 is negative 11. And these three parts lead us to
the solution of the equations via matrix methods. The first part is to express the
simultaneous equations as a matrix equation. We must then write down the inverse
of the coefficient matrix and use this by multiplying through on the left to solve
the matrix equation. So let’s begin with the first part,
which is to write the equations as a matrix equation.
The first thing we need to do is to
make sure that our 𝑥’s and 𝑦’s are vertically aligned on the left-hand side. In our second equation then, we’ll
need to swap the three 𝑦 and the five 𝑥. And now our 𝑥’s and 𝑦’s are
vertically aligned. Let’s call our equations equations
one and two so that equation one is four 𝑥 minus two 𝑦 is equal to zero and
equation two is five 𝑥 plus three 𝑦 is negative 11. And this helps to read off our
coefficients so we can put these into a two-by-two matrix, which then multiplies a
column matrix of our variables 𝑥 and 𝑦. And we put this equal to the
constants on the right-hand side.
The first row of our coefficient
matrix contains the coefficients of 𝑥 and 𝑦 in equation one. That is four and negative two. Our associated constant on the
right-hand side is zero. The second row of our coefficient
matrix contains the constant coefficients of 𝑥 and 𝑦 in equation two. That is five and three. And our constant element on the
right-hand side is negative 11. So now we have our equations in
matrix equation form as required.
The second part of the question
asks us to write down the inverse of the coefficient matrix. And to do this, we recall that for
a nonsingular two-by-two matrix with elements 𝑎, 𝑏, 𝑐, 𝑑, the inverse of 𝐴 is
one over 𝑎𝑑 minus 𝑏𝑐 times the matrix with elements 𝑑, negative 𝑏, negative
𝑐, and 𝑎. Recall that 𝑎𝑑 minus 𝑏𝑐 is the
determinant of 𝐴. And notice that we’ve swapped the
elements 𝑎 and 𝑑 and taken the negative of 𝑏 and 𝑐. In our case, our coefficient matrix
has elements four, negative two, five, and three. So its inverse, if 𝑎 is four, 𝑏
is negative two, 𝑐 is five, and 𝑑 is three, is one over four times three minus
negative two times five, that is one over 𝑎𝑑 minus 𝑏𝑐, times the matrix with
elements three, two, negative five, and four. The inverse of our coefficient
matrix is therefore one over 22 times the matrix with elements three, two, negative
five, and four.
Our final part is to multiply
through by the inverse on the left-hand side to solve the matrix equation. If we call our coefficient matrix
𝐴, we have 𝐴 inverse times 𝐴 times the column matrix 𝑥 is equal to 𝐴 inverse
times the column matrix 𝑏, where 𝑥 is the matrix of variables and 𝑏 is the matrix
of constants on the right-hand side. Remember, though, that for any
nonsingular matrix 𝐴, that is, a matrix with an inverse, 𝐴 inverse times 𝐴 is
equal to the identity matrix, which for a two-by-two matrix is the matrix with
elements one, zero, zero, one. So that in our left-hand side, we
have the identity matrix times 𝑥, 𝑦 and on our right, we have 𝐴 inverse times the
column matrix 𝑏.
Our left-hand side simplifies to
the column matrix 𝑥, 𝑦. And if we multiplied the right-hand
side, we have one over 22 times the matrix with elements three times zero plus two
times negative 11, negative five times zero plus four times negative 11. That is one over 22 times the
column matrix with elements negative 22, negative 44. Making some space and evaluating
this gives us the column matrix with elements negative one and negative two. By equality of matrices, this then
gives us 𝑥 is equal to negative one and 𝑦 is equal to negative two.
So for the simultaneous equations
four 𝑥 minus two 𝑦 is equal to zero and three 𝑦 plus five 𝑥 is equal to negative
11, we have the matrix equation where the coefficient matrix has elements four,
negative two, five, three multiplying the column matrix of variables equal to the
column matrix with elements zero, negative 11 of constants on the right-hand
side. Our matrix of coefficients has an
inverse, which is one over 22 times the matrix with elements three, two, negative
five, and four. And we use this to find our
solution: 𝑥 is negative one and 𝑦 is negative two.
Now let’s use our method to solve a
set of simultaneous equations already expressed as a matrix equation.
Given that the two-by-two matrix
with elements five, eight, one, negative eight multiplied by the column matrix with
elements 𝑥 and 𝑦 is equal to the column matrix with elements negative 43 and one,
determine the values of 𝑥 and 𝑦.
We’re asked to find the values of
𝑥 and 𝑦 given a matrix equation. Our matrix equation consists of a
coefficient matrix with elements five, eight, one, and negative eight multiplying a
column matrix of our variables 𝑥 and 𝑦. And this is equal to a column
matrix with elements negative 43 and one. So, in fact, we have a matrix
equation of the form 𝐴𝑥 is equal to 𝑏. And in order to solve for 𝑥 and
𝑦, we can use the fact that for any square nonsingular matrix 𝐴 with inverse 𝐴
inverse, 𝐴 inverse times 𝐴 is equal to 𝐴 times 𝐴 inverse, which is equal to the
identity matrix. And that’s the matrix where the
elements in the leading diagonal all equal one and the rest are equal to zero. And so, if there is a two-by-two
matrix with elements 𝑎, 𝑏, 𝑐, 𝑑, the identity is the matrix with elements one,
zero, zero, one.
Now we can use this in our matrix
equation. Multiplying both sides on the left
with 𝐴 inverse, on our left-hand side we’d have 𝐴 inverse times 𝐴 times 𝑥, which
is actually the identity times 𝑥. And this simplifies to 𝑥 so that
we have 𝑥 equal to 𝐴 inverse times our column matrix 𝑏. And this gives us our solution for
𝑥 and 𝑦. We can apply this to our problem by
first finding the inverse of our two-by-two matrix of coefficients. Recall that an inverse of a
two-by-two matrix with elements 𝑎, 𝑏, 𝑐, 𝑑 is equal to one over 𝑎𝑑 minus 𝑏𝑐
times the matrix with elements 𝑑, negative 𝑏, negative 𝑐, and 𝑎.
Let’s just make some room here and
note that our matrix of coefficients has elements five, eight, one, negative
eight. And if we label these 𝑎, 𝑏, 𝑐,
𝑑, its inverse is given by one over the determinant, which is five times negative
eight minus eight times one times the matrix with elements negative eight, negative
eight, negative one, and five. That is negative one over 48 times
the matrix with elements negative eight, negative eight, negative one, and five. Now if we multiply the left-hand
side of each side of our equation with this inverse, we have our inverse matrix
times the coefficient matrix times the column matrix of variables is equal to the
inverse of the coefficient matrix times the column of constants.
We know that the inverse of the
coefficient matrix times the coefficient matrix itself is equal to the identity. So on our left-hand side, this
simplifies to the column matrix with elements 𝑥, 𝑦. And all we need to do now is to
multiply out our right-hand side. This gives us negative one over 48
times the matrix with negative eight times negative 43 plus negative eight times one
and negative one times negative 43 plus five times one. That is negative one over 48 times
the column matrix with elements 336 and 48. This evaluates to elements negative
seven and negative one. And by equality of matrices, this
gives us 𝑥 is negative seven, 𝑦 is negative one.
And so given the matrix equation
where the coefficient matrix has elements five, eight, one, and negative eight and
the constant column matrix has elements negative 43 and one, the value of 𝑥 is
negative seven and the value of 𝑦 is negative one.
Now let’s look at another example
where we start from a system of two equations.
Use matrices to solve the system
negative 𝑥 plus five 𝑦 is equal to eight and negative three 𝑥 plus 𝑦 is equal to
eight.
We’re given a system of two
simultaneous equations which we want to solve for 𝑥 and 𝑦. That means to find values of 𝑥 and
𝑦 that satisfy both equations. And we’re asked to use matrices to
do this. Our equations are negative 𝑥 plus
five 𝑦 is equal to eight and negative three 𝑥 plus 𝑦 is equal to eight. And we’re going to need to express
our system of equations as a matrix equation. Since we have two equations in two
unknowns, our coefficient matrix will be a two-by-two matrix. This will multiply a column matrix
of variables. And on the right-hand side, we’ll
have a column matrix of constants.
The first thing we need to do to
read off the coefficients is to check that the 𝑥’s and 𝑦’s are vertically
aligned. And this is actually the case, so
we’re good to go. The first row of our coefficient
matrix is populated by the coefficients of 𝑥 and 𝑦 in equation one. That is negative one and five. And the elements in the second row
are the coefficients of 𝑥 and 𝑦 in equation two. That’s negative three and one. The associated constants on the
right-hand side are both eight. So, using vector notation, we have
an equation of the form 𝐴 times 𝑥 is equal to 𝑏. And we can use the fact that if 𝐴
is an 𝑛-by-𝑛 nonsingular matrix, then 𝐴 inverse times 𝐴 is 𝐴 times 𝐴 inverse
is equal to the identity matrix. That’s the matrix with leading
elements one and all the rest zero.
How this helps us is if you find
the inverse of our matrix 𝐴 and multiply this on the left, we have 𝐴 inverse 𝐴
times 𝑥 is equal to 𝐴 inverse times 𝑏. And we know that 𝐴 inverse times
𝐴 is the identity matrix. So we’re left with 𝑥 is equal to
𝐴 inverse times 𝑏. And this will give us our
solution. So let’s find the inverse of our
coefficient matrix and recall that for a two-by-two matrix with elements 𝑎, 𝑏, 𝑐,
𝑑, the inverse of 𝐴 is one over 𝑎𝑑 minus 𝑏𝑐 times the matrix with elements 𝑑,
negative 𝑏, negative 𝑐, and 𝑎. And that’s where 𝑎𝑑 minus 𝑏𝑐 is
nonzero.
In our case, our matrix has
elements negative one, five, negative three, one. So its inverse will be one over
negative one times one minus five times negative three times the matrix with
elements one, negative five, three, negative one. Our denominator evaluates to
14. And so the inverse of our
coefficient matrix is one over 14 times the matrix with elements one, negative five,
three, negative one. Now, if we multiply both sides of
our equation on the left with this inverse, we know that on the left-hand side, our
inverse times our matrix of coefficients 𝐴 is equal to the identity. And if we multiply this out, it
simplifies to the column matrix with elements 𝑥, 𝑦.
And so now we simply have to
multiply out our right-hand side. And this gives us one over 14 times
the matrix with elements one times eight plus negative five times eight and three
times eight plus negative one times eight. And this evaluates to one over 14
times the column matrix with elements negative 32, 16, which is the column matrix
with elements negative 16 over seven and eight over seven. And by equality of matrices, this
gives us 𝑥 is negative 16 over seven and 𝑦 is eight over seven. The solution to the system negative
𝑥 plus five 𝑦 is equal to eight and negative three 𝑥 plus 𝑦 is equal to eight is
therefore 𝑥 is equal to negative 16 over seven and 𝑦 is equal to eight over
seven.
In this video, we’ve seen how to
solve a system of two linear equations using the inverse of the matrix of
coefficients. So let’s finish by noting some of
the key points for this method.
Given the system of two linear
equations 𝑎𝑥 plus 𝑏𝑦 is equal to 𝑒 and 𝑐𝑥 plus 𝑑𝑦 is equal to 𝑓, where 𝑎,
𝑏, 𝑐, 𝑑, 𝑒, and 𝑓 are constants, we first ensure that the variable terms are
vertically aligned. We then form a matrix equation with
the matrix of coefficients 𝐴 multiplying a column matrix of variables 𝑥 equal to a
column matrix of constants 𝑏. We then find the inverse of our
coefficient matrix, multiply both sides of the matrix equation on the left by 𝐴
inverse so that we have 𝑥 is equal to 𝐴 inverse times 𝑏 on the right-hand side
since 𝐴 inverse 𝐴 is the identity matrix. We then multiply out the right-hand
side of our equation for our solution 𝑥, 𝑦. And remember, this solution 𝑥, 𝑦
is where the two lines one and two intersect.