
The previous article explained the different matrix operations and corresponding operations. This article will dive deep into two different methods on how to get the inverse matrix using elementary row operations and using determinants of the matrix.
Inverse Matrix
An inverse matrix is similar to the reciprocal of a number such that the multiplication of a number by its reciprocal gives 1 and the multiplication of a matrix by its inverse gives an identity matrix. However, to find the inverse of the matrix, the matrix must be a square matrix with the same number of rows and columns. There are two main methods to find the inverse of the matrix:
Method 1: Using elementary row operations
Recalled the 3 types of rows operation used to solve linear systems: swapping, rescaling, and pivoting. Those operations can be written in elementary matrices. And left multiplication with an augmented linear system matrix represents elementary row operations.

Swapping matrix: interchange row i and j of an identity matrix.

Rescaling matrix: if the operation is k times equation i, put the number k at the position (row=i, col=i) of an identity matrix.

Pivoting matrix: if a multiple of equation i is added to equation j, put the number k at the position (row=j, col=i) of an identity matrix.

We now can use the elementary matrices to find an inverse matrix.
- If A is invertible, then Eₖ…E₂E₁A = I
- Multiply both sides by A inverse yields:

- A sequence of elementary row operations can reduce A to I and the same sequence of elementary row operations turns I into the inverse of matrix A.
- If A is an invertible matrix, then for each column vector b, the system of equations, Ax = b has exactly one solution.

Example of finding the inverse of A using row operations:




Method 2: Using the determinant of the matrix
Determinant and inverse of a 2 x 2 Matrix
The determinant of a matrix, det(A) or |A|, is a useful value for a square matrix. For a 2 by 2 matrix A below, det(A) = ad – bc, and A is invertible if det(A) ≠ 0. For a 2 x 2 matrix, an inverse matrix is given by:

However, to calculate the determinant of matrix size bigger than 2 x 2, we need to get its minors and cofactors.
Minors and Cofactors
For a square matrix A, the minor of entry aᵢⱼ, Mᵢⱼ, is defined to be the determinant of the submatrix formed by deleting the ith row and jth column from matrix A and cofactor of entry aᵢⱼ, Cᵢⱼ, is as follows:


Cofactor Expansion to get the Determinant of a matrix
The determinant of a square matrix can be computed by multiplying entries in any row or columns by corresponding cofactors and adding the resulting products:

Finally, the inverse matrix can be calculated by multiplying the transpose of the cofactor matrix by 1/determinant.


Summary
The inverse matrix is a useful tool to solve various problems in linear algebra. One of the applications shown in this post is to solve the system of linear equations. In this post, you will learn how to get the inverse matrix step by step using 2 different methods, using elementary row operations and using determinants of the matrix.
Recommended Reading
Linear Algebra: Systems of Linear Equations and Matrices, with Python
Linear Algebra: Matrix Operations and their Properties, with Python
Linear Algebra: LU Decomposition, with Python
Linear Algebra: Euclidean Vector Space
Linear Algebra: Orthogonal Vectors
Linear Algebra: General Vector Space
Linear Algebra: Discovering Eigenvalues and Eigenvectors for Diagonalization
References
[1] Elementary matrix – Wikipedia






