How to Invert a Matrix in a Gaussian Elimination
- 1). Write the original matrix and the identity matrix of the same size side-by-side with a vertical line dividing them to create an augmented matrix.
- 2). Switch rows so that the first row contains the largest number in the first column, if necessary.
- 3). Perform the row operations necessary to result in zeros on the left side of the matrix everywhere except along the diagonal. Gaussian elimination uses the elementary row operations of switching two rows, multiplying a row by a non-zero number, and adding a multiple of one row to another row.
For example, if the first column contains the numbers 2, 1 and 3, multiply each entry in the first row by -1/2 and add the results to the corresponding entries in the second row. Then multiply the first row by -3/2 and add the results to the corresponding entries in the third row. The first column now contains 2, 0 and 0. Use the same process to produce zeros in the first and third rows of the second column and in the top two rows of the third column. - 4). Multiply each row by the inverse of the non-zero diagonal entry to obtain ones along the diagonal of the first matrix. If the top left entry in the matrix is 2, for example, multiply the top row by 1/2.
- 5). Write the right half of the augmented matrix separately. This is the inverse of the original matrix.