Hotmath
Math Homework. Do It Faster, Learn It Better.

Matrix Row Operations

There are 3 basic operations used on the rows of a matrix when you are using the matrix to solve a system of linear equations . The goal is usually to get the left part of the matrix to look like the identity matrix .

The three operations are:

  • Switching Rows
  • Multiplying a Row by a Number
  • Adding Rows

Switching Rows

You can switch the rows of a matrix to get a new matrix.

[ 2 3 2 6 0 0 3 6 1 0 2 3 ] [ 1 0 2 3 2 3 2 6 0 0 3 6 ]

In the example shown above, we move Row 1 to Row 2 , Row 2 to Row 3 , and Row 3 to Row 1 . (The reason for doing this is to get a 1 in the top left corner.)

Multiplying a Row by a Number

You can multiply any row by a number. (This means multiplying every entry in the row by the same number.)

[ 1 0 2 3 2 3 2 6 0 0 3 6 ] R 3 : 1 3 R 3 [ 1 0 2 3 2 3 2 6 0 0 1 2 ]

In this example, we have multiplied Row 3 of the matrix by 1 3 . (This gives us the 1 we need in Row 3 , Column 3 .)

Adding Rows

You can also add two rows together, and replace a row with the result.

For example, in the matrix that resulted in the last example, we can add rows 2 and 3 together, entry by entry:

[ 2 3 2 6 ] + [ 0 0 1 2 ] _ [ 2 3 1 4 ]

Then, we replace Row 2 with the result.

[ 1 0 2 3 2 3 2 6 0 0 1 2 ] R 2 : R 2 + R 3 [ 1 0 2 3 2 3 1 4 0 0 1 2 ]

Adding Multiples of Rows

We said there were only three operations, and there are. But by using the last two operations in combination, we can add whole multiples of rows to other rows, to make things go faster.

Back up a step, so we have the matrix:

[ 1 0 2 3 2 3 2 6 0 0 1 2 ]

Now instead of just adding Row 2 + Row 3 , add Row 2 + ( 2 ×  Row  3 ) :

[ 2 3 2 6 ] + [ 0 0 2 4 ] _ [ 2 3 0 2 ]

Then replace Row 2 with the result.

[ 1 0 2 3 2 3 2 6 0 0 1 2 ] R 2 : R 2 + 2 R 3 [ 1 0 2 3 2 3 0 2 0 0 1 2 ]

This way, we get a 0 in Row 2 , Column 3 .

We can do this again to get a 0 in Row 2 , Column 1 . Here, we multiply Row 1 by 2 , add it Row 2 , and replace Row 2 with the result.

[ 1 0 2 3 2 3 0 2 0 0 1 2 ] R 2 : 2 R 1 + R 2 [ 1 0 2 3 0 3 4 8 0 0 1 2 ]

We'll show a few more steps, to get the 3 × 3 identity matrix on the left (and thus solve the system).

The next step is to add Row  2   + ( 4 ×  Row  3 ) to get a 0 in Row 2 , Column 3 .

[ 1 0 2 3 0 3 4 8 0 0 1 2 ] R 2 : R 2 + 4 R 3 [ 1 0 2 3 0 3 0 0 0 0 1 2 ]

Next, we need a zero in Row 1 , Column 3 .

[ 1 0 2 3 0 3 0 0 0 0 1 2 ] R 1 : R 1 2 R 3 [ 1 0 0 1 0 3 0 0 0 0 1 2 ]

The last step is just an application of the second operation, multiplying a row by a number.

[ 1 0 0 1 0 3 0 0 0 0 1 2 ] 1 3 R 3 [ 1 0 0 1 0 1 0 0 0 0 1 2 ]

We now have the solution as ordered triple ( 1 , 0 , 2 ) .

Important Note: If the equations represented by your original matrix represent identical or parallel lines, you will not be able to get the identity matrix using these row operations. In this case, the solution either does not exist or there are infinitely many solutions to the system.