Solve Systems of Equations Using Matrices
Write the augmented matrix for a system of equations
Solving a system of equations can be a tedious operation where a simple mistake can wreak havoc on finding the solution. An alternative method which uses the basic procedures of elimination but with notation that is simpler is available. The method involves using a matrix. A matrix is a rectangular array of numbers arranged in rows and columns.
The matrix on the left below has rows and columns, so it has order — we say it is a by matrix. The matrix on the right has rows and columns, so it is a by matrix.
Each number in the matrix is called an element, or entry, of the matrix.
We will use a matrix to represent a system of linear equations. We write each equation in standard form, and the coefficients of the variables and the constant of each equation become a row in the matrix. Each column then holds the coefficients of one of the variables in the system, or the constants. A vertical line replaces the equal signs. We call the resulting matrix the augmented matrix for the system of equations. For the system , the augmented matrix is
The first column is made up of all the coefficients of , the second column is all the coefficients of , and the column to the right of the vertical line is all the constants.
Example. Write each system of linear equations as an augmented matrix: (a) (b)
(a) The second equation is not in standard form. We rewrite it in standard form first:
We replace the second equation with its standard form. In the augmented matrix, the first equation gives us the first row and the second equation gives us the second row; the vertical line replaces the equal signs.
(b) All three equations are already in standard form. In the augmented matrix, the first equation gives us the first row, the second equation gives us the second row, and the third equation gives us the third row.
Write the system as an augmented matrix (rewrite the second equation in standard form first). Enter the second row of the matrix as a comma-separated list of three numbers.
in standard form is .It is important as we solve systems of equations using matrices to be able to go back and forth between the system and the matrix. The next example asks us to take the information in the matrix and write the system of equations.
Example. Write the system of equations that corresponds to the augmented matrix:
Each row corresponds to an equation, and each entry is a coefficient of a variable or the constant. The vertical line replaces the equal sign. Since this matrix is columns wide, we know it translates into a system of three equations with three variables:
The augmented matrix corresponds to a system of equations. Enter the coefficients of , , and in the second equation, as a comma-separated list of three numbers.
Row 2 of the matrix is the second equation: the first three entries are the coefficients of , , and .Use row operations on a matrix
Once a system of equations is in its augmented matrix form, we perform operations on the rows that lead us to the solution.
To solve by elimination, it doesn’t matter which order we place the equations in the system — similarly, in the matrix we can interchange the rows. When we solve by elimination, we often multiply one of the equations by a constant. Since each row represents an equation, and we can multiply each side of an equation by a constant, we can likewise multiply each entry in a row by any real number except . In elimination, we often add a multiple of one row to another row — in the matrix we can replace a row with its sum with a multiple of another row.
Row operations. In a matrix, the following operations can be performed on any row, and the resulting matrix will be equivalent to the original matrix.
- Interchange any two rows.
- Multiply a row by any real number except .
- Add a nonzero multiple of one row to another row.
Performing these operations is easy to do, but all the arithmetic can result in a mistake. If we use a system to record the row operation at each step, it is much easier to go back and check our work. We use capital letters with subscripts to represent each row, and show the operation to the left of the new matrix.
To show interchanging rows and :
To multiply row by :
To multiply row by and add it to row :
Example. Perform the indicated operations on the augmented matrix
(a) Interchange rows and . (b) Multiply row by . (c) Multiply row by and add it to row .
(a) We interchange rows and :
(b) We multiply row by :
(c) We multiply row by and add it to row :
Starting from the matrix , multiply row 1 by 2. Enter the new row 1 as a comma-separated list of four numbers.
Multiply every entry of row 1, including the entry after the bar, by 2.Now that we have practiced the row operations, we look at an augmented matrix and figure out what operation to use to reach a goal — exactly what we do when we eliminate a variable by elimination. We decide what number to multiply a row by so that a variable is eliminated when we add the rows together.
Example. Perform the row operation that will get the first entry in row to be zero in the augmented matrix .
To make the a , we multiply row by and add it to row :
Perform the row operation that will get the first entry of row 2 to be zero in the augmented matrix . Enter the resulting row 2 as a comma-separated list of three numbers.
Multiply row 1 by 2 and add it to row 2.Solve systems of equations using matrices
To solve a system of equations using matrices, we transform the augmented matrix into a matrix in row-echelon form using row operations.
Once we get the augmented matrix into row-echelon form, we can write the equivalent system of equations and read the value of at least one variable. We then substitute this value into another equation to continue solving for the other variables.
Example. How to solve a system of equations using a matrix. Solve the system of equations using a matrix: .
Write the augmented matrix for the system of equations:
Interchange the rows, so a is in row , column :
Multiply row by and add it to row , to get a zero in column below the :
Multiply row by , to get the entry in row , column to be :
The matrix is now in row-echelon form. Write the corresponding system of equations:
Use substitution to find the remaining variable. Substitute into :
Write the solution as an ordered pair: . Checking that this ordered pair makes both original equations true is left to you.
Solve the system of equations using a matrix: . Enter the solution as an ordered pair.
Get a zero below the leading in column , put a in row 2 column 2, then use substitution.Solve a system of equations using matrices.
- Write the augmented matrix for the system of equations.
- Using row operations, get the entry in row 1, column 1 to be .
- Using row operations, get zeros in column 1 below the .
- Using row operations, get the entry in row 2, column 2 to be .
- Continue the process until the matrix is in row-echelon form.
- Write the corresponding system of equations.
- Use substitution to find the remaining variables.
- Write the solution as an ordered pair or triple.
- Check that the solution makes the original equations true.
We use the same procedure when the system of equations has three equations.
Example. Solve the system of equations using a matrix: .
Write the augmented matrix for the equations:
Interchange rows and , to get the entry in row 1, column 1 to be :
Multiply row by and add it to row , to get a zero in column :
Multiply row by and add it to row , to get another zero in column . The entry in row 2, column 2 is already :
Multiply row by and add it to row :
Multiply row by , so the matrix is in row-echelon form:
Write the corresponding system of equations:
Use substitution to find the remaining variables. From with , we get . Substituting and into :
Write the solution as an ordered triple: . Checking that this triple makes all three original equations true is left to you.
Solve the system of equations using a matrix: . Enter the solution as an ordered triple.
Get row-echelon form, then use substitution starting from the last row.So far our work with matrices has only been with systems that are consistent and independent, which means they have exactly one solution. Let’s now look at what happens when we use a matrix for a dependent or inconsistent system.
Example. Solve the system of equations using a matrix: .
Write the augmented matrix for the equations:
The entry in row , column is already . Using row operations, get zeros in column below the :
Multiply row by , so the entry in row 2, column 2 is :
Multiply row by and add it to row :
At this point we have all zeros to the left of the vertical line in row . Write the corresponding system of equations:
Since , we have a false statement. Just as when we solved a system using other methods, this tells us we have an inconsistent system — there is no solution.
Solve the system of equations using a matrix: . What do you find?
Row-reduce the augmented matrix; two of the rows lead to contradictory equations for and .The last system was inconsistent and so had no solution. The next example is dependent and has infinitely many solutions.
Example. Solve the system of equations using a matrix: .
Write the augmented matrix for the equations:
The entry in row , column is already . Using row operations, get zeros in column below the :
Multiply row by , so the entry in row 2, column 2 is :
Multiply row by and add it to row :
At this point we have all zeros in the bottom row. Write the corresponding system of equations:
Since , we have a true statement. Just as when we solved by substitution, this tells us we have a dependent system — there are infinitely many solutions.
Solve for in terms of in the second equation: , so . Substitute this into the first equation to solve for in terms of :
The system has infinitely many solutions, one for every value of :
Solve the system of equations using a matrix: . What do you find?
Row-reduce the augmented matrix; the bottom row reduces to all zeros.Key terms
matrix — a rectangular array of numbers arranged in rows and columns; a matrix with rows and columns has order . augmented matrix — the matrix formed from a system of linear equations, where each row holds the coefficients of a system’s equation and the constants, with a vertical line in place of the equal signs. row operations — interchanging two rows, multiplying a row by a nonzero real number, or adding a nonzero multiple of one row to another row; each produces an equivalent matrix. row-echelon form — an augmented matrix in which, to the left of the vertical line, each entry on the diagonal is and all entries below the diagonal are . inconsistent system — a system whose row-echelon form leads to a false statement (such as ); it has no solution. dependent system — a system whose row-echelon form leads to a true statement (such as ); it has infinitely many solutions.
This section is adapted from Intermediate Algebra 2e, Section 4.5: Solve Systems of Equations Using Matrices by Lynn Marecek, MaryAnne Anthony-Smith, and Andrea Honeycutt Mathis, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: represented matrices and augmented matrices with typeset KaTeX arrays instead of the source’s labeled screenshots; omitted the Be Prepared quiz, the decorative “order for getting 1’s and 0’s” color-box graphic (redundant with the adjacent How To step list), the Media box, and Self Check; corrected an arithmetic slip in the source’s final stated numeric solution for the dependent-system example — the row-reduction work shown (both here and in the source) derives the general solution , which is what we report, rather than the specific triple the source printed, which does not actually satisfy the system; and converted the practice problems (“Try Its”) into interactive exercises with instant feedback.