How To Find Inverse Of A Matrix

In the previous article, you learned about inverse of matrix and why it is important. You will learn how to find inverse of a matrix in this article. There are two primary method of finding inverse of any square invertible matrix – Classical adjoint method and Gauss -Jordan elimination method.

Methods To Find Inverse Of Matrix

The primary method of finding of inverse of matrix are

2. Gauss-Jordan elimination method

If $A$ is an invertible matrix then we can find the inverse of matrix $A$ with the adjoint of matrix $A$.

But,before we begin you must understand a few terminologies.

Determinant – It is a special number obtained from a square matrix, non-square matrix do not have determinants. If $A$ is a square matrix then there is a number of ways to denote its determinant.

$A = \begin{bmatrix}a & b\\c & d\end{bmatrix}$

$det(A)$ or $\begin{vmatrix}A\end{vmatrix}$ or $\begin{vmatrix}a & b\\c & d\end{vmatrix}$

$det(A)= ad - bc$

Minor of a matrix – The minor of a square matrix is determinant obtained by deleting a row and a column from the determinant of a larger square matrix. It is denoted by $M_{ij}$ for element $a_{ij}$ where $i$ is the ithrow and $j$ is the jth column.

The determinant of 2 x 2 matrix

$det(A) =\begin{vmatrix}a & b\\c & d\end{vmatrix}$

$M_{11} = \begin{vmatrix}a & b\\c & d\end{vmatrix} = \begin{vmatrix}d\end{vmatrix}= d$

$M_{12} = \begin{vmatrix}a & b\\c & d\end{vmatrix} = \begin{vmatrix}c\end{vmatrix}= c$

$M_{21} = \begin{vmatrix}a & b\\c & d\end{vmatrix} = \begin{vmatrix}b\end{vmatrix}= b$

$M_{22} = \begin{vmatrix}a & b\\c & d\end{vmatrix} = \begin{vmatrix}a\end{vmatrix}= a$

You get following matrix of determinants

$= \begin{bmatrix}d & c\\b & a\end{bmatrix}$

Cofactor of a Matrix – The cofactor of a matrix can be found from determinant of minors by assigning appropriate negative or positive signs. Each cofactor $A_{ij}$ can be found by following equation.

$A_{ij}= (-1)^{i+j}M_{ij}$

$A_{11}= (-1)^2 \times det(d) = d$

$A_{12}= (-1)^3 \times det(c) = -c$

$A_{21}= (-1)^3 \times det(b) = -b$

$A_{22}= (-1)^4 \times det(a) = a$

The matrix of cofactors of A

$= \begin{bmatrix}d & -c\\-b & a\end{bmatrix}$

Adjoint of a Matrix – The adjoint of a matrix is obtained by transposing the co-factor matrix. It is denoted as $adj A = \left[A_{ij}\right]^T$.

$adj A = \left(A_{ij}\right)^T = \begin{bmatrix}d & -b\\-c & a\end{bmatrix}$

Finding Inverse Of Matrix Through Adjoint Method

The process of finding inverse of matrix using adjoint method is as follows.

1. Find the matrix of minors
2. Find the matrix of co-factors
3. Find the determinant det(A) by multiplying first row of matrix A with first row of co-factor matrix of A.
4. Find the adjoint matrix usign co-factor matrix of A.
5. Multiply 1/det(A) with adjoint of A (adj A) to get the inverse matrix of A.

We will find inverse of a matrix using the adjoint of matrix in the next section. First we must find the inverse of $1 \times 1$ matrix, then $2 \times 2$ and finally $3 \times 3$ matrix.

Example #1 : Find the inverse of $1 \times 1$ matrix using adjoint method.

$A = \begin{bmatrix}3\end{bmatrix}$

Solution:

Let $A$ be a matrix of order 1 x 1.

Step 1: There is no minor for 1x1 matrix.

Step 2: There is no cofactor for 1x1 matrix.

Step 3: The determinant of A  is $det(A) = 3$.(invertible)

Step 4: The adjoint of matrix A is $Adj A = \begin{bmatrix}1\end{bmatrix}$.

To compute the inverse of matrix A use

$A^{-1} = \frac{\strut 1}{\strut det(A)} \times \begin{bmatrix}1\end{bmatrix}$

$A^{-1} = \frac{\strut 1}{\strut 3} \times \begin{bmatrix}1\end{bmatrix}$

$A^{-1} = \frac{\strut 1}{\strut 3}$

Example #2 : Find the inverse of $2 \times 2$ matrix using adjoint method.

$B = \begin{bmatrix}2 & 1\\3 & 7\end{bmatrix}$

Solution:

Let $B$ be a square and invertible matrix of order $2 \times 2$.

Step 1: The minors of matrix $B$ are

$M_{11} = \begin{vmatrix}7\end{vmatrix}= 7$

$M_{12} = \begin{vmatrix}3\end{vmatrix}= 3$

$M_{21} = \begin{vmatrix}1\end{vmatrix}= 1$

$M_{22} = \begin{vmatrix}2\end{vmatrix}= 2$

The minor matrix is

$= \begin{bmatrix}7 & 3\\1 & 2\end{bmatrix}$

Step 2: The cofactor of matrix $B$ is obtained from minor matrix.

$B_{11} = (-1)^{1+1}M_{11} = 7$

$B_{12} = (-1)^{1+2}M_{12} = -3$

$B_{21} = (-1)^{2+1}M_{21} = -1$

$B_{22} = (-1)^{2+2}M_{22} = 2$

The cofactor matrix is

$= \begin{bmatrix}7 & -3\\-1 & 2\end{bmatrix}$

Step 3: To compute the determinant simply multiply corresponding elements of top row of matrix $B$ and tow row of cofactor of $B$ and add them.

Top row of matrix B = 2, 1
Top row of cofactor matrix = 7 -3

$det(B) = 2 \times 7 + 1 \times (-3) = 14 - 3 = 11$

Step 4: Find the adjoint of the matrix $B$ by transposing cofactor matrix.

$cofactor \hspace{1ex} of \hspace{1ex} B = \begin{bmatrix}7 & -3\\-1 & 2\end{bmatrix}$

$adj B = \begin{bmatrix}B_{ij}\end{bmatrix}^T$

$adj B = \begin{bmatrix}7 & -1\\-3 & 2\end{bmatrix}$

To find the inverse of matrix $B$ use following

$B^{-1} = \frac{\strut 1}{\strut 11} \times \begin{bmatrix}7 & -1\\-3 & 2\end{bmatrix}$

$B^{-1} = \begin{bmatrix}\frac{\strut 7}{\strut 11} & \frac{\strut -1}{\strut 11}\\\frac{\strut -3}{\strut 11} & \frac{\strut 2}{\strut 11}\end{bmatrix}$

Verify the inverse of matrix $B$

$BB^{-1} = B^{-1}B = I$

$= \begin{bmatrix}2 & 1\\3 & 7\end{bmatrix} \times \begin{bmatrix}\frac{\strut 7}{\strut 11} & \frac{\strut -1}{\strut 11}\\\frac{\strut -3}{\strut 11} & \frac{\strut 2}{\strut 11}\end{bmatrix}$

$= \begin{bmatrix}\frac{\strut 14}{\strut 11} + \frac{\strut -3}{\strut 11}& \frac{\strut -2}{\strut 11}+ \frac{\strut 2}{\strut 11}\\\frac{\strut 21}{\strut 11} + \frac{\strut -21}{\strut 11}& \frac{\strut -3}{\strut 11}+ \frac{\strut 14}{\strut 11}\end{bmatrix}$

$= \begin{bmatrix}\frac{\strut 11}{\strut 11}&0\\0&\frac{\strut 11}{\strut 11}\end{bmatrix}$

$= \begin{bmatrix}1&0\\0&1\end{bmatrix}$

Example #3 : Find the inverse of 3 x 3 matrix using the adjoint method.

$A = \begin{bmatrix}1 & -2 & 1\\6 & 2 & 3\\2 & 1 & 4\end{bmatrix}$

Solution :

Given the matrix $A$ of order $3 \times 3$.

$A = \begin{bmatrix}1 & -2 & 1\\6 & 2 & 3\\2 & 1 & 4\end{bmatrix}$.

Step 1: Find the minors of the matrix $A$.

$M_{11} = \begin{vmatrix}a_{22}.a_{33}-a_{23}.a_{32}\end{vmatrix} = \begin{vmatrix}8 - 3\end{vmatrix} = 5$

$M_{12} = \begin{vmatrix}a_{21}.a_{33}-a_{23}.a_{31}\end{vmatrix} = \begin{vmatrix}24 - 6 \end{vmatrix}= 18$

$M_{13} = \begin{vmatrix}a_{21}.a_{32}-a_{22}.a_{31}\end{vmatrix} = \begin{vmatrix}6 - 4\end{vmatrix} = 2$

$M_{21} = \begin{vmatrix}a_{12}.a_{33}-a_{13}.a_{32}\end{vmatrix} = \begin{vmatrix}-8 - 1\end{vmatrix} = -9$

$M_{22} = \begin{vmatrix}a_{11}.a_{33}-a_{13}.a_{31}\end{vmatrix} = \begin{vmatrix}4 - 2\end{vmatrix} = 2$

$M_{23} = \begin{vmatrix}a_{11}.a_{32}-a_{12}.a_{31}\end{vmatrix} = \begin{vmatrix}1 + 4 \end{vmatrix}= 5$

$M_{31} = \begin{vmatrix}a_{12}.a_{23}-a_{13}.a_{22}\end{vmatrix} = \begin{vmatrix}-6 - 2\end{vmatrix} = -8$

$M_{32} = \begin{vmatrix}a_{11}.a_{23}-a_{13}.a_{21}\end{vmatrix} = \begin{vmatrix}3 - 6\end{vmatrix} = -3$

$M_{33} = \begin{vmatrix}a_{11}.a_{22}-a_{12}.a_{21}\end{vmatrix} = \begin{vmatrix}2 + 12\end{vmatrix} = 14$

We have the following matrix of minors

$= \begin{bmatrix}5 & 18 & 2\\-9 & 2 & 5\\-8 & -3 & 14\end{bmatrix}$

Step 2: Find the cofactors of matrix $A$.

We can use the matrix of minors to find the matrix of cofactors.

$A_{11} = (-1)^2 . 5 = 5$
$A_{12} = (-1)^3 . 18 = -18$
$A_{13} = (-1)^4 . 2 = 2$

$A_{21} = (-1)^3 . -9 = 9$
$A_{22} = (-1)^4 . 2 = 2$
$A_{23} = (-1)^5 . 5 = -5$

$A_{31} = (-1)^4 . -8 = -8$
$A_{32} = (-1)^5 . -3 = 3$
$A_{33} = (-1)^4 . 14 = 14$

We get the cofactor matrix of $A$

$= \begin{bmatrix}5 & -18 & 2\\9 & 2 & -5\\-8 & 3 & 14\end{bmatrix}$

Step 3: Find determinant of the matrix $A$.

Top row of matrix A = 1, -2, 1
Top row of coactor of A = 5, -18, 2

$det(A) = (1)(5)+ (-2)(-18) + (1)(2) = 5 + 36 + 2 = 43$

Step 4: Find the adjoint of matrix $A$. The adjoint of the matrix can be obtained from transposing the cofactor matrix.

$Adj A = \begin{bmatrix}A_{ij}\end{bmatrix}^T = \begin{bmatrix} 5 & -18 & 2\\9 & 2 & -5\\-8 & 3 & 14\end{bmatrix}^T$

$Adj A = \begin{bmatrix} 5 & 9 & -8\\-18& 2 & 3\\2 & -5 & 14\end{bmatrix}$

Step 5: Find the inverse of matrix $A$ using following equation.

$A^{-1} = \frac{\strut 1}{\strut det(A)} \times Adj A$

$A^{-1} = \frac{\strut 1}{\strut 43} \times \begin{bmatrix} 5 & 9 & -8\\-18& 2 & 3\\2 & -5 & 14\end{bmatrix}$

$A^{-1} = \begin{bmatrix}\frac{\strut 5}{\strut 43}& \frac{\strut 9}{\strut 43}& \frac{\strut -8}{\strut 43}\\\frac{\strut -18}{\strut 43}& \frac{\strut 2}{\strut 43}& \frac{\strut 3}{\strut 43}\\\frac{\strut 2}{\strut 43}& \frac{\strut -5}{\strut 43}& \frac{\strut 14}{\strut 43}\end{bmatrix}$

Verify results:

Verify that $AA^{-1} = A^{-1}A = I$

$= \begin{bmatrix}1 & -2 & 1\\6 & 2 & 3\\2 & 1 & 4\end{bmatrix} \times \begin{bmatrix}\frac{\strut 5}{\strut 43}& \frac{\strut 9}{\strut 43}& \frac{\strut -8}{\strut 43}\\\frac{\strut -18}{\strut 43}& \frac{\strut 2}{\strut 43}& \frac{\strut 3}{\strut 43}\\\frac{\strut 2}{\strut 43}& \frac{\strut -5}{\strut 43}& \frac{\strut 14}{\strut 43}\end{bmatrix}$

$= \begin{bmatrix}\frac{\strut 5}{\strut 43}+ \frac{\strut 36}{\strut 43}+\frac{\strut 2}{\strut 43}& \frac{\strut 9}{\strut 43}+ \frac{\strut -4}{\strut 43}+ \frac{\strut -5}{\strut 43}& \frac{\strut -8}{\strut 43}+ \frac{\strut 6}{\strut 43}+\frac{\strut 14}{\strut 43}\\\frac{\strut 30}{\strut 43}+ \frac{\strut -36}{\strut 43}+ \frac{\strut 6}{\strut 43}& \frac{\strut 54}{\strut 43}+\frac{\strut 4}{\strut 43}+ \frac{\strut -15}{\strut 43}& \frac{\strut -48}{\strut 43}+\frac{\strut 6}{\strut 43}+\frac{\strut 42}{\strut 43}\\\frac{\strut 10}{\strut 43}+\frac{\strut -18}{\strut 43}+\frac{\strut 8}{\strut 43}& \frac{\strut 18}{\strut 43}+\frac{\strut 2}{\strut 43}+ \frac{\strut -20}{\strut 43}& \frac{\strut -16}{\strut 43}+\frac{\strut 3}{\strut 43}+\frac{\strut 56}{\strut 43}\end{bmatrix}$

$=\begin{bmatrix}1 & 0 & 0\\0 & 1 & 0\\1 & 0 & 0\end{bmatrix}$

Finding Inverse of Matrix Using Gauss-Jordan Elimination Method

The Gauss-Jordan elimination method convert a matrix into reduced-row echelon form to find the value of solution vector $x$ in $Ax = b$, but here we use the technique to find inverse matrix $A^{-1}$.

Row Operations

The Gauss-Jordan technique involves row operations on augmented matrix $A$ obtained from the system of linear equations that transforms the matrix into identity matrix $I_n$ where $n \times n$ is the order of matrix $A$.

These row operations are

• Multiply a row $i$ with scalar $c$ where $c \ne 0$.
• Interchange row $i$ with row $j$.
• Addition of $c$ times row $i$ to row $j$.

Example #5 : Row operations

Let $A$ be matrix of order $2 \times 2$.

$A = \begin{bmatrix}1 & 3\\2 & 1\end{bmatrix}$

Multiply a row 1 with 3.

$R_1 \times 3 = \begin{bmatrix}3 & 9\\2 & 1\end{bmatrix}$

Interchange row 2 with row 1.

$R_2 \Leftrightarrow R_1 = \begin{bmatrix}2 & 1\\3 & 9\end{bmatrix}$

Add 2 times row 1 to row 2.

$2R_1 + R_2 = \begin{bmatrix}2 & 1\\7 & 11\end{bmatrix}$

Elementary Matrix

An elementary matrix $E$ is a matrix obtained from performing a single row operation on identity matrix $I_n$.

Suppose A is a matrix of order $n \times n$, then the product $EA$ is same as performing that row operation on matrix $A$.

Example #6 : Elementary Matrix

Suppose $A$ is a matrix of order $3 \times 3$.

$A = \begin{bmatrix}1 & 5 & 8\\2 & 1 & 3\\0 & 1 & 6\end{bmatrix}$

Let $E$ be row operation $R_3 = 2R_1 + R3$ on $I$ of order $3 \times 3$.

Let $E = \begin{bmatrix}1 & 0 & 0\\0 & 1 & 0\\2 & 0 & 1\end{bmatrix}$

Let us perform $R_3 = 2R_1 + R3$ on $A$.

$= \begin{bmatrix}1 & 5 & 8\\2 & 1 & 3\\2 & 11 & 22\end{bmatrix}$ (1)

Now, let us find $EA$ matrix.

$EA = \begin{bmatrix}1 & 0 & 0\\0 & 1 & 0\\2 & 0 & 1\end{bmatrix} \times \begin{bmatrix}1 & 5 & 8\\2 & 1 & 3\\0 & 1 & 6\end{bmatrix}$

$EA = \begin{bmatrix}1+0+0 & 5+0+0 & 8+0+0\\0+2+0 & 0+1+0 & 0+3+0\\2+0+0 & 10+0+1 & 16+0+6\end{bmatrix}$

$EA = \begin{bmatrix}1 & 5 & 8\\2 & 1 & 3\\2 & 11 & 22\end{bmatrix}$ (2)

Therefore, (1) and (2) are same.

Inverse Operations

If matrix $E$ is a result of row operation on identity matrix $I$, then there exist some operation if performed on $E$ will give back $I$. Such an operation is called an Inverse operation.

For every elementary row operation, there is an equivalent inverse operation. Check the table below.

Example #7 : Inverse Operations

Multiply row $i$ by $k = 3$.

$E = k \times R_1 = 3 \times \begin{bmatrix}1 & 0\\0 & 1\end{bmatrix}$

$E = \begin{bmatrix}3 & 0\\0 & 1\end{bmatrix}$

Multiply row $i$ by $\frac{\strut 1}{\strut k}$ where $k = 3$

$\frac{\strut 1}{\strut 3} \times R_1 = \frac{\strut 1}{\strut 3}\times \begin{bmatrix}3 & 0\\0 & 1\end{bmatrix}$

$I = \begin{bmatrix}1 & 0\\0 & 1\end{bmatrix}$

From the above we can conclude that

1. Some operation on $I$ give the elementary matrix $E$.
2. The inverse of previous operation on E will give back $I$.
3. Inverse operation on $I$ will result in an inverse matrix $E^{-1}$ such that

$E.E^{-1} = E^{-1}.E = I$

Note that $E^{-1}$ is invertible matrix and has determinant greater than 0.

4 Necessary Statements For Gauss-Jordan technique and inverses

Before we find inverse of a matrix $A$ using Gauss-Jordan technique, there are 4 necessary prepositions that must be true about the matrix $A$ and its inverse.

If matrix $A$ is $n \times n$ square matrix these 4 statement must always be true.

• Matrix $A$ is invertible meaning the determinant is greater than 0 and does not have a zero row.
• $Ax = 0$ has only trivial solution.
• The matrix $A$ is reduced to reduced-row echelon form which is identity matrix $I_n$. This is because $Ax =0$ has trivial solution only, which means $Ax =b$ has one solution for every $b_{i}$.
$\begin{bmatrix}x_1& 0& 0& 0 & b_1\\0& x_2&0 & 0& b_2\\0 & 0& x_3 & 0 & b_3\\0& 0& 0 & x_n & b_n\end{bmatrix}$
• The matrix $A$ is product of elementary matrices.
Multiplying A with elementary matrices is same as performing row operations on A which will reduce the matrix to identity matrix $I$.

$E_1E_2 ... E_n A = I_n$

Similarly, each of the $E$ is invertible, a series of inverse operation on I will give back $A$.

$A = E^{-1}_1 . E^{-1}_2 ...E^{-1}_n$

also,

$A^{-1} = E_1.E_2 ... E_n.I$

Therefore, the matrix A\$ is product of elementary matrices.

Example #8: Find the inverse of following $3 \times 3$ matrix using Gauss-Jordan elimination method.

$(A|I) = \left(\begin{array}{ccc|ccc}1 & -2 & 1 & 1 & 0 & 0\\6 & 2 & 3 & 0 & 1 & 0\\2 & 1 & 4 & 0 & 0 & 1\end{array} \right)$

Solution:

Given the matrix $(A|I)$ we will find the inverse of matrix $A$ using the Gauss-Jordan elimination method.

$(A|I) = \left(\begin{array}{ccc|ccc}1 & -2 & 1 & 1 & 0 & 0\\6 & 2 & 3 & 0 & 1 & 0\\2 & 1 & 4 & 0 & 0 & 1\end{array} \right)$

Step 1: $R_3 = R_3 - 2R_1$

$= \left(\begin{array}{ccc|ccc}1 & -2 & 1 & 1 & 0 & 0\\6 & 2 & 3 & 0 & 1 & 0\\0 & 5 & 2 & -2 & 0 & 1\end{array} \right)$

Step 2: $R_2 = R_2 - 6R_1$

$= \left(\begin{array}{ccc|ccc}1 & -2 & 1 & 1 & 0 & 0\\0 & 14 & -3 & -6 & 1 & 0\\0 & 5 & 2 & -2 & 0 & 1\end{array}\right)$

Step 3: $R_2 = \frac{\strut R_2}{\strut 14}$

$= \left(\begin{array}{ccc|ccc}1 & -2 & 1 & 1 & 0 & 0\\0 & 1 & \frac{\strut -3}{\strut 14} & \frac{\strut -6}{\strut 14} & \frac{\strut 1}{\strut 14} & 0\\0 & 5 & 2 & -2 & 0 & 1\end{array}\right)$

Step 4: $R_3 = R_3 - 5R_2$

$= \left(\begin{array}{ccc|ccc}1 & -2 & 1 & 1 & 0 & 0\\0 & 1 & \frac{\strut -3}{\strut 14} & \frac{\strut -6}{\strut 14} & \frac{\strut 1}{\strut 14} & 0\\0 & 0 & \frac{\strut 43}{\strut 14} & \frac{\strut 2}{\strut 14} & \frac{\strut -5}{\strut 14} & 1\end{array}\right)$

Step 5: $R_3 = R_3 \times \frac{\strut 14}{\strut 43}$

$= \left(\begin{array}{ccc|ccc}1 & -2 & 1 & 1 & 0 & 0\\0 & 1 & \frac{\strut -3}{\strut 14} & \frac{\strut -6}{\strut 14} & \frac{\strut 1}{\strut 14} & 0\\0 & 0 & 1 & \frac{\strut 2}{\strut 43} & \frac{\strut -5}{\strut 43} & \frac{\strut 14}{\strut 43}\end{array}\right)$

Step 6: $R_2 = \frac{\strut 3}{\strut 14}R_3 + R_2$

$= \left(\begin{array}{ccc|ccc}1 & -2 & 1 & 1 & 0 & 0\\0 & 1 & 0 & \frac{\strut -18}{\strut 43} & \frac{\strut 2}{\strut 43} & \frac{\strut 3}{\strut 43}\\0 & 0 & 1 & \frac{\strut 2}{\strut 43} & \frac{\strut -5}{\strut 43} & \frac{\strut 14}{\strut 43}\end{array}\right)$

Step 7: $R_1 = R_1 + 2R_2$

$= \left(\begin{array}{ccc|ccc}1& 0 & 0 & \frac{\strut 7}{\strut 43} & \frac{\strut 4}{\strut 43}& \frac{\strut 6}{\strut 43}\\0 & 1 & 0 & \frac{\strut -18}{\strut 43} & \frac{\strut 2}{\strut 43} & \frac{\strut 3}{\strut 43}\\0 & 0 & 1 & \frac{\strut 2}{\strut 43} & \frac{\strut -5}{\strut 43} & \frac{\strut 14}{\strut 43}\end{array}\right)$

Step 8: $R1 = R_1 - R_3$

$(I|A^{-1})= \left(\begin{array}{ccc|ccc}1& 0 & 0 & \frac{\strut 5}{\strut 43} & \frac{\strut 9}{\strut 43}& \frac{\strut -8}{\strut 43}\\0 & 1 & 0 & \frac{\strut -18}{\strut 43} & \frac{\strut 2}{\strut 43} & \frac{\strut 3}{\strut 43}\\0 & 0 & 1 & \frac{\strut 2}{\strut 43} & \frac{\strut -5}{\strut 43} & \frac{\strut 14}{\strut 43}\end{array}\right)$

The matrix $A$ is reduced to an identity matrix and the identity matrix after Gauss-Jordan elimination method reduced to inverse matrix of $A^{-1}$.

The verification of resultant inverse matrix is left as an exercise for you.