Gaussian Elimination

Master the systematic method for solving any linear system

You have been solving systems of equations by substitution and elimination since algebra class. These methods work, but they require you to make choices at each step: which variable to eliminate first, which equation to substitute into which. For small systems, this is fine. But what happens when you have five equations? Ten? A thousand? You need a method that removes all guesswork, a mechanical procedure that always works regardless of the system’s size.

Gaussian elimination is that method. Named after the legendary mathematician Carl Friedrich Gauss (though versions of it were known in ancient China), this algorithm systematically transforms any system of linear equations into a form where the solution becomes obvious. It is the workhorse of computational linear algebra, running millions of times per second in engineering simulations, economic models, and machine learning applications around the world.

The beauty of Gaussian elimination lies in its simplicity. You are allowed exactly three types of operations on the rows of a matrix, and by applying them strategically, you can reduce any system to one that is trivial to solve. In this lesson, you will learn these operations, understand the forms they produce, and develop the ability to solve any linear system you encounter.

Core Concepts

The Three Row Operations

The foundation of Gaussian elimination rests on three simple operations that you can perform on the rows of an augmented matrix. These operations are called elementary row operations, and they have a crucial property: they never change the solution set of the system. Applying any sequence of row operations gives you an equivalent system with exactly the same solutions as the original.

Here are the three row operations:

1. Row Swap: Interchange two rows.

Notation: $R_i \leftrightarrow R_j$ (swap row $i$ and row $j$)

Example: $$\left[\begin{array}{cc|c} 0 & 1 & 3 \ 2 & 4 & 6 \end{array}\right] \xrightarrow{R_1 \leftrightarrow R_2} \left[\begin{array}{cc|c} 2 & 4 & 6 \ 0 & 1 & 3 \end{array}\right]$$

Why is this valid? Swapping equations does not change what the system is asking. The system $x + y = 5$, $x - y = 1$ has exactly the same solutions as $x - y = 1$, $x + y = 5$. You have just listed the equations in a different order.

2. Row Scaling: Multiply a row by a nonzero constant.

Notation: $R_i \to c \cdot R_i$ (multiply row $i$ by $c$, where $c \neq 0$)

Example: $$\left[\begin{array}{cc|c} 2 & 4 & 6 \ 1 & 3 & 5 \end{array}\right] \xrightarrow{R_1 \to \frac{1}{2}R_1} \left[\begin{array}{cc|c} 1 & 2 & 3 \ 1 & 3 & 5 \end{array}\right]$$

Why is this valid? Multiplying both sides of an equation by the same nonzero number preserves the solution. The equation $2x + 4y = 6$ has exactly the same solutions as $x + 2y = 3$. You can always undo this operation by multiplying by the reciprocal.

3. Row Replacement: Add a multiple of one row to another row.

Notation: $R_i \to R_i + c \cdot R_j$ (add $c$ times row $j$ to row $i$)

Example: $$\left[\begin{array}{cc|c} 1 & 2 & 3 \ 1 & 3 & 5 \end{array}\right] \xrightarrow{R_2 \to R_2 - R_1} \left[\begin{array}{cc|c} 1 & 2 & 3 \ 0 & 1 & 2 \end{array}\right]$$

Why is this valid? Adding equal quantities to both sides of an equation preserves solutions. If we know that $x + 2y = 3$, then subtracting this equation from $x + 3y = 5$ gives $(x + 3y) - (x + 2y) = 5 - 3$, which simplifies to $y = 2$. The new equation $y = 2$ combined with the original $x + 2y = 3$ has exactly the same solutions as the original system.

These three operations are your only tools, but they are remarkably powerful. With just these three, you can solve any system of linear equations.

Pivots and the Goal of Elimination

When performing Gaussian elimination, we focus on pivots. A pivot is the first nonzero entry in a row (reading from left to right) after the matrix has been partially reduced. The pivot position tells us which variable that row will determine.

The goal of Gaussian elimination is to create a “staircase pattern” of pivots, where each pivot is:

  1. To the right of the pivot in the row above it
  2. The only nonzero entry in its column (in reduced form)

By creating this staircase, we systematically isolate each variable, making the system easy to solve.

Row Echelon Form (REF)

A matrix is in row echelon form (REF) if it satisfies these conditions:

  1. All rows consisting entirely of zeros are at the bottom of the matrix
  2. The first nonzero entry (the pivot) in each non-zero row is to the right of the pivot in the row above it
  3. All entries below a pivot are zero

Here is an example of a matrix in REF:

$$\left[\begin{array}{ccc|c} \boxed{2} & 3 & 1 & 5 \ 0 & \boxed{4} & -1 & 3 \ 0 & 0 & \boxed{1} & 2 \end{array}\right]$$

The boxed entries are the pivots. Notice the staircase pattern: each pivot is strictly to the right of and below the previous one. The entries below each pivot are all zero.

Here is another valid REF (pivots do not have to be in consecutive columns):

$$\left[\begin{array}{cccc|c} \boxed{1} & 2 & 0 & 3 & 4 \ 0 & 0 & \boxed{5} & 1 & 2 \ 0 & 0 & 0 & 0 & 0 \end{array}\right]$$

In REF, the system becomes easy to solve using back-substitution (which we will discuss shortly). The last non-zero row gives you one variable directly, and you work your way up, substituting known values to find the others.

Reduced Row Echelon Form (RREF)

A matrix is in reduced row echelon form (RREF) if it satisfies all the conditions for REF, plus:

  1. Each pivot is equal to 1
  2. Each pivot is the only nonzero entry in its column (all entries above a pivot are also zero)

Here is the same system from before, now in RREF:

$$\left[\begin{array}{ccc|c} \boxed{1} & 0 & 0 & 1 \ 0 & \boxed{1} & 0 & 2 \ 0 & 0 & \boxed{1} & 2 \end{array}\right]$$

In RREF, the solution is immediate: $x = 1$, $y = 2$, $z = 2$. No back-substitution is needed because each row has exactly one variable with a coefficient of 1, and that variable appears nowhere else.

RREF is unique: every matrix has exactly one RREF, regardless of which sequence of row operations you use to reach it. REF is not unique; different sequences of operations can produce different REF matrices. But all paths lead to the same RREF.

The Gaussian Elimination Algorithm

Here is the systematic procedure for reducing a matrix to REF:

Forward Elimination (producing REF):

  1. Start with the leftmost column that has a nonzero entry. This is the pivot column.

  2. If necessary, swap rows to move a nonzero entry to the top position of the pivot column. This entry becomes the pivot.

  3. Use row replacement operations to create zeros in all positions below the pivot. For each row below the pivot row, add an appropriate multiple of the pivot row to eliminate the entry in the pivot column.

  4. Ignore the row you just processed and repeat steps 1-3 on the remaining submatrix (the rows below and columns to the right).

  5. Continue until you have processed all rows or all columns.

Gauss-Jordan Elimination (producing RREF):

To continue from REF to RREF, add these steps:

  1. Back-elimination: Starting from the rightmost pivot and working left, use row replacement to create zeros above each pivot.

  2. Scaling: Divide each row by its pivot to make all pivots equal to 1.

(Steps 6 and 7 can be done in either order, though it is often easier to scale first.)

Back-Substitution

If you stop at REF instead of going all the way to RREF, you solve the system using back-substitution. Here is how it works:

Starting from the bottom non-zero row and working upward:

  1. The bottom row has an equation in one variable (or reveals the system has no solution). Solve for that variable.
  2. Substitute the known value into the row above and solve for the next variable.
  3. Continue working upward until all variables are determined.

For example, if your REF is:

$$\left[\begin{array}{ccc|c} 1 & 2 & 1 & 6 \ 0 & 1 & -1 & 1 \ 0 & 0 & 2 & 4 \end{array}\right]$$

Step 1: From row 3: $2z = 4$, so $z = 2$

Step 2: From row 2: $y - z = 1$, so $y - 2 = 1$, giving $y = 3$

Step 3: From row 1: $x + 2y + z = 6$, so $x + 2(3) + 2 = 6$, giving $x = -2$

Back-substitution is often faster than continuing to RREF, especially for hand calculations. However, RREF has advantages when you need to analyze the solution structure or when using a computer.

Detecting Special Cases

Not every system has a unique solution. Gaussian elimination naturally reveals when a system has no solution or infinitely many solutions.

No Solution (Inconsistent System):

During elimination, you discover the system has no solution when you encounter a row of the form:

$$\left[\begin{array}{ccc|c} 0 & 0 & \cdots & 0 & b \end{array}\right] \quad \text{where } b \neq 0$$

This row says $0 = b$ (where $b$ is nonzero), which is impossible. The system is inconsistent.

For example:

$$\left[\begin{array}{cc|c} 1 & 2 & 3 \ 0 & 0 & 5 \end{array}\right]$$

The second row says $0x + 0y = 5$, which simplifies to $0 = 5$. This is false, so there is no solution.

Infinitely Many Solutions:

When you complete the elimination and every non-zero row corresponds to a valid equation (no $0 = \text{nonzero}$), but you have fewer pivots than variables, the system has infinitely many solutions.

The variables corresponding to pivot columns are called basic variables (or pivot variables). The remaining variables are called free variables. You can set free variables to any values and then solve for the basic variables.

For example, if the RREF is:

$$\left[\begin{array}{ccc|c} 1 & 2 & 0 & 3 \ 0 & 0 & 1 & 2 \end{array}\right]$$

This has two pivots (in columns 1 and 3) but three variables ($x_1$, $x_2$, $x_3$). Variable $x_2$ has no pivot in its column, so it is free.

The equations are $x_1 + 2x_2 = 3$ and $x_3 = 2$.

Setting $x_2 = t$ (a free parameter), we get:

  • $x_1 = 3 - 2t$
  • $x_2 = t$
  • $x_3 = 2$

This describes infinitely many solutions, one for each value of $t$.

Parametric Solutions

When a system has infinitely many solutions, we express the answer in parametric form. Each free variable becomes a parameter, and we express the basic variables in terms of these parameters.

The general solution can be written as a vector:

$$\begin{pmatrix} x_1 \ x_2 \ x_3 \end{pmatrix} = \begin{pmatrix} 3 - 2t \ t \ 2 \end{pmatrix} = \begin{pmatrix} 3 \ 0 \ 2 \end{pmatrix} + t\begin{pmatrix} -2 \ 1 \ 0 \end{pmatrix}$$

This elegant form shows that the solution set is a line in three-dimensional space: a particular solution $(3, 0, 2)$ plus any multiple of the direction vector $(-2, 1, 0)$.

For systems with two free variables, you would have two parameters and the solution set would be a plane. The number of free variables equals the number of parameters equals the “dimension” of the solution set.

Counting Solutions

Here is a summary of how to determine the number of solutions from the RREF:

Situation Number of Solutions
Row of form $[0 \cdots 0 | b]$ with $b \neq 0$ None (inconsistent)
No such row, and every variable is basic (has a pivot) Exactly one
No such row, and some variables are free Infinitely many

The number of free variables tells you how many parameters you need to describe the solution set.

Notation and Terminology

Term Meaning Example
Row operation Legal transformation of augmented matrix $R_2 \to R_2 - 2R_1$
Pivot Leading nonzero entry in a row (after reduction) The 1 in $[0\ 1\ 3]$
REF Row echelon form (staircase of pivots, zeros below)
RREF Reduced REF (pivots are 1, only nonzero in column)
Basic variable Variable corresponding to a pivot column
Free variable Variable with no pivot in its column
Back-substitution Solving from bottom row upward after REF
Consistent System has at least one solution
Inconsistent System has no solution (contradiction found)

Examples

Example 1: Reducing to Row Echelon Form

Reduce the augmented matrix $\left[\begin{array}{cc|c} 2 & 4 & 6 \ 1 & 3 & 5 \end{array}\right]$ to row echelon form.

Solution:

We want to create zeros below the first pivot.

Step 1: The entry in position $(1,1)$ is 2, which will be our pivot. We need to eliminate the 1 in position $(2,1)$.

Step 2: To eliminate the entry in row 2, column 1, we subtract $\frac{1}{2}$ times row 1 from row 2.

Alternatively, to avoid fractions, let us first swap the rows to make the pivot 1:

$$\left[\begin{array}{cc|c} 2 & 4 & 6 \ 1 & 3 & 5 \end{array}\right] \xrightarrow{R_1 \leftrightarrow R_2} \left[\begin{array}{cc|c} 1 & 3 & 5 \ 2 & 4 & 6 \end{array}\right]$$

Step 3: Now eliminate the 2 in row 2 by subtracting 2 times row 1:

$$\left[\begin{array}{cc|c} 1 & 3 & 5 \ 2 & 4 & 6 \end{array}\right] \xrightarrow{R_2 \to R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & 3 & 5 \ 0 & -2 & -4 \end{array}\right]$$

Result: The matrix $\left[\begin{array}{cc|c} 1 & 3 & 5 \ 0 & -2 & -4 \end{array}\right]$ is in row echelon form.

The pivots are 1 (in row 1, column 1) and $-2$ (in row 2, column 2), forming the required staircase pattern.

Example 2: Solving from REF Using Back-Substitution

Solve the system corresponding to the REF $\left[\begin{array}{cc|c} 1 & 3 & 5 \ 0 & -2 & -4 \end{array}\right]$ from Example 1.

Solution:

This augmented matrix corresponds to the system: $$x + 3y = 5$$ $$-2y = -4$$

Step 1 (Bottom row): From the second equation: $$-2y = -4$$ $$y = 2$$

Step 2 (Back-substitute): Substitute $y = 2$ into the first equation: $$x + 3(2) = 5$$ $$x + 6 = 5$$ $$x = -1$$

Verification: Check both original equations:

  • First equation: $2(-1) + 4(2) = -2 + 8 = 6$ (True)
  • Second equation: $(-1) + 3(2) = -1 + 6 = 5$ (True)

Solution: $(x, y) = (-1, 2)$

Example 3: Complete Solution via RREF

Solve the system: $$x + 2y - z = 3$$ $$2x + 5y + z = 8$$ $$3x + 7y = 11$$

Solution:

Step 1: Write the augmented matrix.

$$\left[\begin{array}{ccc|c} 1 & 2 & -1 & 3 \ 2 & 5 & 1 & 8 \ 3 & 7 & 0 & 11 \end{array}\right]$$

Step 2: Forward elimination to reach REF.

The first pivot is already 1. Eliminate entries below it:

$R_2 \to R_2 - 2R_1$: $$\left[\begin{array}{ccc|c} 1 & 2 & -1 & 3 \ 0 & 1 & 3 & 2 \ 3 & 7 & 0 & 11 \end{array}\right]$$

$R_3 \to R_3 - 3R_1$: $$\left[\begin{array}{ccc|c} 1 & 2 & -1 & 3 \ 0 & 1 & 3 & 2 \ 0 & 1 & 3 & 2 \end{array}\right]$$

Now the second pivot is the 1 in position $(2,2)$. Eliminate below it:

$R_3 \to R_3 - R_2$: $$\left[\begin{array}{ccc|c} 1 & 2 & -1 & 3 \ 0 & 1 & 3 & 2 \ 0 & 0 & 0 & 0 \end{array}\right]$$

This is REF. The third row is all zeros, which is fine (not inconsistent).

Step 3: Continue to RREF by eliminating above pivots.

$R_1 \to R_1 - 2R_2$: $$\left[\begin{array}{ccc|c} 1 & 0 & -7 & -1 \ 0 & 1 & 3 & 2 \ 0 & 0 & 0 & 0 \end{array}\right]$$

This is RREF. The pivots are in columns 1 and 2. Column 3 has no pivot, so $z$ is a free variable.

Step 4: Write the solution in parametric form.

From the RREF:

  • Row 1: $x - 7z = -1$, so $x = -1 + 7z$
  • Row 2: $y + 3z = 2$, so $y = 2 - 3z$

Let $z = t$ (free parameter). The solution is:

$$\begin{pmatrix} x \ y \ z \end{pmatrix} = \begin{pmatrix} -1 + 7t \ 2 - 3t \ t \end{pmatrix} = \begin{pmatrix} -1 \ 2 \ 0 \end{pmatrix} + t\begin{pmatrix} 7 \ -3 \ 1 \end{pmatrix}$$

Verification: Let us check $t = 0$ (giving $(-1, 2, 0)$):

  • $(-1) + 2(2) - 0 = 3$ (True)
  • $2(-1) + 5(2) + 0 = 8$ (True)
  • $3(-1) + 7(2) = 11$ (True)

Solution: Infinitely many solutions given by $(x, y, z) = (-1 + 7t, 2 - 3t, t)$ for any real number $t$.

Example 4: Identifying an Inconsistent System

Determine if the following system has a solution: $$x + 2y = 3$$ $$2x + 4y = 5$$

Solution:

Step 1: Write the augmented matrix.

$$\left[\begin{array}{cc|c} 1 & 2 & 3 \ 2 & 4 & 5 \end{array}\right]$$

Step 2: Apply row operations.

$R_2 \to R_2 - 2R_1$: $$\left[\begin{array}{cc|c} 1 & 2 & 3 \ 0 & 0 & -1 \end{array}\right]$$

Step 3: Interpret the result.

The second row represents the equation: $$0x + 0y = -1$$ $$0 = -1$$

This is a contradiction. No values of $x$ and $y$ can make this true.

Geometric interpretation: The first equation is $x + 2y = 3$, and the second is $2x + 4y = 5$. Dividing the second by 2 gives $x + 2y = 2.5$. These are parallel lines (same slope) with different y-intercepts. They never intersect.

Conclusion: The system is inconsistent and has no solution.

Example 5: System with Infinitely Many Solutions (Two Free Variables)

Solve the system: $$x_1 + 2x_2 - x_3 + 3x_4 = 4$$ $$2x_1 + 4x_2 + x_3 + 2x_4 = 6$$

Solution:

Step 1: Write the augmented matrix.

$$\left[\begin{array}{cccc|c} 1 & 2 & -1 & 3 & 4 \ 2 & 4 & 1 & 2 & 6 \end{array}\right]$$

Step 2: Forward elimination.

$R_2 \to R_2 - 2R_1$: $$\left[\begin{array}{cccc|c} 1 & 2 & -1 & 3 & 4 \ 0 & 0 & 3 & -4 & -2 \end{array}\right]$$

Step 3: Scale row 2 to make the pivot equal to 1.

$R_2 \to \frac{1}{3}R_2$: $$\left[\begin{array}{cccc|c} 1 & 2 & -1 & 3 & 4 \ 0 & 0 & 1 & -\frac{4}{3} & -\frac{2}{3} \end{array}\right]$$

Step 4: Eliminate above the second pivot.

$R_1 \to R_1 + R_2$: $$\left[\begin{array}{cccc|c} 1 & 2 & 0 & \frac{5}{3} & \frac{10}{3} \ 0 & 0 & 1 & -\frac{4}{3} & -\frac{2}{3} \end{array}\right]$$

This is RREF. Pivots are in columns 1 and 3.

Step 5: Identify basic and free variables.

  • Basic variables: $x_1$ (column 1 has pivot), $x_3$ (column 3 has pivot)
  • Free variables: $x_2$ (no pivot), $x_4$ (no pivot)

Step 6: Express basic variables in terms of free variables.

From row 1: $x_1 + 2x_2 + \frac{5}{3}x_4 = \frac{10}{3}$

So $x_1 = \frac{10}{3} - 2x_2 - \frac{5}{3}x_4$

From row 2: $x_3 - \frac{4}{3}x_4 = -\frac{2}{3}$

So $x_3 = -\frac{2}{3} + \frac{4}{3}x_4$

Step 7: Write the parametric solution.

Let $x_2 = s$ and $x_4 = t$. Then:

$$\begin{pmatrix} x_1 \ x_2 \ x_3 \ x_4 \end{pmatrix} = \begin{pmatrix} \frac{10}{3} - 2s - \frac{5}{3}t \ s \ -\frac{2}{3} + \frac{4}{3}t \ t \end{pmatrix}$$

This can be written as:

$$= \begin{pmatrix} \frac{10}{3} \ 0 \ -\frac{2}{3} \ 0 \end{pmatrix} + s\begin{pmatrix} -2 \ 1 \ 0 \ 0 \end{pmatrix} + t\begin{pmatrix} -\frac{5}{3} \ 0 \ \frac{4}{3} \ 1 \end{pmatrix}$$

Verification: Check with $s = 0$, $t = 0$ (giving $(\frac{10}{3}, 0, -\frac{2}{3}, 0)$):

  • Equation 1: $\frac{10}{3} + 0 - (-\frac{2}{3}) + 0 = \frac{10}{3} + \frac{2}{3} = 4$ (True)
  • Equation 2: $2(\frac{10}{3}) + 0 + (-\frac{2}{3}) + 0 = \frac{20}{3} - \frac{2}{3} = 6$ (True)

Solution: The system has infinitely many solutions forming a 2-dimensional plane in 4-dimensional space, parameterized by free variables $s = x_2$ and $t = x_4$.

Key Properties and Rules

Properties of Row Operations

Each elementary row operation is reversible:

  • Swap $R_i \leftrightarrow R_j$ is undone by swapping them back
  • Scaling $R_i \to cR_i$ is undone by $R_i \to \frac{1}{c}R_i$
  • Replacement $R_i \to R_i + cR_j$ is undone by $R_i \to R_i - cR_j$

Because each operation is reversible, row-equivalent matrices represent equivalent systems with identical solution sets.

Uniqueness of RREF

Every matrix has exactly one RREF. Different sequences of row operations may take different paths, but they all arrive at the same destination. This makes RREF particularly useful for theoretical analysis.

Determining Solution Type from RREF

For a system with $n$ variables:

Number of Pivots Consistency Number of Free Variables Solutions
$n$ Consistent 0 Exactly one
$< n$ Consistent $n - \text{pivots}$ Infinitely many
Any Inconsistent (row $[0 \cdots 0 | b]$, $b \neq 0$) N/A None

The Rank of a Matrix

The number of pivots in the RREF of a matrix is called the rank of the matrix. The rank tells you:

  • For an $m \times n$ coefficient matrix: the number of “independent” equations
  • The number of basic variables in the solution
  • The dimension of the column space (a concept you will explore later)

Real-World Applications

Solving Traffic Flow Networks

City planners model traffic flow through intersections using systems of linear equations. At each intersection, the total flow in must equal the total flow out (conservation of flow). For a network with dozens of intersections, this creates a large system of equations.

Gaussian elimination reveals whether the traffic flow pattern is determined uniquely, or whether there are free variables representing flows that can be adjusted. These free variables correspond to routes where traffic can be redirected without affecting the overall pattern.

Balancing Chemical Equations Systematically

Consider balancing a complex chemical reaction like:

$$a\text{C}_2\text{H}_6 + b\text{O}_2 \to c\text{CO}_2 + d\text{H}_2\text{O}$$

Setting up conservation equations for each element:

  • Carbon: $2a = c$
  • Hydrogen: $6a = 2d$
  • Oxygen: $2b = 2c + d$

This is a homogeneous system (right-hand sides are zero when rearranged). Gaussian elimination finds that one variable is free, which is expected since we can multiply all coefficients by any constant. Setting $a = 1$ and solving gives the balanced equation.

For reactions with many compounds, hand-balancing becomes nearly impossible. Gaussian elimination provides a systematic approach that always works.

Finding Equilibrium in Economics

In economic models, markets reach equilibrium when supply equals demand across all goods. With multiple interconnected markets (where the price of one good affects demand for others), equilibrium is found by solving a system of linear equations.

The Leontief input-output model, which won Wassily Leontief the Nobel Prize in Economics, uses matrices to model entire economies. The question “how much should each industry produce to meet final demand?” translates directly to solving $A\vec{x} = \vec{b}$ using Gaussian elimination.

Computer Algorithms for Large Systems

Modern applications routinely involve systems with thousands or millions of equations. Computer implementations of Gaussian elimination (with numerical refinements to handle rounding errors) form the backbone of:

  • Finite element analysis in engineering (simulating stress, heat flow, fluid dynamics)
  • Machine learning (solving least-squares problems for regression)
  • Computer graphics (solving systems for lighting, physics simulations)
  • Cryptography and coding theory

The basic algorithm you learned in this lesson scales to these massive applications. Computers can perform billions of row operations per second, but the underlying logic is exactly what you have been doing by hand.

Self-Test Problems

Problem 1: Reduce $\left[\begin{array}{cc|c} 3 & 6 & 9 \ 1 & 4 & 7 \end{array}\right]$ to row echelon form.

Show Answer

Step 1: Swap rows to get a nicer pivot (optional but helpful):

$$\left[\begin{array}{cc|c} 3 & 6 & 9 \ 1 & 4 & 7 \end{array}\right] \xrightarrow{R_1 \leftrightarrow R_2} \left[\begin{array}{cc|c} 1 & 4 & 7 \ 3 & 6 & 9 \end{array}\right]$$

Step 2: Eliminate below the pivot:

$$\left[\begin{array}{cc|c} 1 & 4 & 7 \ 3 & 6 & 9 \end{array}\right] \xrightarrow{R_2 \to R_2 - 3R_1} \left[\begin{array}{cc|c} 1 & 4 & 7 \ 0 & -6 & -12 \end{array}\right]$$

This is in row echelon form. The pivots are 1 and $-6$.

Problem 2: Solve the system from Problem 1 using back-substitution.

Show Answer

From the REF $\left[\begin{array}{cc|c} 1 & 4 & 7 \ 0 & -6 & -12 \end{array}\right]$:

Row 2: $-6y = -12$, so $y = 2$

Row 1: $x + 4y = 7$, so $x + 8 = 7$, giving $x = -1$

Solution: $(x, y) = (-1, 2)$

Verification: $3(-1) + 6(2) = -3 + 12 = 9$ and $(-1) + 4(2) = -1 + 8 = 7$ (Both true)

Problem 3: Reduce to RREF: $\left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \ 0 & 2 & 4 & 8 \ 0 & 0 & 3 & 9 \end{array}\right]$

Show Answer

This matrix is already in REF. We need to scale and eliminate above pivots.

Step 1: Scale rows to make pivots equal to 1:

$R_2 \to \frac{1}{2}R_2$: $$\left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \ 0 & 1 & 2 & 4 \ 0 & 0 & 3 & 9 \end{array}\right]$$

$R_3 \to \frac{1}{3}R_3$: $$\left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \ 0 & 1 & 2 & 4 \ 0 & 0 & 1 & 3 \end{array}\right]$$

Step 2: Eliminate above the pivot in column 3:

$R_2 \to R_2 - 2R_3$: $$\left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \ 0 & 1 & 0 & -2 \ 0 & 0 & 1 & 3 \end{array}\right]$$

$R_1 \to R_1 - R_3$: $$\left[\begin{array}{ccc|c} 1 & 1 & 0 & 3 \ 0 & 1 & 0 & -2 \ 0 & 0 & 1 & 3 \end{array}\right]$$

Step 3: Eliminate above the pivot in column 2:

$R_1 \to R_1 - R_2$: $$\left[\begin{array}{ccc|c} 1 & 0 & 0 & 5 \ 0 & 1 & 0 & -2 \ 0 & 0 & 1 & 3 \end{array}\right]$$

RREF: $\left[\begin{array}{ccc|c} 1 & 0 & 0 & 5 \ 0 & 1 & 0 & -2 \ 0 & 0 & 1 & 3 \end{array}\right]$

Solution: $x = 5$, $y = -2$, $z = 3$

Problem 4: Determine if the system $x + y = 2$, $2x + 2y = 4$, $3x + 3y = 7$ is consistent.

Show Answer

Augmented matrix: $$\left[\begin{array}{cc|c} 1 & 1 & 2 \ 2 & 2 & 4 \ 3 & 3 & 7 \end{array}\right]$$

Row operations:

$R_2 \to R_2 - 2R_1$: $$\left[\begin{array}{cc|c} 1 & 1 & 2 \ 0 & 0 & 0 \ 3 & 3 & 7 \end{array}\right]$$

$R_3 \to R_3 - 3R_1$: $$\left[\begin{array}{cc|c} 1 & 1 & 2 \ 0 & 0 & 0 \ 0 & 0 & 1 \end{array}\right]$$

Analysis: The third row says $0 = 1$, which is impossible.

Conclusion: The system is inconsistent (no solution).

Note: The first two equations are consistent (the second is just twice the first), but the third equation contradicts them.

Problem 5: Solve and express in parametric form: $x + y - z = 1$, $2x + y + z = 4$.

Show Answer

Augmented matrix: $$\left[\begin{array}{ccc|c} 1 & 1 & -1 & 1 \ 2 & 1 & 1 & 4 \end{array}\right]$$

Row operations:

$R_2 \to R_2 - 2R_1$: $$\left[\begin{array}{ccc|c} 1 & 1 & -1 & 1 \ 0 & -1 & 3 & 2 \end{array}\right]$$

$R_2 \to -R_2$: $$\left[\begin{array}{ccc|c} 1 & 1 & -1 & 1 \ 0 & 1 & -3 & -2 \end{array}\right]$$

$R_1 \to R_1 - R_2$: $$\left[\begin{array}{ccc|c} 1 & 0 & 2 & 3 \ 0 & 1 & -3 & -2 \end{array}\right]$$

Identify variables: Pivots in columns 1 and 2, so $x$ and $y$ are basic. Column 3 has no pivot, so $z$ is free.

Express solution: Let $z = t$.

  • From row 1: $x + 2z = 3$, so $x = 3 - 2t$
  • From row 2: $y - 3z = -2$, so $y = -2 + 3t$

Parametric solution: $$\begin{pmatrix} x \ y \ z \end{pmatrix} = \begin{pmatrix} 3 - 2t \ -2 + 3t \ t \end{pmatrix} = \begin{pmatrix} 3 \ -2 \ 0 \end{pmatrix} + t\begin{pmatrix} -2 \ 3 \ 1 \end{pmatrix}$$

Problem 6: How many solutions does a consistent system have if the RREF of its augmented matrix has 4 pivots and there are 6 variables?

Show Answer

The system has infinitely many solutions.

Reasoning:

  • 6 variables total
  • 4 pivots means 4 basic variables
  • $6 - 4 = 2$ free variables

The solution set has 2 free parameters, so it forms a 2-dimensional plane in 6-dimensional space.

Problem 7: The RREF of a system is $\left[\begin{array}{cccc|c} 1 & 0 & 2 & 0 & 5 \ 0 & 1 & -1 & 0 & 3 \ 0 & 0 & 0 & 1 & -2 \end{array}\right]$. Write the general solution.

Show Answer

Identify variables:

  • Pivots in columns 1, 2, and 4: $x_1$, $x_2$, $x_4$ are basic
  • No pivot in column 3: $x_3$ is free

Read equations from RREF:

  • Row 1: $x_1 + 2x_3 = 5$, so $x_1 = 5 - 2x_3$
  • Row 2: $x_2 - x_3 = 3$, so $x_2 = 3 + x_3$
  • Row 3: $x_4 = -2$

Parametric solution: Let $x_3 = t$.

$$\begin{pmatrix} x_1 \ x_2 \ x_3 \ x_4 \end{pmatrix} = \begin{pmatrix} 5 - 2t \ 3 + t \ t \ -2 \end{pmatrix} = \begin{pmatrix} 5 \ 3 \ 0 \ -2 \end{pmatrix} + t\begin{pmatrix} -2 \ 1 \ 1 \ 0 \end{pmatrix}$$

Summary

  • Elementary row operations are the three building blocks of Gaussian elimination: row swaps, row scaling (by a nonzero constant), and row replacement (adding a multiple of one row to another). These operations preserve the solution set.

  • Row echelon form (REF) has a staircase pattern of pivots with zeros below each pivot. Systems in REF are solved using back-substitution.

  • Reduced row echelon form (RREF) additionally requires all pivots to be 1 and the only nonzero entry in their column. The solution reads directly from RREF.

  • Gaussian elimination is the algorithm that systematically applies row operations to transform any augmented matrix into REF (forward elimination) or RREF (Gauss-Jordan elimination).

  • A system is inconsistent (no solution) if elimination produces a row of the form $[0\ 0\ \cdots\ 0\ |\ b]$ where $b \neq 0$.

  • A consistent system has infinitely many solutions when there are more variables than pivots. Variables without pivots are free variables.

  • Parametric solutions express basic variables in terms of free variables (parameters). The number of free variables equals the dimension of the solution set.

  • Every matrix has a unique RREF, making it a standard form for analyzing systems.

  • Gaussian elimination is fundamental to modern computing, used in engineering simulations, machine learning, economics, and countless other applications where systems of equations arise.