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.

Advertisements

Methods To Find Inverse Of Matrix

The primary method of finding of inverse of matrix are

  1. Classical adjoint method
  2. Gauss-Jordan elimination method

Throughout this article, we will discuss about these two methods in detail.

Classical Adjoint 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.

\begin{aligned}
&A = \begin{bmatrix}a & b\\c & d\end{bmatrix}\\\\
&det(A) \hspace{5px} or  \hspace{5px}\begin{vmatrix}A\end{vmatrix} \hspace{5px} or  \hspace{5px}\begin{vmatrix}a & b\\c & d\end{vmatrix}\\\\
&det(A)= ad - bc
\end{aligned}

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.

\begin{aligned}
&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\\\\


\end{aligned}

You get following matrix of determinant.

= \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.

\begin{aligned}
&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
\end{aligned}

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.

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

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:

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

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

Step 2: There is no cofactor for 1×1 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

\begin{aligned}
&A^{-1} = 1/det(A) \times \begin{bmatrix}1\end{bmatrix}\\\\
&A^{-1} = 1/3 \times \begin{bmatrix}1\end{bmatrix}\\\\
&A^{-1} = 1/3
\end{aligned}

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

\begin{aligned}
&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
\end{aligned}

The minor matrix is,

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

\begin{aligned}
&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
\end{aligned}

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.

\begin{aligned}
&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}
\end{aligned}

To find the inverse of matrix B use following.

\begin{aligned}
&B^{-1} = 1/11 \times \begin{bmatrix}7 & -1\\-3 & 2\end{bmatrix}\\\\
&B^{-1} = \begin{bmatrix}7/11 & -1/11\\-3/11& 2/11\end{bmatrix}
\end{aligned}

Verify the inverse of matrix B.

\begin{aligned}
&BB^{-1} = B^{-1}B = I\\\\
&= \begin{bmatrix}2 & 1\\3 & 7\end{bmatrix} \times \begin{bmatrix}7/11 & -1/11\\-3/11& 2/11\end{bmatrix}\\\\
&= \begin{bmatrix}14/11 +  -3/11&  -2/11+ 2/11\\21/11 +  -21/11& -3/11+ 14/11\end{bmatrix}\\\\
&= \begin{bmatrix}11/11&0\\0&11/11\end{bmatrix}\\\\
&= \begin{bmatrix}1&0\\0&1\end{bmatrix}
\end{aligned}

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.

\begin{aligned}
&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
\end{aligned}

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.

\begin{aligned}
&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
\end{aligned}

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.

\begin{aligned}
&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}
\end{aligned}

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

\begin{aligned}
&A^{-1} = 1/det(A) \times Adj A\\\\
&A^{-1} = 1/43 \times \begin{bmatrix} 5 & 9 & -8\\-18& 2 & 3\\2 & -5 & 14\end{bmatrix}\\\\
&A^{-1} = \begin{bmatrix}5/43& 9/43&  -8/ 43\\-18/43& 2/43& 3/43\\2/43&  -5/43&14/43\end{bmatrix}
\end{aligned}

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

Verify results:

\begin{aligned}
&= \begin{bmatrix}1 & -2 & 1\\6 & 2 & 3\\2 & 1 & 4\end{bmatrix} \times \begin{bmatrix}5/43&9/ 43& -8/ 43\\-18/43& 2/43& 3/43\\2/43& -5/43&14/43\end{bmatrix}\\\\
& = \begin{bmatrix}5/43+ 36/43+2/43& 9/43 +( -4)/43 + (-5)/43& -8/43+ 6/43+14/43\\30/43+( -36)/43+ 6/43& 54/43+4/43+ (-15)/43& -48/43+6/43+42/43\\10/43+(-18)/43+ 8/43&18/43+2/43+ (-20)/43& -16/43+3/43+56/43\end{bmatrix}\\\\
& =\begin{bmatrix}1 & 0 & 0\\0 & 1 & 0\\1 & 0 & 0\end{bmatrix}
\end{aligned}

Finding Inverse of Matrix Using Gauss-Jordan Elimination Method

Advertisements

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 \hspace{5px} 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} \hspace{5px} (1)

Now, let us find EA matrix.

\begin{aligned}
&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}\hspace{5px} (2)
\end{aligned}

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

Inverse Operations

If matrix E is a result of row operation on identity matrix I, then there exists 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.

Elementary Row OperationInverse Operation
Multiply row i by c where c != 0Multiply row i by 1/c
Interchange row i with row jInterchange row j with row i
Add k times row i to row j Add -k times row i to row j
Inverse operations

Example #7 : Inverse Operations

Multiply row i by k = 3.

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

Multiply row i by 1/k where k = 3

\begin{aligned}
&1/3 \times R_1 = 1/3\times \begin{bmatrix}3 & 0\\0 & 1\end{bmatrix}\\\\
&I = \begin{bmatrix}1 & 0\\0 & 1\end{bmatrix}
\end{aligned}

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 = R_2/14

= \left(\begin{array}{ccc|ccc}1 & -2 & 1 & 1 & 0 & 0\\0 & 1 & -3/14 & -6/14 & 1/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 & -3/14 & -6/14 & 1/14& 0\\0 & 0 & 43/14&2/14& -5/14 & 1\end{array}\right)

Step 5: R_3 = R_3 \times 14/43

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

Step 6: R_2 = 3/14 R_3 + R_2

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

Step 7: R_1 = R_1 + 2R_2

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

Step 8: R1 = R_1 - R_3

(I|A^{-1})= \left(\begin{array}{ccc|ccc}1& 0 & 0 & 5/43 &9/43&-8/43\\0 & 1 & 0 & -18/43&2/43 &3/43\\0 & 0 & 1 & 2/43& -5/43 &14/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.

Advertisements

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.