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:
You can switch the rows of a matrix to get a new matrix.
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.)
You can multiply any row by a number. (This means multiplying every entry in the row by the same number.)
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.)
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:
Then, we replace Row 2 with the result.
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:
Now instead of just adding Row 2 + Row 3, add Row 2 + (2 × Row 3):
Then replace Row 2 with the result.
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.
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.
Next, we need a zero in Row 1, Column 3.
The last step is just an application of the second operation, multiplying a row by a number.
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.