Lesson Video: Introduction to The System of Linear Equations | Nagwa Lesson Video: Introduction to The System of Linear Equations | Nagwa

Lesson Video: Introduction to The System of Linear Equations Mathematics

In this video, we will learn how to express a system of linear equations as a matrix equation.

16:19

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.

Download the Nagwa Classes App

Attend sessions, chat with your teacher and class, and access class-specific questions. Download the Nagwa Classes app today!

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy