VOOZH about

URL: https://www.geeksforgeeks.org/maths/cofactor-matrix/

⇱ Cofactor of a Matrix: Formula and Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Cofactor of a Matrix: Formula and Examples

Last Updated : 19 Nov, 2025

A cofactor of a matrix is an important concept in linear algebra, often used in the calculation of determinants and inverses of matrices. The cofactor of an element in a matrix is computed as follows:

  1. Minor: For a given element aij​ in a matrix, first find theminor of that element. The minor of aij​, denoted as Mij​, is the determinant of the matrix that remains after removing the i-th row and j-th column from the original matrix.
  2. Cofactor: The cofactor of aij​, denoted as Cij​, is then obtained by multiplying the minor Mij​ by (−1)i+j. This factor (−1)i+j accounts for the sign change that depends on the position of the element.
👁 cofactor_of_a_matrix

The cofactors for the above matrix is given below:

  • C11= (-1)2 (3 - 16) = -13
  • C21= (-1)3 (-1 - (-2)) = -1

For example minor of the element a11 matrix is calculated as:

Formula for Cofactor of a Matrix

If we denote the Cofactor using Cij, then the cofactor of any element for 

Cij = Mij × (-1)i+j

Where,

  • i is the number of rows for the element under consideration,
  • j is the number of columns for the element under consideration, and
  • Mij is the minor of the element in the ith row and jth column.

How to Find Cofactor of a Matrix?

In order to find a cofactor matrix we need to perform the following steps:

  • Step 1: Find the minor of each element of the matrix and make a minor matrix.
  • Step 2: Multiply each element in the minor matrix by (-1)i+j.
    Thus, we obtain the cofactor matrix.

Let us understand how to find a cofactor matrix using an example:

Example: Find the cofactor matrix of 

Solution:

  • Step 1: Find the minor of each element and make a minor matrix.

Minor of a11 is calculated by eliminating row 1 and column 1 and taking the determinant of the remaining matrix as follows:

M11= determinant of 
M11 = 5(9) - 6(8)
M11 = 45 - 48 = -3

Similarly, the minor of element a12 is calculated:

M12 = determinant of 
M12 = 4(9) - 6(7)
M12 = 36 - 42 = -6

  • Similarly, calculate the minors of all elements to obtain the following minor matrix:
  • Step 2: Multiply each element of the minor matrix by (-1)i+j to get the cofactor of that element i.e. Cij

C11 = M11 × (-1)1+1 = M11 = -3
C12 = M12 × (-1)1+2 = -M12 = 6

  • Similarly, calculate the other cofactors to obtain the following cofactor matrix:

Cofactor of 2×2 Matrix

Consider a 2×2 matrix as follows:

Then the cofactor matrix of any such matrix is written as:

Cofactor of 3×3 Matrix

Consider a 3×3 matrix as follows:

Then the cofactor matrix of any such matrix is calculated by calculating the cofactors of each of the elements as follows:

Let Mij denote the minor of the element in row i and column j, then in the above matrix:


Similarly, we can calculate the minors of all the elements to get the below minor matrix:

Now cofactor of each element is calculated by multiplying the minor from the minor matrix with -1 raised to the power of the sum of row and column numbers to which that minor belongs as follows:

Let Cij denote the cofactor of minor Mij, then:

C11 = (-1)1+1M11 = M11
C12 = (-1)1+2M12 = -M12
C13 = (-1)1+3M13 = M13

Similarly, after calculating all the cofactors of each element we get the following cofactor matrix:

Applications of Cofactor of a Matrix

There are various applications of Cofactor Matrix. Some of these applications are:

  • Cofactor of the Matrix is used to find the adjoint of the matrix.
  • Cofactor Matrix is used in the calculation of determinant of the matrix.
  • It is also used to find the inverse of the matrix.

Also Check:

Solved Examples on Cofactor of a Matrix

Example 1. Find the cofactor of a11 in the matrix 

Given matrix is 
Minor M11 = 7
Cofactor of a11 = 7 × (-1)1+1 = 7

Example 2. Find the cofactor of a12 in the matrix 

Given matrix is 
Minor M12 = determinant of 
M1 = 40 - 36 = 4
Cofactor C1 of a12 = M12 × (-1)1+2
C12 = 4 × (-1) = -4

Example 3. What is the cofactor matrix of 

Step 1: Find the minor of each element and make a minor matrix.
Minor of a11 is calculated by eliminating the row 1 and column 1 as follows
M11 = 8
Similarly minor of element a12 is calculated by eliminating the row 1 and column 2 as follows:
M12 = 7
Similarly calculate minors of all elements to obtain the following minor matrix:

Step 2: Multiply each element of the minor matrix by (-1)i+j to get the cofactor of that element i.e. Cij
Cofactor of M11 is calculated as follows:
C11 = M11 × (-1)1+1 = M11 = 8
Cofactor of M12 is calculated as follows:
C12 = M12 × (-1)1+2 = -M12 = -7
Similarly calculate the other cofactors to obtain the following cofactor matrix:

Example 4. What is the cofactor matrix of 

Step 1: Find the minor of each element and make a minor matrix.
M11 = -4
M12 = -3
Similarly calculate minors of all elements to obtain the following minor matrix:

Step 2: Multiply each element of the minor matrix by (-1)i+j to get the cofactor of that element i.e. Cij
C11 = M11 × (-1)1+1 = M11 = -4
C12 = M12 × (-1)1+2 = -M12 = -3
Similarly calculate the other cofactors to obtain the following cofactor matrix:

Example 5. What is the cofactor matrix of 

Step 1: Find the minor of each element and make a minor matrix.
M11 = determinant of 
M11 = 0 -12 = -12
M12 = determinant of 
M12 = 0 - 2 = -2
Similarly calculate minors of all elements to obtain the following minor matrix:

Step2 : Multiply each element of the minor matrix by (-1)i+j to get the cofactor of that element i.e. Cij
C11 = M11 × (-1)1+1 = M11 = -12
C12 = M12 × (-1)1+2 = -M12 = 2
Similarly calculate the other cofactors to obtain the following cofactor matrix:

Practice Problems on Cofactor of a Matrix

Problem 1: Find the cofactor of the element in the second row and third column: .

Problem 2: Find the cofactor matrix of .

Problem 3: Find the cofactor matrix of .

Problem 4: Find the cofactor matrix of .

Problem 5: Find the cofactor matrix of .

Solutions of Practice Problems:

1.
2.
3.
4.
5.

Comment

Explore