1.2 Gaussian Elimination
In the previous section, we saw how elementary row operations can transform a linear system’s augmented matrix into a simpler form from which solutions are evident. This section formalizes that process.
We will cover:
A matrix is in Row Echelon Form (REF) if it has the following properties:
A matrix in Reduced Row Echelon Form (RREF) has all three REF properties, plus:
Reduced Row Echelon Form Examples: (All follow properties 1-4) \[ \left[{\begin{array}{r r r | r}{1}&{0}&{0}&{4}\\ {0}&{1}&{0}&{7}\\ {0}&{0}&{1}&{-1}\end{array}}\right] \] \[ \left[{\begin{array}{r r r}{1}&{0}&{0}\\ {0}&{1}&{0}\\ {0}&{0}&{1}\end{array}}\right] \] \[ \left[{\begin{array}{r r r r | r}{0}&{1}&{-2}&{0}&{1}\\ {0}&{0}&{0}&{1}&{3}\\ {0}&{0}&{0}&{0}&{0}\\ {0}&{0}&{0}&{0}&{0}\end{array}}\right] \]
Row Echelon Form Examples (NOT Reduced): (Follow properties 1-3, but NOT 4) \[ \left[{\begin{array}{r r r | r}{1}&{4}&{-3}&{7}\\ {0}&{1}&{6}&{2}\\ {0}&{0}&{1}&{5}\end{array}}\right] \]
\[ \left[{\begin{array}{r r r}{1}&{1}&{0}\\ {0}&{1}&{0}\\ {0}&{0}&{0}\end{array}}\right] \]
\[ \left[{\begin{array}{r r r r | r}{0}&{1}&{2}&{6}&{0}\\ {0}&{0}&{1}&{-1}&{0}\\ {0}&{0}&{0}&{0}&{1}\end{array}}\right] \]
Once an augmented matrix is in REF or RREF, the solution to the linear system can be obtained.
Suppose RREF of augmented matrix for \(x_1, x_2, x_3, x_4\) is: \[ \left[{\begin{array}{c c c c | c}{1}&{0}&{0}&{0}&{3}\\ {0}&{1}&{0}&{0}&{-1}\\ {0}&{0}&{1}&{0}&{0}\\ {0}&{0}&{0}&{1}&{5}\end{array}}\right] \] This directly translates to: \[ x_1 = 3, \quad x_2 = -1, \quad x_3 = 0, \quad x_4 = 5 \] This is a unique solution.
Suppose RREF of augmented matrix for \(x, y, z\) is: \[ \left[{\begin{array}{l l l | l}{1}&{0}&{0}&{0}\\ {0}&{1}&{2}&{0}\\ {0}&{0}&{0}&{1}\end{array}}\right] \] The last row corresponds to the equation: \[ 0x + 0y + 0z = 1 \implies 0=1 \] This is a contradiction. The system is inconsistent and has no solution.
Suppose RREF of augmented matrix for \(x, y, z\) is: \[ \left[{\begin{array}{l l l | l}{1}&{0}&{3}&{-1}\\ {0}&{1}&{-4}&{2}\\ {0}&{0}&{0}&{0}\end{array}}\right] \] The last row \(0=0\) can be omitted. The corresponding system is: \[ \begin{array}{r}x + 3z = -1 \\ y - 4z = 2 \end{array} \] Variables corresponding to leading 1s (\(x, y\)) are leading variables. Others (\(z\)) are free variables. Solve for leading variables in terms of free variables: \[ \begin{array}{l}x = -1 - 3z \\ y = 2 + 4z \end{array} \] Assign an arbitrary value (parameter) \(t\) to the free variable \(z\). The general solution (parametric equations) is: \[ x = -1 - 3t, \quad y = 2 + 4t, \quad z = t \] Specific solutions can be found by choosing values for \(t\). For example, if \(t=0\), then \((x,y,z)=(-1,2,0)\). If \(t=1\), then \((x,y,z)=(-4,6,1)\).
Suppose RREF of augmented matrix for \(x, y, z\) is: \[ \left[{\begin{array}{l l l | l}{1}&{-5}&{1}&{4}\\ {0}&{0}&{0}&{0}\\ {0}&{0}&{0}&{0}\end{array}}\right] \] The system reduces to a single equation: \[ x - 5y + z = 4 \] Here, \(x\) is the only leading variable. \(y\) and \(z\) are free variables. Let \(y = s\) and \(z = t\) (parameters). Then \(x = 4 + 5y - z \implies x = 4 + 5s - t\).
The general solution is: \[ x = 4 + 5s - t, \quad y = s, \quad z = t \] This represents a plane in 3D space.
This algorithm reduces any matrix to its unique Reduced Row Echelon Form.
Phase 1: Forward Elimination (Gaussian Elimination to REF) Goal: Create leading 1s and zeros below them.
Phase 2: Backward Elimination (To RREF) Goal: Create zeros above the leading 1s.
The final matrix is in Reduced Row Echelon Form.
Let’s apply Gauss-Jordan Elimination to the augmented matrix for the system: \(x + y + 2z = 9\)
\(2x + 4y - 3z = 1\)
\(3x + 6y - 5z = 0\)
Initial Augmented Matrix: \[ \left[ \begin{array}{r r r | r}{1} & 1 & 2 & 9\\ {2} & 4 & {-3} & 1\\ {3} & 6 & {-5} & 0 \end{array} \right] \]
A system of linear equations is homogeneous if all constant terms are zero: \[ \begin{array}{r l} a_{11}x_{1} + \dots +a_{1n}x_{n} &= 0\\ a_{21}x_{1} + \dots +a_{2n}x_{n} &= 0\\ \vdots\qquad\vdots\qquad\vdots\qquad\vdots \\ a_{m1}x_{1} + \dots +a_{mn}x_{n} &= 0 \end{array} \]
Key properties of homogeneous systems:
Geometrically: For 2D, lines pass through the origin. If they’re distinct and intersect only at origin \(\implies\) trivial solution. If they coincide \(\implies\) infinitely many solutions.

If a homogeneous linear system has \(n\) unknowns, and if the reduced row echelon form of its augmented matrix has \(r\) nonzero rows, then the system has \(n - r\) free variables.
A homogeneous linear system with more unknowns than equations (i.e., \(n > m\)) has infinitely many solutions.
This theorem is very powerful and has applications in fields like signal processing (e.g., finding the null space of a matrix where the outputs of a system are zero) and control theory (e.g., determining system stability).
Solve the homogeneous linear system: \[ \begin{array}{r r r r r r} {x_{1} + 3x_{2}} & {-2x_{3}} & {} & {+2x_{5}} & {} & = 0\\ {2x_{1} + 6x_{2}} & {-5x_{3}} & {-2x_{4}} & {+4x_{5}} & {- 3x_{6}} & = 0\\ {} & {5x_{3}} & {+10x_{4}} & {} & {+15x_{6}} & = 0\\ {2x_{1} + 6x_{2}} & {} & {+8x_{4}} & {+4x_{5}} & {+18x_{6}} & = 0 \end{array} \] This is the same system as in Example 5, but with zeros on the right-hand side. The augmented matrix is: \[ \left[{\begin{array}{r r r r r r | r}{1}&{3}&{-2}&{0}&{2}&{0}&{0}\\ {2}&{6}&{-5}&{-2}&{4}&{-3}&{0}\\ {0}&{0}&{5}&{10}&{0}&{15}&{0}\\ {2}&{6}&{0}&{8}&{4}&{18}&{0}\end{array}}\right] \] Note that elementary row operations will preserve the column of zeros.
Its RREF (from Example 5’s reduction) will be: \[ \left[{\begin{array}{r r r r r r | r}{1}&{3}&{0}&{4}&{2}&{0}&{0}\\ {0}&{0}&{1}&{2}&{0}&{0}&{0}\\ {0}&{0}&{0}&{0}&{0}&{1}&{0}\\ {0}&{0}&{0}&{0}&{0}&{0}&{0}\end{array}}\right] \] The corresponding system of equations is: \[ \begin{array}{r r r r r r} {x_{1} + 3x_{2}} & {} & {+4x_{4}} & {+ 2x_{5}} & {} & {= 0}\\ {} & {x_{3}} & {+2x_{4}} & {} & {} & {= 0}\\ {} & {} & {} & {} & {x_{6}} & {= 0} \end{array} \] Leading variables: \(x_1, x_3, x_6\). Free variables: \(x_2, x_4, x_5\). Let \(x_2 = r, x_4 = s, x_5 = t\). Solution: \[ x_{1} = -3r - 4s - 2t, \quad x_{2} = r, \quad x_{3} = -2s, \quad x_{4} = s, \quad x_{5} = t, \quad x_{6} = 0 \] Since there are free variables, this homogeneous system has infinitely many solutions. The trivial solution is when \(r=s=t=0\).
For computer-based solutions of large systems, Gaussian Elimination (reducing to Row Echelon Form) followed by back-substitution is generally more efficient than full Gauss-Jordan elimination.
Procedure:
Example 7: Example 5 Solved by Back-Substitution
REF from Example 5: \[ \left[{\begin{array}{r r r r r r | r}{1}&{3}&{-2}&{0}&{2}&{0}&{0}\\ {0}&{0}&{1}&{2}&{0}&{3}&{1}\\ {0}&{0}&{0}&{0}&{0}&{1}&{{\frac{1}{3}}}\\ {0}&{0}&{0}&{0}&{0}&{0}&{0}\end{array}}\right] \] Corresponding system: \[ \begin{array}{l} x_1 + 3x_2 - 2x_3 + 2x_5 = 0 \\ x_3 + 2x_4 + 3x_6 = 1 \\ x_6 = \frac{1}{3} \end{array} \] Solving for leading variables (\(x_1, x_3, x_6\)): \[ \begin{array}{l} {x_1 = -3x_2 + 2x_3 - 2x_5} \\ {x_3 = 1 - 2x_4 - 3x_6} \\ {x_6 = \frac{1}{3}} \end{array} \]
Now, back-substitute:
Assign free variables \(x_2=r, x_4=s, x_5=t\). Resulting general solution: \[ x_1 = -3r - 4s - 2t, \quad x_2 = r, \quad x_3 = -2s, \quad x_4 = s, \quad x_5 = t, \quad x_6 = \frac{1}{3} \] This confirms the same solution as Gauss-Jordan elimination for Example 5.
Suppose these are augmented matrices for systems in \(x_1, x_2, x_3, x_4\). All are in REF, but not RREF.
(a) No Solution \[ {\left[\begin{array}{l l l l | l}{1}&{-3}&{7}&{2}&{5}\\ {0}&{1}&{2}&{-4}&{1}\\ {0}&{0}&{1}&{6}&{9}\\ {0}&{0}&{0}&{0}&{1}\end{array}\right]} \] Last row: \(0=1\). Inconsistent.
(b) Infinitely Many Solutions \[ {\left[\begin{array}{l l l l | l}{1}&{-3}&{7}&{2}&{5}\\ {0}&{1}&{2}&{-4}&{1}\\ {0}&{0}&{1}&{6}&{9}\\ {0}&{0}&{0}&{0}&{0}\end{array}\right]} \] Last row: \(0=0\). Leading variables \(x_1, x_2, x_3\). Free variable \(x_4\). Infinitely many solutions.
(c) Unique Solution \[ {\left[\begin{array}{l l l l | l}{1}&{-3}&{7}&{2}&{5}\\ {0}&{1}&{2}&{-4}&{1}\\ {0}&{0}&{1}&{6}&{9}\\ {0}&{0}&{0}&{1}&{0}\end{array}\right]} \] Last row: \(x_4=0\). All variables are leading variables. Unique solution.
For the matrix \[ A = \begin{bmatrix} 0 & 0 & -2 & 0 & 7 & 12 \\ 2 & 4 & -10 & 6 & 12 & 28 \\ 2 & 4 & -5 & 6 & -5 & -1 \end{bmatrix} \] one possible REF is: \[ \left[ \begin{array}{cccccc}1 & 2 & -5 & 3 & 6 & 14 \\ 0 & 0 & 1 & 0 & -\frac{7}{2} & -6 \\ 0 & 0 & 0 & 0 & 1 & 2 \end{array} \right] \] The leading 1s are in positions (row 1, column 1), (row 2, column 3), and (row 3, column 5). These are the pivot positions. The pivot columns are columns 1, 3, and 5. In a linear system, pivot columns identify the leading variables. Here, \(x_1, x_3, x_5\) would be leading variables.
While Gaussian and Gauss-Jordan elimination are mathematically sound, their practical implementation on computers faces challenges:
For large systems (e.g., in computational fluid dynamics, large-scale circuit simulations), specialized numerical techniques are used to minimize these errors. Gaussian elimination is generally preferred over Gauss-Jordan due to fewer operations, reducing error propagation.
To perform row operations on a matrix.
Checking whether a matrix is in (reduced) echelon form.
Applying the algorithm to compute a solution of a linear system.