Solving a system of linear equations by substitution or elimination usually means rewriting terms and carefully tracking signs. The work grows tedious as the number of equations or variables increases.
An augmented matrix provides a compact representation that combines all of the coefficients and constants into one object. This form makes it possible to apply a small set of row operations that simplify the system without rewriting the original equations.
In the following sections, I will define what an augmented matrix is, show you how to construct it, and explain the standard methods to solve systems of equations with it.
What Is an Augmented Matrix?
An augmented matrix is a matrix that contains the coefficients of the variables on the left and the constant terms on the right, separated by a vertical bar for visual distinction. The bar serves only as a visual separator and does not affect the calculations.
Augmented Matrix Form of a System of Equations
To form the augmented matrix, you should list the coefficients of each variable in the same order for every equation and then append the constant term in an extra column. Each row of the matrix should correspond exactly to one equation in the original system.
Let’s consider the system:

The corresponding augmented matrix is:
![$ \left[ \begin{array}{cc|c} 2 & 1 & 5 \\ 1 & -1 & 1 \end{array} \right] $](https://media.datacamp.com/cms/1b43c2a81ce4d19dda05804ab649a73d.png)
As you can see, the first row encodes the first equation, and the second row encodes the second.
Why Augmented Matrices Are Useful
The augmented matrix collects every number needed to describe the system in one place. All subsequent work relies on applying row operations directly to this single object. As a result, there is no need to rewrite the equations repeatedly or to keep track of the separate coefficients and constant lists. The method scales cleanly to other larger systems and reduces the chance of transcription errors.
Row Operations on Augmented Matrices
There are three elementary row operations that are permitted. Each operation corresponds to an algebraic manipulation that leaves the solution set unchanged. These are:
- Interchange of any two rows, also known as swapping rows.
- Multiplying every entry in a row by the same nonzero constant.
- Adding a multiple of one row to another row (or subtracting).
Because these operations preserve the solution set, the transformed matrix represents equivalent systems. It is important to note that the same operations can happen on columns, too.
Solving Systems Using Augmented Matrices
The solution process has three stages:
- Write the system as an augmented matrix.
- Apply row operations to reach a simpler form.
- Read the solution from the simplified matrix.
The target form is called row echelon form, which signifies that the leading entry, also known as the pivot, in each nonzero row is 1, all entries below each pivot are zero, and the pivots move to the right as one proceeds down the matrix. From the row echelon form, back-substitution will give us the values of the variables.
Gaussian Elimination with Augmented Matrices
Gaussian elimination works by systematically creating zeros below each pivot from left to right. The goal is an upper-triangular matrix.
Begin with the leftmost column that can serve as a pivot. Scale the pivot row if necessary, so the pivot equals 1, then add suitable multiples of that row to the rows below to produce zeros in the column.
Next, move to the next column and repeat the exact same thing. The resulting triangular matrix is solved by back-substitution starting with the bottom row.
If this sounds intimidating, it is okay, as it will make more sense when we see the example later in this article.
Reduced Row Echelon Form (RREF)
Reduced row echelon form simply takes row echelon form one step further.
In addition to the conditions of row echelon form, every entry above each pivot must also be zero, and each pivot must equal 1. For a system with a unique solution, the left-hand side of the matrix becomes the identity matrix. The constants on the right then give the exact values of the variables directly, which means that no back-substitution is required at this point.
Example of Solving a System with an Augmented Matrix
Consider the system:

Form the augmented matrix:
![$ \left[ \begin{array}{cc|c} 2 & 1 & 5 \\ 1 & -1 & 1 \end{array} \right] $](https://media.datacamp.com/cms/ac312dc2de2f85a82688c9822933096a.png)
Divide row 1 by 2:
![$ \left[ \begin{array}{cc|c} 1 & \frac{1}{2} & \frac{5}{2} \\ 1 & -1 & 1 \end{array} \right] $](https://media.datacamp.com/cms/c978fb965317c3958007d5104c40d970.png)
Subtract row 1 from row 2:
![$ \left[ \begin{array}{cc|c} 1 & \frac{1}{2} & \frac{5}{2} \\ 0 & -\frac{3}{2} & -\frac{3}{2} \end{array} \right] $](https://media.datacamp.com/cms/d53fd90648d45966012b43e918ecbab3.png)
Multiply row 2 by -2/3:
![$ \left[ \begin{array}{cc|c} 1 & \frac{1}{2} & \frac{5}{2} \\ 0 & 1 & 1 \end{array} \right] $](https://media.datacamp.com/cms/b1f97689a2caa6be9cd6eba5bd982ba4.png)
Subtract 1/2 times row 2 from row 1:
![$ \left[ \begin{array}{cc|c} 1 & 0 & 2 \\ 0 & 1 & 1 \end{array} \right] $](https://media.datacamp.com/cms/ecfa74efaa9b0dd99bf4d6c0bfc5c80c.png)
The matrix is now in the reduced row echelon form. The solution is x=2, and y=1.
Augmented Matrix vs. Coefficient Matrix
The coefficient matrix contains only the coefficients of the variables. For the system above, it is:

The augmented matrix appends the column of the constants, and gives a full representation that is used in the solution process.
Augmented Matrix and Linear Systems
Each row of the augmented matrix corresponds to one equation, so that the matrix encodes the entire system. After row reduction, one of three outcomes is possible:
- The matrix gives the same number of nonzero pivots as the variables themselves, which means that there is one unique solution.
- A row of the form [0 0 … 0 | c] where c is nontrivial, which means that there is no solution.
- There are fewer pivots than the variables with no contradictory rows, which means there are infinitely many solutions.
Conclusion
Augmented matrices transform the solution of linear systems into a sequence of well-defined row operations that are applied to a single array.
The tools available are the three elementary row operations, which preserve the solution set while also simplifying the matrix. Once you're comfortable with this technique, you'll be ready to master Gaussian elimination and reduced row echelon form, as these concepts are the basics of linear algebra that appear nearly everywhere, like data science, optimization, numerical analysis, image processing, and many, many others.
I work on accelerated AI systems enabling edge intelligence with federated ML pipelines on decentralized data and distributed workloads. My work focuses on Large Models, Speech Processing, Computer Vision, Reinforcement Learning, and advanced ML Topologies.
Augmented Matrix FAQs
What is the difference between a coefficient matrix and an augmented matrix?
The coefficient matrix contains only the coefficients of the variables. The augmented matrix adds a final column with the constant terms from the original equations.
Do the row operations change the solutions of the system?
No. The three elementary row operations, swapping rows, scaling a row by a nonzero constant, or adding a multiple of one row to another, produce an equivalent system that has exactly the same solutions.
How can the augmented matrix tell you whether the system has no solution or infinitely many solutions?
After reduction, a row of the form [0 0 … 0 | c] with c ≠ 0 means the system is inconsistent and has no solution. Fewer pivots than variables with no such contradictory row means infinitely many solutions exist.
What is the difference between row echelon form and reduced row echelon form?
Row echelon form has leading 1’s with zeros below each pivot. Reduced row echelon form also has zeros above each pivot, turning the left side into the identity matrix (when a unique solution exists), so the solution can be read directly.
Is the augmented-matrix method only suitable for small systems?
No. The method works for any number of equations and variables and is the foundation for computer algorithms that solve large linear systems in linear algebra and data science.
