# Solving System Of Linear Equations Using Cramer’s Rule

Cramer’s rule is a method of solving the system of linear equations using determinants. It is named after Gabriel Cramer (1704–1752) who discovered this method. In this article we are going to discuss and work few examples for solving system of linear equations using Cramer’s rule.

Before you start reading about Cramer’s rule, learn to compute determinant of 2 x 2 and 3 x 3 matrix as a prerequisite to this article : Finding Determinants Using Cross Multiplication.

Coefficient Matrix and Augmented Matrix

Given a system of equation you can derive a coefficient matrix and an augmented matrix from it. Both are the same thing with little different.

Suppose you are given a system of linear equations with 2 unknowns.

$a_{11}x + a_{12}y = b_1$

$a_{21}x + a_{22}y = b_2$

The augmented matrix and coefficient matrix would look like the following.

The system of linear equation is in the form of $Ax = b$ which is written as

$Ax = b$

$\begin{bmatrix}a_{11} & a_{12}\\a_{21} & a_{22}\end{bmatrix} . \begin{bmatrix}x \\ y\end{bmatrix} = \begin{bmatrix}b_1 \\ b_2\end{bmatrix}$

The matrix $A$ is coefficient matrix, $x$ is a column vector of unknowns, and $b$ represents the constant vector.

Determinant Of 2 x 2 Matrix

The determinant of a 2 x 2 matrix can be calculated using cross multiplication.

$A = \begin{bmatrix}a_{11} & a_{12}\\a_{21} & a_{22}\end{bmatrix}$

$|A| = \begin{vmatrix}a_{11} & a_{12}\\a_{21} & a_{22}\end{vmatrix} = a_{11}a_{22} - a{12}.a_{21}$

Example #1

Find the determinant of $A = \begin{bmatrix}2 & 1\\3 & 7\end{bmatrix}$.

Solution:

$|A|= \begin{vmatrix}2 & 1\\3 & 7\end{vmatrix} = 14 - 3 = 11$

### Solving System of Equations with 2 Unknowns With Cramer’s Rule

Given a system of equations with 2 unknowns you can solve it using Cramer’s rule by following steps.

1. Find the augmented matrix and the coefficient matrix for the system of equations.
2. Find the determinant of $D$ of matrix $A$.
3. Replace the $x$ coefficients of coefficient matrix $A$ with constant vector $b$ to get x-matrix and find its determinant $D_x$
4. Replace the $y$ coefficients of coefficient matrix $A$ with constant vector $b$ to get y-matrix and find its determinant $D_y$
5. Find the solution to system of linear equation according to following equations.
$x = \frac{\strut D_x}{\strut D}$

$y = \frac{\strut D_y}{\strut D}$

See the following figure to understand how the matrices look like.

Given a system of equations such as shown above, first derive the augmented matrix and coefficient matrix. The coefficient matrix has no constant vector. Use the coefficient matrix to get the determinant of matrix $A$ which is $D$.

X Matrix And Y Matrix

You can get x matrix by replacing the first column which is x column by the constant vector. See the image below.

Similarly, compute the y matrix from coefficient matrix of $A$. Compute the determinant of x matrix which is $D_x$ and compute the determinant of y matrix which is $D_y$.

To find the solution to each unknowns use the following formula, mentioned earlier.

Solution for x

$x = \frac{\strut D_x}{\strut D}$

Solution for y

$y = \frac{\strut D_y}{\strut D}$

In the next section, we will solve a system of linear equation with two unknown.

Example #1

Find the solution to following system of linear equations with two unknowns using Cramer’s rule.

$x + 3y = 5$.

$5x - 2y = 8$.

Solution:

Given the system of linear equations we can obtain augmented matrix and coefficient matrix.

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

The coefficient matrix must be a square matrix, so lets write the augmented matrix in the form $Ax = b$ in that order.

$Ax = b$

$\begin{bmatrix}1& 3\\5 & -2\end{bmatrix} . \begin{bmatrix}x & y\end{bmatrix} = \begin{bmatrix}5 & 8\end{bmatrix}$

Compute the determinant of the matrix $A$

$D = \begin{vmatrix}1& 3\\5 & -2\end{vmatrix} = -2 - 15 = -17$

Compute the determinant of the $x$ matrix.

$D_x = \begin{vmatrix}5 & 3\\8 & -2\end{vmatrix} = -10 - 24 = -34$

Compute the determinant of the $y$ matrix.

$D_y = \begin{vmatrix}1& 5\\5 & 8\end{vmatrix} = 8 - 25 = -17$

Therefore,

$x = \frac{\strut -34}{\strut -17} = 2$

$y = \frac{\strut -17}{\strut -17} = 1$

We can verify the solution by substitution.

$(2) + 3(1) = 5$

$5(2) - 2(1) = 8$

The solutions to the system of linear equations are correct.

### Solving System Of Equations With 3 Unknowns Using Cramer’s Rule

We can solve the system of equations with 3 unknowns which gives a $3 \times 3$ square matrix using the Cramer’s rule.

Though we need to compute the determinant of additional sub-matrices because there is one more unknown other than x and y. Let us call it z.

The steps remain the same as we solved for $2 \times 2$ matrix. Here is the list of steps.

Let $A$ be a $3 \times 3$ matrix.

Step 1: Compute determinant $D$ of $A$.

Step 2: You must extract sub-matrices or minors from the matrix $A$ and take determinant

So far you have learnt that square matrix has determinant value and larger the square matrix more difficult it is to compute the determinant through cross multiplication method. The larger matrix is usually broken down into smaller matrix and determinant or minors are calculated. Then assigning signs to these minors will give you cofactors to computer the determinant of the original matrix. Here we will discuss about computing adjoint of square matrix using cofactors.

The adjugate of a square matrix is also called adjoint matrix which is obtained from matrix of cofactors. To learn about cofactors visit : Cofactors of square matrix.

Suppose $A$ is a square matrix , and $\begin{bmatrix}A_{ij}\end{bmatrix}$ is its cofactor matrix. Then the adjoint of the matrix $A$ can be obtained by transposing the cofactor matrix $\begin{bmatrix}A_{ij}\end{bmatrix}$.

Let $A$ be a matrix of size $n \times n$,and $\begin{bmatrix}A_{ij}\end{bmatrix}$ is the cofactor matrix of $A$.

The adjoint of the matrix $A$ is denoted as $Adj A$.

$Adj A= \begin{bmatrix}A_{ij}\end{bmatrix}^T$

Steps to find Adjoint of a Square Matrix

The steps to find the adjoint of a square matrix is easy as most of the steps you have learned in previous articles already. Here are the steps.

1. Check if the given matrix $A$ is a $n \times n$ square matrix.
2. Find the minors of the matrix $A$ and arrange them in a matrix form according to subscript value.
3. Find the cofactors of matrix $A$ from the given minor matrix and arrange in matrix form according to subscript of each cofactor.
4. Transpose the cofactor matrix to obtain the adjoint of matrix $A$

Example #1

Find the adjoint of matrix $A$.

$A = \begin{bmatrix}2 & 1 & 3\\1 & 5 & 2\\4 & 7 & 3\end{bmatrix}$.

Solution:

We will find solution to this matrix in a step-by-step manner.

Step1: The given matrix $A$ is a $3 \times 3$ square matrix.

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

Step2: We must find the matrix of minors for $A$

$M_{11} = \begin{vmatrix}5 & 2\\7 & 3\end{vmatrix} = 15-14 = 1$

$M_{12} = \begin{vmatrix}1 & 2\\4 & 3\end{vmatrix} = 3-8 = -5$

$M_{13} = \begin{vmatrix}1 & 5\\4 & 7\end{vmatrix} = 7-20 = -13$

$M_{21} = \begin{vmatrix}1 & 3\\7 & 3\end{vmatrix} = 3-21 = -18$

$M_{22} = \begin{vmatrix}2 & 3\\4 & 3\end{vmatrix} = 6-12 = -6$

$M_{23} = \begin{vmatrix}2 & 1\\4 & 7\end{vmatrix} = 14-4 = 10$

$M_{31} = \begin{vmatrix}1 & 3\\5 & 2\end{vmatrix} = 2-15 = -13$

$M_{32} = \begin{vmatrix}2 & 3\\1 & 2\end{vmatrix} = 4-3 = 1$

$M_{33} = \begin{vmatrix}2 & 1\\1 & 5\end{vmatrix} = 10-1 = 9$

$= \begin{bmatrix}1 & -5 & -13\\-18 & -6 & 10\\-13 & 1 & 9\end{bmatrix}$

Step3: Given the matrix of minors we can quickly find the cofactor matrix by shortcut method. Assign negative or positive sign to minors based on following pattern.

$= \begin{bmatrix}+ & - & +\\- & + & -\\+ & - & +\end{bmatrix}$

Then we get,

$= \begin{bmatrix}(+)1 & (-)-5 & (+)-13\\(-)-18 & (+)-6 & (-)10\\(+)-13 & (-)1 & (+)9\end{bmatrix}$

$\begin{bmatrix}A_{ij}\end{bmatrix} = \begin{bmatrix}1 & 5 & -13\\18 & -6 & -10\\-13 & -1 & 9\end{bmatrix}$

Step4: Finally, transpose the cofactor matrix to get the adjoint of matrix $A$

$Adj A = \begin{bmatrix}A_{ij}\end{bmatrix}^T = \begin{bmatrix}1 & 5 & -13\\18 & -6 & -10\\-13 & -1 & 9\end{bmatrix}^T$

$Adj A = \begin{bmatrix}1 & 18 & -13\\5 & -6 & -1\\-13 & -10 & 9\end{bmatrix}$

The adjoint matrix can also be used to find the inverse of a matrix. The only condition is that the determinant must not be zero. If the determinant of a square matrix is nonzero, then the following will give inverse matrix of a matrix $A$

$A^{-1} = \frac{1}{|A|}\times Adj A$

In the previous example, we computed the adjoint matrix of A which is

$Adj A = \begin{bmatrix}1 & 18 & -13\\5 & -6 & -1\\-13 & -10 & 9\end{bmatrix}$

Let us find the determinant of the matrix by multiplying first row of matrix A and first row of cofact matrix of A.

Row 1 of A = 2 1 3
Row 1 of Cofactor of A = 1 5 -13

Therefore,the deterinant of matrix A is

$|A| = 2(1) + 1(5) + 3 (-13) = 2 + 5 -39 = -32$

We can compute the inverse of matrix $A$ using determinant and the adjoint matrix.

$A^{-1} = \frac{1}{-32} \times \begin{bmatrix}1 & 18 & -13\\5 & -6 & -1\\-13 & -10 & 9\end{bmatrix}$

$A^{-1} = \begin{bmatrix}\frac{\strut -1}{\strut 32} & \frac{\strut -9}{\strut 16} & \frac{\strut 13}{\strut 32}\\\frac{\strut -5}{\strut 32}& \frac{\strut 3}{\strut 16} & \frac{\strut 1}{\strut 32}\\\frac{\strut 13}{\strut 32} & \frac{\strut 5}{\strut 16} & \frac{\strut -9}{\strut 32}\end{bmatrix}$

Readers must check the correctness of the inverse as an exercise.

In the next article, we will discuss about how to find the solution to a system of linear equations using determinant method popularly known as Cramer’s rule.

# Cofactors of Matrix

Previous article, you learned about minors of a square matrix which are determinant of smaller 2 x 2 matrix obtained by excluding row and column of a selected element from the original matrix. These minors are arranged in matrix form called matrix of minors.

However, matrix of minors is not useful in finding the adjoint as well as determinant of the original matrix. To make this point clear , let $A$ be a square matrix and its matrix of minors is $\begin{bmatrix}M_{ij}\end{bmatrix}$ which is useless unless we find cofactor matrix that assignes positive or negative signs to each minor.

The other way to look at assigning positive or negative sign is basically process of finding the odd or even class for each minor element. To know more about odd and even class read: Introduction to determinants.

### How To Find Cofactor Of A Square Matrix

There are two ways to find the cofactors of a given matrix – the easy way and the hard way. Let us look at the hard way first and then move on to the easy way.

Hard Way To Find Cofactors

The steps to find the cofactor of a square matrix is

1. Given a square matrix of size $n \times n$, find the matrix of minors for $A$.
2. From the matrix of minors for $A$ find all cofactors using the following formula.
Suppose $a_{ij} \in A$, then its minor is $M_{ij}$
The cofactor of $a_{ij}$ is given by formula.

$A_{ij} = (-1)^{i + j}.M_{ij}$
1. Arrange all the cofactors in matrix form according to their subscript value.

Example #1

Find the cofactors of square matrix $A$ of order $3 \times 3$.

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

Solution:

Given the matrix $A$ of order $3 \times 3$, let us find all the minors.

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

Minors are as follows.

$M_{11} = 18 - 14 = 4$

$M_{12} = 6 - 28 = -22$

$M_{13} = 2 - 12 = -10$

$M_{21} = 30 - 2 = 28$

$M_{22} = 12 - 4 = 8$

$M_{23} = 4 - 20 = -16$

$M_{31} = 35 - 3 = 32$

$M_{32} = 14 - 1 = 13$

$M_{33} = 6 - 5 = 1$

We can arrange the minor in matrix form

$= \begin{bmatrix}4 & -22 & -10\\28 & 8 & -1\\32 & 12 & 1\end{bmatrix}$

Compute the cofactors from minors

$A_{11} = (-1)^{1+1}.M_{11} = (1)(4)= 4$

$A_{12} = (-1)^{1+2}.M_{12} = (-1)(-22)= 22$

$A_{13} = (-1)^{1+3}.M_{13} = (1)(-10)= -10$

$A_{21} = (-1)^{2+1}.M_{21} = (-1)(28)= -28$

$A_{22} = (-1)^{2+2}.M_{22} = (1)(8)= 8$

$A_{23} = (-1)^{2+3}.M_{23} = (-1)(-16)= 16$

$A_{31} = (-1)^{3+1}.M_{31} = (1)(32)= 32$

$A_{32} = (-1)^{3+2}.M_{32} = (-1)(13)= -13$

$A_{33} = (-1)^{3+3}.M_{33} = (1)(1)= 1$

The matrix of cofactors is

$\begin{bmatrix}4 & 22 & -10\\-28 & 8 & 16\\32 & -13 & 1\end{bmatrix}$

Easy Way To Find Cofactors

The easy way to find cofactor is to simply assign + or – based on the position of the minors in the matrix of minors. Each position is known to have a sign depending on $i$ and $j$ value.

$= \begin{bmatrix}+ & - & +\\- & + & -\\+ & - & +\end{bmatrix}$

Next use the sign matrix as reference change the sign for each minor.

$= \begin{bmatrix}4 & -22 & -10\\28 & 8 & -1\\32 & 12 & 1\end{bmatrix}$

will be

$= \begin{bmatrix}(+)4 & (-)-22 & (+)-10\\(-)28 & (+)8 & (-)-16\\(+)32 & (-)12 & (+)1\end{bmatrix}$

and finally gives you cofactor matrix.

$=\begin{bmatrix}4 & 22 & -10\\-28 & 8 & 16\\32 & -12 & 1\end{bmatrix}$


### Finding The Determinant Of Matrix Using Cofactor

Finding the determinant of a matrix is easy when you have the cofactor matrix. There are only 3 steps.

1. Pick a row or a column from original matrix $A$
2. Pick the corresponding row or column from cofactor matrix of $A$
3. Multiply corresponding terms and add them together to get the single determinant value.

Example #2

Find the determinant of the following matrix $A$ whose cofactor matrix is given.

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

$\begin{bmatrix}A_{ij}\end{bmatrix} =\begin{bmatrix}4 & 22 & -10\\-28 & 8 & 16\\32 & -12 & 1\end{bmatrix}$

Solution:

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

$\begin{bmatrix}A_{ij}\end{bmatrix} =\begin{bmatrix}4 & 22 & -10\\-28 & 8 & 16\\32 & -12 & 1\end{bmatrix}$

Let us choose row 1 from both matrix A and cofactor matrix and multiply each corresponding element.

$= 2(4) + 5(22) + 1(-10)$

a_{11}a_{22}a_{33}+a_{11}a_{23}a_{32}+a_{12}a_{21}a_{33}+a_{12}a_{23}a_{31}a_{13}a_{21}a_{32}+a_{13}a_{22}a_{31}&s=1$We must look at the permutation and change the sign of terms that belong to odd class meaning permutations that have odd number of inversions. $= a_{11}a_{22}a_{33}-a_{11}a_{23}a_{32}-a_{12}a_{21}a_{33}+a_{12}a_{23}a_{31}a_{13}a_{21}a_{32}-a_{13}a_{22}a_{31}$ This is a faster method of finding determinants, but you must be careful in checking the number of inversions. Next article, we shall discuss about finding determinants by cross multiplications and some interesting properties of determinants. # Linear Algebra What is linear algebra? Graphically speaking, linear algebra deals with lines and their transformations. In short, linear algebra is linear transformation represented using vectors of numbers and matrices of two dimensional numbers. We solve linear equations with unknown variables associated with each term of the linear equations. For example, ax + by = c (linear equation) Each term has unknowns (x, y) and coefficient (a, b) and equals a constant (c). Also, geometrically, each linear equation represents a straight line, hence, the name ‘linear’. Imagine a few lines intersecting each other , then we could find the coordinates of intersections and we have a solution to the linear equations involved. Such equations form a system of linear equations which can solved using vectors and matrices. it is usually in the form of Ax = b. ### Prerequisite To Learn Linear Algebra The only prerequisite to learn linear algebra is basic algebra course and understanding of coordinate systems. This is because during our course we will have to apply concepts like exponents, solving equations by adding subtracting, multiplying with fractions,and so on. If you know some programming, then its good idea to practice programming by creating programs for solution to linear equations. That’s totally up to you. ### Topics From Linear Algebra Here are the list of topics from linear algebra. You should read sequentially from top to bottom. #### Introduction #### Matrix Algebra #### Determinants more topics coming soon … # Inverses Of Triangular Matrices Triangular matrices are diagonal matrix plus some elements on the upper side or lower side of the main diagonal. Here we discuss about types, interesting properties of triangular matrix. Later we will find ways to determine the invertibility and how to find inverse of a triangular matrix with examples. ### What Are Triangular Matrices ? If a square matrix has all zeros below its main diagonal entries then it is called upper triangular matrix and if the square matrix has all zeros above the main diagonal entries then it is called lower triangular matrix. Therefore, a triangular matrix has either all zero entries above or below main diagonal. Examples of Upper Triangular Matrix $A = \begin{bmatrix}a_{11} & a_{12}\\0 & a_{22}\end{bmatrix}$ $B = \begin{bmatrix}a_{11} & a_{12}& a_{13}\\0 & a_{22}& a_{23}\\0 & 0 & a_{33}\end{bmatrix}$ $C = \begin{bmatrix}2 & 1 & 9 & 3\\0 & -1 & 8 &-2\\0 & 0 & -7 & 5\\0& 0 & 0 & 4\end{bmatrix}$ Examples of Lower Triangular Matrix $P = \begin{bmatrix}a_{11} & 0\\a_{12} & a_{22}\end{bmatrix}$ $Q = \begin{bmatrix}a_{11} & 0& 0\\a_{21} & a_{22}& 0\\a_{31} & a_{32} & a_{33}\end{bmatrix}$ $R = \begin{bmatrix}-1 & 0 & 0 & 0\\5 & 1 & 0 &0\\-3 & 1 & -7 & 0\\8& 2 & -6 & 2\end{bmatrix}$ Rules Regarding Triangular Matrices Here are some basic rules regarding the upper or lower triangular matrices. • If a square matrix $A= [a_{ij}]$ is upper triangular matrix then $a_{ij} = 0$ and $i < j$. • If a square matrix $A= [a_{ij}]$ is lower triangular matrix then $a_{ij} = 0$ and $i > j$. • If a square matrix $A= [a_{ij}]$ is upper triangular matrix then $i^{th}$ row has and starts with $i - 1$ zeros. • If a square matrix $A= [a_{ij}]$ is lower triangular matrix then $i^{th}$ row has and starts with $j - 1$ zeros. ### Strict Triangular Matrix A strict triangular matrix is a square matrix which has all entries zero below or above the main diagonal including the main diagonal. Strict Upper Triangular Matrix If a strict triangular matrix has all zero entries below the main diagonal including the main diagonal then it is called strict upper triangular matrix. Example of Strict Upper Triangular Matrix $A = \begin{bmatrix}0 & b\\0 & 0\end{bmatrix}$ $B = \begin{bmatrix}0 & 4 & 2\\0 & 0 & 1\\0 & 0 & 0\end{bmatrix}$ Examples of Strict Lower Triangular Matrix $C = \begin{bmatrix}0 & 0\\c & 0\end{bmatrix}$ $D = \begin{bmatrix}0 & 0 & 0\\7 & 0 & 0\\3 & 9 & 0\end{bmatrix}$ The basic rules for constructing strict upper or strict lower triangular matrix are • If a square matrix $A = [a_{ij}]$ is strict upper triangular matrix when $a_{ij} = 0$ and $i \leq j$. • If a square matrix $A = [a_{ij}]$ is strict lower triangular matrix when $a_{ij} = 0$ and $i \geq j$. ### Properties Of Triangular Matrix There are some interesting properties of triangular matrices which we will explore each type of triangular matrices with examples. Properties of Upper Triangular Matrices The upper triangular matrix is in row-echelon form. Here are the properties of upper triangular matrices. • Adding two upper triangular matrices of same order will result in a upper triangular matrix of same order. • Product of two defined ( eligible for multiplication) upper triangular matrices is upper triangular matrix. • Transpose of upper triangular matrix is lower triangular matrix. • Inverse of upper triangular matrix is also upper triangular matrix. Let us verify each claim with examples. Addition of Two Upper Triangular Matrices Let $A$ and $B$ be two upper triangular matrices of order $3 \times 3$. $A = \begin{bmatrix}2 & 3 & 5\\0 & 3 & 6\\0 & 0 & 1\end{bmatrix}$ $B = \begin{bmatrix}6 & 1 & 7\\0 & 4 & 1\\0 & 0 & 8\end{bmatrix}$ $A + B = \begin{bmatrix}8 & 4 & 12\\0 & 7 & 7\\0 & 0 & 9\end{bmatrix}$  Therefore, sum of two upper triangular matrices is an upper triangular matrix. Product of Two Upper Triangular Matrix Let $C$ and $D$ be two matrices of order $2 \times 2$. $C = \begin{bmatrix}2 & 7\\0 & 4\end{bmatrix}$ $D = \begin{bmatrix}1 & 3\\0 & 5\end{bmatrix}$ Let the product of $C \times D = K$ $K = \begin{bmatrix}2+0 & 6+35\\0+0 & 0+20\end{bmatrix}$ $K = \begin{bmatrix}2 & 41\\0 & 20\end{bmatrix}$ The product of two defined upper triangular matrices is an upper triangular matrix. Transpose of Upper Triangular Matrix The transpose of a matrix can be obtained by changing all rows into columns or all columns into rows. $A = \begin{bmatrix}a & b & c\\0 & d & e\\0 & 0 & f\end{bmatrix}$ Then the transpose of matrix $A$ is $A^T = \begin{bmatrix}a & 0 & 0\\b & d & 0\\c & e & f\end{bmatrix}$ Inverse of Upper Triangular Matrix Like diagonal matrix, if the main diagonal of upper triangular matrix is non-zero then it is invertible. To be invertible a square matrix must has determinant not equal to 0. Since, determinant of a upper triangular matrix is product of diagonals if it is nonzero, then the matrix is invertible. Let $A$ be a upper triangular matrix of order $2 \times 2$. $A = \begin{bmatrix}2 & 5\\0 & 3\end{bmatrix}$ The determinant is nonzero, therefore, matrix $A$ is invertible. $|A| = 2 \times 3 = 6$ $A^{-1} = \frac{\strut 1}{\strut 6} \times \begin{bmatrix}3 & -5\\0 & 2\end{bmatrix}$ $A^{-1} = \begin{bmatrix}\frac{\strut 1}{\strut 2}& \frac{\strut -5}{\strut 6}\\0 & \frac{\strut 1}{\strut 3}\end{bmatrix}$ Properties of Lower Triangular Matrices The properties of lower triangular matrices are similar to that of upper triangular matrices,but we decided to discuss it separately. Here are the basic properties • Adding two lower triangular matrices of same order will result in a lower triangular matrix of same order. • Product of two defined ( eligible for multiplication) lower triangular matrices is lower triangular matrix. • Transpose of lower triangular matrix is upper triangular matrix. • Inverse of lower triangular matrix is also lower triangular matrix. Let us verify each statement with examples. Addition of Lower Triangular Matrix Let $A$ and $B$ be two lower triangular matrices of order $3 \times 3$. $A = \begin{bmatrix}2 & 0 & 0\\4 & 1 & 0\\3 & 9 & 5\end{bmatrix}$ $B = \begin{bmatrix}-3 & 0 & 0\\-2 & 7 & 0\\-1 & 6 & 1\end{bmatrix}$ The addition of matrix is stored in matrix $C$ $C = A + B$ $C = \begin{bmatrix}2 & 0 & 0\\4 & 1 & 0\\3 & 9 & 5\end{bmatrix} + \begin{bmatrix}-3 & 0 & 0\\-2 & 7 & 0\\-1 & 6 & 1\end{bmatrix}$ $C = \begin{bmatrix}-1 & 0 & 0\\2 & 8 & 0\\2 & 15 & 6\end{bmatrix}$ Therefore, above results shows that sum of two lower triangular matrix is a lower triangular matrix of same order. Product of Two Lower Triangular Matrix Similar to upper triangular matrix, the product of two defined lower triangular matrix is a lower triangular matrix. Let $A$ and $B$ be two lower triangular matrix of order $3 \times 3$ and the product matrix is $C$of same order. $A = \begin{bmatrix}6 & 0 & 0\\2 & 7 & 0\\1 & 9 & 3\end{bmatrix}$ $B = \begin{bmatrix}-1 & 0 & 0\\5 & 3 & 0\\-3 & 2 & -5\end{bmatrix}$ $C = A \times B$ $C = \begin{bmatrix}-6 & 0 & 0\\33 & 21 & 0\\35 & 33 & -15\end{bmatrix}$ Transpose of Lower Triangular Matrix The transpose of lower triangular matrix will change all rows to columns or columns to rows which result in an upper triangular matrix. Consider the following example. Let $S$ be a lower triangular matrix of order $4 \times 4$. The transpose of matrix $S$ is denoted as $S^T$. $S = \begin{bmatrix}2 & 0 & 0 & 0\\7 & 5 & 0 & 0\\1 & 3 & 2 & 0\\4 & 9 & 6 & 8\end{bmatrix}$ Transpose of matrix $S$ $S^T = \begin{bmatrix}2 & 7 & 1 & 4\\0 & 5 & 3 & 9\\0 & 0 & 2 & 6\\0 & 0 & 0 & 8\end{bmatrix}$ Inverse of Lower Triangular Matrix The invertibility requirement of lower triangular matrix is same as that of upper triangular matrix. The main diagonal element should not be zero because the determinant of the lower triangular matrix must not be a zero; otherwise there is no inverse matrix. Let $L$ be a lower triangular matrix of order $4 \times 4$. $L = \begin{bmatrix}2 & 0 & 0 &0\\3 & 1 & 0 & 0\\2 & 5 & 6 & 0\\4 & 3 & 2 & 7\end{bmatrix}$ Since the diagonals are non-zero, the matrix $L$ is invertible and its determinant is $|L|$ $|L| = 2 \times 1 \times 6 \times 7 = 84$ The minor matrix of $L$ $M_{11} = \begin{vmatrix}1 & 0 & 0\\5 & 6 & 0\\3 & 2 & 7\end{vmatrix} = 42$, $M_{12} = \begin{vmatrix}3 & 0 & 0\\2 & 6 & 0\\4 & 2 & 7\end{vmatrix} = 126$ $M_{13} = \begin{vmatrix}3 & 1 & 0\\2 & 5 & 0\\4 & 3 & 7\end{vmatrix} = 91$, $M_{14} = \begin{vmatrix}3 & 1 & 0\\2 & 5 & 6\\4 & 3 & 2\end{vmatrix} = -4$ $M_{21} = \begin{vmatrix}0 & 0 & 0\\5 & 6 & 0\\3 & 2 & 7\end{vmatrix} = 0$, $M_{22} = \begin{vmatrix}2 & 0 & 0\\2 & 6 & 0\\4 & 2 & 7\end{vmatrix} = 84$ $M_{23} = \begin{vmatrix}2 & 0 & 0\\2 & 5 & 0\\4 & 3 & 7\end{vmatrix} = 70$, $M_{24} = \begin{vmatrix}2 & 0 & 0\\2 & 5 & 6\\4 & 3 & 2\end{vmatrix} = -16$ $M_{31} = \begin{vmatrix}0 & 0 & 0\\1 & 0 & 0\\3 & 2 & 7\end{vmatrix} = 0$, $M_{32} = \begin{vmatrix}2 & 0 & 0\\3 & 0 & 0\\4 & 2 & 7\end{vmatrix} = 0$ $M_{33} = \begin{vmatrix}2 & 0 & 0\\3 & 1 & 0\\4 & 3 & 7\end{vmatrix} = 14$, $M_{34} = \begin{vmatrix}2 & 0 & 0\\3 & 1 & 0\\4 & 3 & 2\end{vmatrix} = 4$ $M_{41} = \begin{vmatrix}0 & 0 & 0\\1 & 0 & 0\\5 & 6 & 0\end{vmatrix} = 0$, $M_{42} = \begin{vmatrix}2 & 0 & 0\\3 & 0 & 0\\2 & 6 & 0\end{vmatrix} = 0$ $M_{43} = \begin{vmatrix}2 & 0 & 0\\2 & 5 & 0\\4 & 3 & 7\end{vmatrix} = 0$, $M_{44} = \begin{vmatrix}2 & 0 & 0\\3 & 1 & 0\\2 & 5 & 6\end{vmatrix} = 12$ $= \begin{bmatrix}42 & 126 & 91 & -4\\0 & 84 & 70 & -16\\0 & 0 & 14 & 4\\0 & 0 & 0 & 12\end{bmatrix}$ From the minor matrix we can obtain the cofactor matrix. Each cofactor value can be obtained using $L_{ij} = (-1)^{i+j} \times M_{ij}$ $= \begin{bmatrix}42 & -126 & 91 & 4\\0 & 84 & -70 & -16\\0 & 0 & 14 & -4\\0 & 0 & 0 & 12\end{bmatrix}$ The adjoint matrix can be obtained from the cofactor matrix and we can find the inverse of the matrix. $Adj L = \begin{bmatrix}42 & 0 & 0 & 0\\-126 & 84 & 0 & 0\\91 & -70 & 14 & 0\\4 & -16 & -4 & 12\end{bmatrix}$ Therefore, The inverse of matrix $L$ is $L^{-1}$ and obtained using $L^{-1} = \frac{\strut 1}{\strut 84} \times Adj L$ $L^{-1} = \frac{\strut 1}{\strut 84} \times \begin{bmatrix}42 & 0 & 0 & 0\\-126 & 84 & 0 & 0\\91 & -70 & 14 & 0\\4 & -16 & -4 & 12\end{bmatrix}$ $L^{-1} = \begin{bmatrix}\frac{\strut 1}{\strut 2}& 0 & 0 & 0\\\frac{\strut -3}{\strut 2} & 1 & 0 & 0\\\frac{\strut 91}{\strut 84} & \frac{\strut -5}{\strut 6} & \frac{\strut 1}{\strut 6} & 0\\\frac{\strut 1}{\strut 21}& \frac{\strut -4}{\strut 21} & \frac{\strut -1}{\strut 21} & \frac{\strut 1}{\strut 7}\end{bmatrix}$ Therefore, lower triangular matrix has a lower triangular inverse matrix. Let us verify the inverse matrix. $L \times L^{-1} = I$ $= \begin{bmatrix}2 & 0 & 0 &0\\3 & 1 & 0 & 0\\2 & 5 & 6 & 0\\4 & 3 & 2 & 7\end{bmatrix} \times \begin{bmatrix}\frac{\strut 1}{\strut 2}& 0 & 0 & 0\\\frac{\strut -3}{\strut 2} & 1 & 0 & 0\\\frac{\strut 91}{\strut 84} & \frac{\strut -5}{\strut 6} & \frac{\strut 1}{\strut 6} & 0\\\frac{\strut 1}{\strut 21}& \frac{\strut -4}{\strut 21} & \frac{\strut -1}{\strut 21} & \frac{\strut 1}{\strut 7}\end{bmatrix}$ $= \begin{bmatrix}1 & 0 & 0 &0\\0 & 1 & 0 & 0\\0 & 0 & 1 & 0\\0 & 0 & 0 & 1\end{bmatrix}$ In the next article, we will discuss some interesting way to solve Ax = b using triangular matrices. # Inverse Of Diagonal Matrix The diagonal matrix has diagonal elements only and if the diagonals are 1 then the matrix is called and identity matrix $I$. In this article, we discuss about diagonal matrix and properties. Then find the inverse of diagonal matrix. ### What is a diagonal matrix ? A diagonal matrix is a $n \times n$ matrix whose diagonal entries are non-zero and all other entries are zero. For example, $A = \begin{bmatrix}a_{11}&0&0\\0&a_{22}&0\\0&0&a_{33}\end{bmatrix}$ The matrix $A$ above is a diagonal matrix whose diagonal entries are $a_{11}, a_{22}, a_{33}$ and other entries are $0$. ### Some Interesting Properties of Diagonal Matrix The diagonal matrix have some interesting properties explain in this section with examples. Addition Or Multiplication of Diagonal Matrices Addition or multiplication of two or more diagonal matrices of same order will give a diagonal matrix of same order. Example #1 Let $A$ and $B$ be two diagonal matrices of order $3 \times 3$. $A = \begin{bmatrix}2 & 0 & 0 \\0 & 7 & 0\\0 & 0 & 4\end{bmatrix} B = \begin{bmatrix}1 & 0 & 0 \\0 & 3 & 0\\0 & 0 & 5\end{bmatrix}$ Therefore, adding $A$ and $B$ will give $C$ $A + B = C$ $C_{3\times3} = \begin{bmatrix}2 + 1 & 0 + 0 & 0 + 0\\0 + 0 & 7 + 3& 0+0\\ 0+0& 0 + 0&4+ 5\end{bmatrix} = \begin{bmatrix}3 & 0 & 0 \\0 & 10 & 0\\0 & 0 & 9\end{bmatrix}_{3\times3}$ Example #2 Let $C$ and $D$ be two diagonal matrices of order $2 \times 2$. $C = \begin{bmatrix}4 & 0\\0 & 3\end{bmatrix} D =\begin{bmatrix} 1 & 0\\0 & 6\end{bmatrix}$ Therefore, multiplying matrix $C$ and $D$ will give $C \times D = F$ $F_{2\times2} = \begin{bmatrix}4 + 0 & 0 + 0\\0 + 0&0 + 18\end{bmatrix}= \begin{bmatrix}4 & 0\\0 & 18\end{bmatrix}_{2\times2}$ Multiplication Of Diagonal Matrix With Other Matrices Let $A$ be matrix of order $n \times n$ and $B$ be a matrix of order $n\times m$. Example #3 $A = \begin{bmatrix}a_{11}&0&0\\0&a_{22}&0\\0&0&a_{33}\end{bmatrix}$ $B = \begin{bmatrix}b_{11}&b_{12}\\b_{21}&b_{22}\\b_{31}&b_{32}\end{bmatrix}$ $A \times B = \begin{bmatrix}a_{11}&0&0\\0&a_{22}&0\\0&0&a_{33}\end{bmatrix} \times \begin{bmatrix}b_{11}&b_{12}\\b_{21}&b_{22}\\b_{31}&b_{32}\end{bmatrix}$ $A \times B = \begin{bmatrix}a_{11}b_{11}&a_{11}b_{12}\\a_{22}b_{21}&a_{22}b_{22}\\a_{33}b_{31}&a_{33}b_{32}\end{bmatrix}$ Each element of diagonal matrix $A$ is multiplied with corresponding row elements of matrix $B$. For example, element $a_{11}$ from diagonal matrix $A$ is multiplied with all elements of first row in matrix $B$. Example #4 Another case of multiplication is when matrix $C$ of order $m \times n$ is multiplied with a diagonal matrix $A$ of order $n \times n$. Let $C$ be a matrix of order $4 \times 3$ $C = \begin{bmatrix}c_{11}&c_{12}&c_{13}\\c_{21}&c_{22}&c_{23}\\c_{31}&c_{32}&c_{33}\\c_{41}&c_{42}&c_{43}\end{bmatrix}$ and $A$ be a diagonal matrix of order $3 \times 3$ $A = \begin{bmatrix}a_{11}&0&0\\0&a_{22}&0\\0&0&a_{33}\end{bmatrix}$ $C \times A = \begin{bmatrix}c_{11}&c_{12}&c_{13}\\c_{21}&c_{22}&c_{23}\\c_{31}&c_{32}&c_{33}\\c_{41}&c_{42}&c_{43}\end{bmatrix}\times \begin{bmatrix}a_{11}&0&0\\0&a_{22}&0\\0&0&a_{33}\end{bmatrix}$ $C \times A = \begin{bmatrix}c_{11}a_{11}+0+0&0+c_{12}a_{22}+0&0+0+c_{13}a_{33}\\c_{21}a_{11}+0+0&0+c_{22}a_{22}+0&0+0+c_{23}a_{33}\\c_{31}a_{11}+0+0&0+c_{32}a_{22}+0&0+0+c_{33}a_{33}\\c_{41}a_{11}+0+0&0+c_{42}a_{22}+0&0+0+c_{43}a_{33}\end{bmatrix}$ $C \times A = \begin{bmatrix}c_{11}a_{11}&c_{12}a_{22}&c_{13}a_{33}\\c_{21}a_{11}&c_{22}a_{22}&c_{23}a_{33}\\c_{31}a_{11}&c_{32}a_{22}&c_{33}a_{33}\\c_{41}a_{11}&0+c_{42}a_{22}&c_{43}a_{33}\end{bmatrix}$ When matrix C$ is multiplied with diagonal matrix $A$ then each element of $A$ is multiplied with corresponding columns in matrix $C$. For example, element $a_{11}$ is multiplied with first column of the matrix $C$.

Commutative Property of Multiplication in Between Diagonal Matrices

If two matrices $A$ and $B$ are diagonal matrices of same order $n \times n$, then the multiplication is commutative.

Example #5

Let $A$ be a diagonal matrix of order $3 \times 3$

$A = \begin{bmatrix}3&0&0\\0&4&0\\0&0&5\end{bmatrix}$

and $B$ be a diagonal matrix of order $3 \times 3$

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

$A \times B = \begin{bmatrix}3&0&0\\0&4&0\\0&0&5\end{bmatrix} \times \begin{bmatrix}-2&0&0\\0&1&0\\0&0&7\end{bmatrix}$

$A \times B = \begin{bmatrix}-6&0&0\\0&4&0\\0&0&35\end{bmatrix}$

Similarly,

$B \times A = \begin{bmatrix}-2&0&0\\0&1&0\\0&0&7\end{bmatrix}\times \begin{bmatrix}3&0&0\\0&4&0\\0&0&5\end{bmatrix}$

$A \times B = \begin{bmatrix}-6&0&0\\0&4&0\\0&0&35\end{bmatrix}$

Therefore, $AB = BA$ for diagonal matrices is true.

Diagonal Matrix is Symmetric

If $A$ is a diagonal matrix of order $n \times n$ then it is symmetric.

$A = A^T$

Example #6

Let $D$ be a diagonal matrix of order $4 \times 4$.

$A = \begin{bmatrix}a_{11}&0&0&0\\0&a_{22}&0&0\\0&0&a_{33}&0\\0&0&0&a_{44} \end{bmatrix}$

When we take transpose of a matrix, then $a_{ij}$ becomes $a_{ji}$, but for a diagonal matrix $i = j$, therefore,

$A^T = \begin{bmatrix}a_{11}&0&0&0\\0&a_{22}&0&0\\0&0&a_{33}&0\\0&0&0&a_{44} \end{bmatrix} = A$

$A = A^T$

We conclude that the diagonal matrix $A$ is symmetric and $A = A^T$ is true.

Power of Diagonal Matrix

If a diagonal matrix $P$ is multiplied by itself k-times, then we can say that the matrix $P$ is raised to the power of $k$.

Example #7

Let $P$ be a diagonal matrix of order $2 \times 2$. Let matrix $P$ is raised to power $k = 3$ then

$P^3 = \begin{bmatrix}a & 0\\0 & b\end{bmatrix} \times \begin{bmatrix}a & 0\\0 & b\end{bmatrix}\times \begin{bmatrix}a & 0\\0 & d\end{bmatrix}$

$P^3 = \begin{bmatrix}a^3 & 0\\0 & b^3\end{bmatrix}$

Therefore,

$P^k = \begin{bmatrix}a^k & 0\\0 & b^k\end{bmatrix}$

### Invertible Diagonal Matrix

Any matrix is invertible if its determinant is not equal to 0 and it is a square matrix. The diagonal matrix is a square matrix, but it must have a non-zero entry in the main diagonal to be invertible.

If the main diagonal has a zero entry then it is a singular matrix for two reasons

1. It is not a square matrix
2. It has a zero determinant

Example #8

Let matrix $A$ be a diagonal matrix of order $3 \times 3$.

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

Rule 1: Diagonal matrix must be a square matrix

The last row of matrix $A$ is zero and must be deleted. The remaining two row is not a square matrix; therefore, not invertible.

Rule 2: The determinant of matrix $A$ should be non-zero.

The minor matrix of $A$ is

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

The determinant of a diagonal matrix $A$ is $|A| = abc + 0 + 0 = abc$ if there are non-zero elements in the main diagonal.

Inverse of a Diagonal Matrix

The inverse of a diagonal matrix can be found by using the following equation.

$A^{-1} = \frac{\strut 1}{\strut |A|} \times adj A$

Example #9

Let $A$ be a diagonal matrix of order $3 \times 3$.

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

From the discussion above we know that the cofactor matrix of A is

$= \begin{bmatrix}bc & 0 & 0\\0 & ac & 0\\0 & 0 & bc\end{bmatrix}$

Since, matrix $A$ is symmetric, that is, $A = A^T$.

$adj A = \begin{bmatrix}A_{ij}\end{bmatrix}^T = \begin{bmatrix}bc & 0 & 0\\0 & ac & 0\\0 & 0 & bc\end{bmatrix}$

Therefore,

$A^{-1} = \frac{\strut 1}{\strut abc}\times \begin{bmatrix}bc & 0 & 0\\0 & ac & 0\\0 & 0 & bc\end{bmatrix}$

$A^{-1} = \begin{bmatrix}\frac{\strut 1}{\strut a} & 0 & 0\\0 & \frac{\strut 1}{\strut b} & 0\\0 & 0 & \frac{\strut 1}{\strut c}\end{bmatrix}$

From the example it is clear that the inverse of a diagonal matrix $A^{-1}$ contains reciprocal of each element of the diagonal matrix $A$.

‘Example #10

Find the inverse of following diagonal matrix $B$.

$B = \begin{bmatrix}-3 & 0 & 0 \\0 & 2 & 0 \\ 0 & 0 & 5\end{bmatrix}$

Solution :

Given the diagonal matrix $B$.

$B = \begin{bmatrix}-3 & 0 & 0 \\0 & 2 & 0 \\ 0 & 0 & 5\end{bmatrix}$

We simply need to find the inverse of each diagonal element in the matrix $B$.

Therefore,

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

### Important Points To Remember

Here are some important points to remember.

• diagonal addition and multiplication with another diagonal matrix is commutative.
• diagonal matrix is symmetric.
• power of diagonal matrix is power of individual diagonal entries.
• invertible diagonal matrix has non-zero diagonal entries.
• inverse of a diagonal matrix is a matrix that has inverse of each corresponding element from the diagonal matrix.

# 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.