Using RREF to solve systems of linear equations

A system of linear equations and a matrix are two notations for the same object. Moving between them, writing the augmented matrix, reducing it, reading the answer, is the core workflow of introductory linear algebra.

Setting up the augmented matrix

Take this system:

 x  +  2y  −  z  =  4
2x  +  3y  +  z  =  7
 x        +  4z  =  3

Write the coefficients as rows, with the right-hand-side constants in a column separated by a bar:

[ 1   2  -1  |  4 ]
[ 2   3   1  |  7 ]
[ 1   0   4  |  3 ]

Every row is one equation. Every column (left of the bar) is one variable. The bar just keeps the constants visually distinct; the row operations treat the full row including the bar.

Reducing to RREF

Applying Gauss-Jordan elimination to this augmented matrix (the full steps are worked out in the RREF calculator if you want to follow along):

[ 1   0   0  |  5 ]
[ 0   1   0  |  1 ]
[ 0   0   1  | -2 ]

Reading off the solution: x = 5, y = 1, z = −2.

This is the unique solution case. The left block is the 3×3 identity matrix, which only happens when the system has exactly one solution.

The three possible outcomes

Case 1: Unique solution

The RREF of the augmented matrix looks like the identity matrix on the left, with the solution column on the right. Every variable is a pivot variable. Rank of the coefficient matrix equals the number of variables.

Case 2: No solution (inconsistent system)

A row in the RREF looks like:

[ 0   0   0  |  1 ]

This row says 0·x + 0·y + 0·z = 1, which is impossible. There's no set of values for x, y, z that satisfies this. The system is inconsistent. This situation arises when the equations contradict each other, geometrically, three planes with no common intersection point.

Case 3: Infinitely many solutions (underdetermined or dependent system)

When there are fewer pivots than variables, some variables have no pivot in their column. These are free variables, they can take any value, and the remaining variables are expressed in terms of them.

Example:

[ 1   0   2  |  3 ]
[ 0   1  -1  |  5 ]
[ 0   0   0  |  0 ]

Columns 1 and 2 have pivots; column 3 does not. So z is free. Let z = t for any real number t. Then:

The solution set is a line in three-dimensional space, parameterized by t.

Rank and its role

The rank of a matrix is the number of nonzero rows in its RREF (equivalently, the number of pivot columns). Rank connects directly to the solution structure:

For the unique solution example: rank = 3 = n. For the infinite solution example: rank = 2 < n = 3, so there's 1 free variable.

Homogeneous systems

A system Ax = 0 (all constants on the right are zero) always has at least one solution: the trivial solution x = 0. The question is whether there are other solutions.

If rank(A) = n, the only solution is the zero vector.

If rank(A) < n, there are nontrivial solutions, the null space of A has dimension n − rank(A).

This comes up in finding the null space of a matrix: reduce A to RREF, identify the free variables, and write each free variable as a parameter. The resulting vectors form a basis for the null space.

A note on the augmented matrix vs. the coefficient matrix

When checking for consistency, reduce the full augmented matrix [A|b]. When computing rank or finding the null space, reduce just the coefficient matrix A. These produce different results when the system is inconsistent, the augmented matrix has an extra nonzero row in RREF that doesn't show up in the coefficient matrix alone.

Verifying your answer

For a unique solution, substitute back into the original equations. For an infinite family, verify that the parametric form satisfies each equation for all values of t.

Tools like the row reduction calculator are useful for checking work, especially for larger systems where hand arithmetic gets tedious. Just enter the augmented matrix and the calculator returns the RREF plus the rank, showing exactly which variables are pivot variables and which are free.