Tutorials › Linear Algebra › Three Elementary Row Operations

Row Reduction and Echelon Forms · Tutorial 26 of 1000

Three Elementary Row Operations

Learn how to perform each elementary row operation on a matrix and how to check the result by undoing the operation.

Beginner 8 min read

What You'll Learn

  • Define row swaps, nonzero row scalings, and row replacements.
  • Identify which rows and entries change under each operation.
  • Apply row operations to coefficient matrices using exact arithmetic.
  • Apply the same operations to augmented matrices, including the constants column.
  • Check a row operation by applying its inverse.
  • Recognize and correct common errors involving augmented rows.

Why Row Operations Are Useful

A system of linear equations can be recorded in a matrix, so calculations on its rows provide a compact way to organize calculations on the equations. For a system with \(m\) equations and \(n\) unknowns, its coefficient matrix has \(m\) rows and \(n\) columns: each row contains the coefficients from one equation. The augmented matrix includes one additional column containing the right-hand-side constants. For example, the system \(x+2y=5\), \(3x-y=4\) has coefficient matrix \(\begin{bmatrix}1&2\\3&-1\end{bmatrix}\) and augmented matrix \(\begin{bmatrix}1&2&5\\3&-1&4\end{bmatrix}\).

An elementary row operation changes one or more rows according to a specific rule. When working with a coefficient matrix, the operation acts on its coefficient entries. When working with an augmented matrix, it acts on the entire selected row, including its right-hand-side entry. Keeping this distinction in view prevents a frequent error: treating the last column as though it were exempt from the operation.

Definition: The three elementary row operations on a matrix are: (1) row swap, which interchanges two rows, written \(R_i\leftrightarrow R_j\); (2) nonzero row scaling, which multiplies every entry of one row by a scalar \(c\ne0\), written \(R_i\to cR_i\); and (3) row replacement, which adds a scalar multiple of one row to a different row, written \(R_i\to R_i+cR_j\), where \(i\ne j\). Each operation applies to every entry in the selected row or rows.

The scalar field here is \(\mathbb{R}\), so the multiplier \(c\) may be any real number subject to the stated conditions. For a row replacement, \(c\) may be zero; in that case the row does not change. By contrast, a row scaling requires \(c\ne0\). The two row indices in a row replacement must be different: the operation uses row \(j\) to update row \(i\), leaving row \(j\) as it was.

Row Swaps

A row swap exchanges the complete contents of two rows. It can be useful when a desired row is not in the position where you need it. In an augmented matrix, the constant must move with its equation; swapping only the coefficients would mix up which constant belongs to which equation.

Worked Example: Swapping the Equations

Consider the system \(x+2y=5\), \(3x-y=4\). Its coefficient matrix and augmented matrix are

$$ \mathbf{A}=\begin{bmatrix}1&2\\3&-1\end{bmatrix}, \qquad \begin{bmatrix}1&2&5\\3&-1&4\end{bmatrix}. $$

Interchange rows 1 and 2. The coefficient matrix becomes

$$ \begin{bmatrix}1&2\\3&-1\end{bmatrix} \xrightarrow{R_1\leftrightarrow R_2} \begin{bmatrix}3&-1\\1&2\end{bmatrix}. $$

Applying the same swap to the augmented matrix exchanges the constants along with the coefficients:

$$ \begin{bmatrix}1&2&5\\3&-1&4\end{bmatrix} \xrightarrow{R_1\leftrightarrow R_2} \begin{bmatrix}3&-1&4\\1&2&5\end{bmatrix}. $$

Check: swapping the rows a second time returns \(\begin{bmatrix}1&2&5\\3&-1&4\end{bmatrix}\). In particular, the first row after the swap is \(3x-y=4\), so the constant \(4\) has stayed with its original equation.

Nonzero Row Scalings

To scale a row, multiply every entry in it by the same nonzero number. This includes a right-hand-side constant when the matrix is augmented. Scaling by a fraction is allowed, and it can make entries easier to work with. The requirement \(c\ne0\) matters: if \(c=0\), the original row is erased, and the operation cannot be undone by multiplying by a reciprocal.

Worked Example: Scaling an Augmented Row

For the system \(2x-y=3\), \(4x+3y=11\), the coefficient and augmented matrices are

$$ \mathbf{A}=\begin{bmatrix}2&-1\\4&3\end{bmatrix}, \qquad \begin{bmatrix}2&-1&3\\4&3&11\end{bmatrix}. $$

Scale row 1 by \(\tfrac12\). In the coefficient matrix this gives

$$ \begin{bmatrix}2&-1\\4&3\end{bmatrix} \xrightarrow{R_1\to \frac12R_1} \begin{bmatrix}1&-\frac12\\4&3\end{bmatrix}. $$

In the augmented matrix, each entry of row 1, including \(3\), is multiplied by \(\tfrac12\):

$$ \begin{bmatrix}2&-1&3\\4&3&11\end{bmatrix} \xrightarrow{R_1\to \frac12R_1} \begin{bmatrix}1&-\frac12&\frac32\\4&3&11\end{bmatrix}. $$

Check: scale the new first row by \(2\). Its entries become \(2\), \(-1\), and \(3\), recovering the original first row. The inverse operation therefore returns the original augmented matrix exactly.

Row Replacements

In a row replacement, a multiple of one row is added to a different row. The source row remains unchanged, while every entry of the target row is updated. The same addition must be carried out across the whole row. Choosing the multiplier appropriately can produce a zero in a coefficient position, but the operation itself is defined whether or not it produces a zero.

Worked Example: Adding a Multiple of One Row to Another

Take the three equations \(x-y=2\), \(2x+y=5\), and \(-3x+4y=1\). Their coefficient matrix and augmented matrix are

$$ \mathbf{A}=\begin{bmatrix}1&-1\\2&1\\-3&4\end{bmatrix}, \qquad \begin{bmatrix}1&-1&2\\2&1&5\\-3&4&1\end{bmatrix}. $$

Apply \(R_3\to R_3+2R_1\). For the coefficient matrix, row 3 changes entry by entry: \(-3+2(1)=-1\) and \(4+2(-1)=2\). Thus

$$ \begin{bmatrix}1&-1\\2&1\\-3&4\end{bmatrix} \xrightarrow{R_3\to R_3+2R_1} \begin{bmatrix}1&-1\\2&1\\-1&2\end{bmatrix}. $$

For the augmented matrix, the same calculation also updates the constant in row 3: \(1+2(2)=5\). The result is

$$ \begin{bmatrix}1&-1&2\\2&1&5\\-3&4&1\end{bmatrix} \xrightarrow{R_3\to R_3+2R_1} \begin{bmatrix}1&-1&2\\2&1&5\\-1&2&5\end{bmatrix}. $$

Check: subtract twice the unchanged row 1 from the new row 3: \((-1,2,5)-2(1,-1,2)=(-3,4,1)\). This recovers the original third row, including its constant.

Reversing Each Operation

Undoing a row operation provides a direct way to check the arithmetic. A swap undoes itself. A nonzero scaling by \(c\) is undone by scaling by \(1/c\). A replacement \(R_i\to R_i+cR_j\) is undone by \(R_i\to R_i-cR_j\), because row \(j\) was not changed. These inverse operations act on coefficient and augmented matrices in the same way as the original operations.

Theorem: Each elementary row operation has an elementary row operation that reverses it. Consequently, applying an elementary row operation and then its stated inverse returns the original matrix.

Proof. Let the original matrix be any matrix with the rows involved in the operation. If the operation is a swap \(R_i\leftrightarrow R_j\), swapping \(R_i\) and \(R_j\) again restores both rows to their original positions, and all other rows were unchanged. If the operation is a scaling \(R_i\to cR_i\), its hypothesis gives \(c\ne0\); scaling that row by \(1/c\) gives \((1/c)(cR_i)=R_i\), and leaves every other row unchanged. If the operation is a replacement \(R_i\to R_i+cR_j\) with \(i\ne j\), row \(j\) is unchanged. Replacing the updated row by \(R_i-cR_j\) therefore gives \((R_i+cR_j)-cR_j=R_i\), while all other rows remain unchanged. These cases cover all three operations and prove the claim. \(\square\)

This result gives a simple checking procedure for a sequence of row operations. Record each operation, then undo them in reverse order: reverse the last operation first, and continue until the first. If the original matrix is recovered, the sequence passes this arithmetic check. This checks that the matrix calculations were performed and recorded consistently; deciding what a row operation implies about a system’s solutions is a separate question.

Common Pitfalls

Leaving the constant unchanged when scaling an augmented row. In the scaling example, a mistaken calculation might change the first row of the augmented matrix from \((2,-1,3)\) to \((1,-\tfrac12,3)\), multiplying the coefficients by \(\tfrac12\) but leaving the constant at \(3\). That is not the result of \(R_1\to \tfrac12R_1\). The corrected row is \((1,-\tfrac12,\tfrac32)\), since \(\tfrac12(2,-1,3)=(1,-\tfrac12,\tfrac32)\).

Updating the source row during a replacement. In \(R_3\to R_3+2R_1\), row 1 is the source and must remain as it was. If a calculation changes row 1 as well, it has performed a different operation. The replacement example can be checked by confirming that the first two rows are unchanged and that subtracting twice row 1 from the new row 3 recovers the original row 3.

Scaling by zero is not an allowed row scaling. The expression \(R_i\to0R_i\) replaces row \(i\) by a zero row, and no scaling can recover the original nonzero row from it. This is why the definition requires a nonzero multiplier. Row replacement, in contrast, allows any real multiplier; when that multiplier is zero, the target row is simply unchanged.

A Reliable Calculation Routine

Before carrying out a row operation, identify the target row and, when needed, the source row. Then apply the operation to every entry in the target row; for an augmented matrix, include the right-hand-side column. Finally, check the result using the inverse operation. Keeping these steps separate makes it easier to locate an arithmetic error and makes the written row-operation notation an accurate record of the calculation.

1
Name the operation.
For example, specify \(R_3\to R_3+2R_1\), not merely “combine rows.”
2
Compute every target entry.
For a replacement, add the stated multiple of the source entry to each target entry, including the constant if the matrix is augmented.
3
Leave other rows unchanged.
A swap changes the two named rows; a scaling changes one; a replacement changes its target row only.
4
Reverse the operation to check.
Use the same swap, reciprocal scaling, or opposite replacement multiplier and confirm that the original row or rows return.

Check Your Understanding

For each question, write the row operation explicitly and check the resulting rows.

  1. Apply \(R_1\leftrightarrow R_2\) to \(\begin{bmatrix}1&3&7\\2&-1&4\end{bmatrix}\). What operation returns the original matrix?
  2. Apply \(R_2\to -\tfrac12R_2\) to \(\begin{bmatrix}2&1&5\\4&-6&8\end{bmatrix}\). Include the constant column.
  3. Apply \(R_3\to R_3-3R_1\) to \(\begin{bmatrix}1&2&4\\0&1&3\\5&-1&2\end{bmatrix}\), then verify by reversing the replacement.
  4. Why is \(R_1\to 0R_1\) not one of the permitted nonzero row scalings?
  5. A student scales the coefficient entries of an augmented row by \(2\) but leaves its constant unchanged. Explain what is wrong and state the correct rule.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon