Skip to content
Glacius
Linear algebraConcept reference

Row operations

An elementary row operation swaps rows, scales a row by a nonzero number or adds a multiple of a different row.

On this page 7 sections
  1. Overview
  2. Write coefficients and the right side together in an augmented row
  3. You may add a multiple of a different row to a target, leaving the source row unchanged
  4. Subtracting the same multiple reverses a row replacement
  5. Key takeaway
  6. Sources & further reading
  7. Concept connections

01Write coefficients and the right side together in an augmented row#

Write coefficients and the right side together in an augmented row. For x+2y=5x+2y=5, the row is (1,25)(1,2\mid5). A row operation changes whole equations while keeping the same solutions.

You may swap two rows or multiply a row by a nonzero number. Swapping can be undone by swapping again; scaling can be undone by dividing by that number.

Check your reasoning

New R1R_1 after R1R2R_1\leftrightarrow R_2. [102013]\left[\begin{array}{rr|r}1&0&2\\0&1&3\end{array}\right]

  1. A[012]\left[\begin{array}{rr|r}0&1&2\end{array}\right]
  2. B[013]\left[\begin{array}{rr|r}0&1&3\end{array}\right]
  3. C[102]\left[\begin{array}{rr|r}1&0&2\end{array}\right]
Show answer and explanation
[013]\left[\begin{array}{rr|r}0&1&3\end{array}\right]

Row 1 receives the entire old row 2.

02You may add a multiple of a different row to a target, leaving the source row unchanged#

You may add a multiple of a different row to a target, leaving the source row unchanged. Here R2R2+R1R_2\leftarrow R_2+R_1 gives (3+1,1+24+5)(3+1,1+2\mid4+5).

Before rows are [1, 2, 5] and [3, 1, 4]; the last entry of each row is the right-hand constant. Operation R₂ ← R₂ + R₁ leaves row 1 unchanged and replaces row 2 with [4, 3, 9]. Every entry, including the constant, is updated.Before rows are [1, 2, 5] and [3, 1, 4]; the last entry of each row is the right-hand constant. Operation R₂ ← R₂ + R₁ leaves row 1 unchanged and replaces row 2 with [4, 3, 9]. Every entry, including the constant, is updated.
Figure 1Before rows are [1, 2, 5] and [3, 1, 4]; the last entry of each row is the right-hand constant. Operation R₂ ← R₂ + R₁ leaves row 1 unchanged and replaces row 2 with [4, 3, 9]. Every entry, including the constant, is updated.
Link to this figure ↗Download SVGDownload PNG
Check your reasoning

Row R1R_1 is (2,13)(2,-1\mid3). Apply R12R1R_1\leftarrow -2R_1. New right side?

Show answer and explanation
-6

The constant also gets multiplied by −2.

03Subtracting the same multiple reverses a row replacement#

Subtracting the same multiple reverses a row replacement. Scaling by zero loses the original equation: x+y=3x+y=3 becomes 0=00=0. That move cannot preserve its constraint.

Check your reasoning

Rows are R1:x+y=4R_1: x+y=4; R2:2xy=2R_2: 2x-y=2. Apply R2R2+R1R_2\leftarrow R_2+R_1. New R2R_2?

  1. A3x=63x=6
  2. B3x=23x=2
  3. C2xy=22x-y=2
Show answer and explanation
3x=63x=6

Operate on both sides of the target equation.

Key takeaway

Operate on the whole row, including its right side. Keep the move reversible.

  • Apply one solution-preserving elementary row operation.

Sources & further reading

  1. [1]
  2. [2]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Row operations.” Math behind ML. /learn/la-row-operation