• Nakafa

    Nakafa

    Learn free and with quality.
Subject
    • Grade 10
    • Grade 11
    • Grade 12
Exercises
Holy
  • Quran
Articles
  • Politics
  • Community
  • About

Command Palette

Search for a command to run...

Matrix

Cofactor Expansion Method

What is Cofactor Expansion?

The cofactor expansion method is one way to calculate the determinant of a square matrix, especially for matrices larger than 2×22 \times 22×2.

This method works by breaking down the calculation of a large matrix's determinant into a sum of the products of the matrix elements with their respective cofactors, which involves the determinants of smaller matrices.

Minor of a Matrix Element

Each element in a square matrix has what is called a "minor". The minor of an element aija_{ij}aij​ (i.e., the element located in the iii-th row and jjj-th column) is usually written as MijM_{ij}Mij​.

To determine the minor MijM_{ij}Mij​, we need to remove (cross out) the entire iii-th row and the entire jjj-th column from the original matrix. The determinant of the remaining sub-matrix is what is called the minor MijM_{ij}Mij​.

Finding the Minor

Suppose we have a 3×33 \times 33×3 matrix AAA as follows:

A=[a11a12a13a21a22a23a31a32a33]A = \begin{bmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{bmatrix}A=​a11​a21​a31​​a12​a22​a32​​a13​a23​a33​​​

If we want to find the minor of the element a22a_{22}a22​ (i.e., M22M_{22}M22​), we remove the second row and second column from matrix AAA:

Imagine we cross it out like this:

A=[a11a12a13a21a22a23a31a32a33]A = \begin{bmatrix} a_{11} & \cancel{a_{12}} & a_{13} \\ \cancel{a_{21}} & \cancel{a_{22}} & \cancel{a_{23}} \\ a_{31} & \cancel{a_{32}} & a_{33} \end{bmatrix}A=​a11​a21​​a31​​a12​​a22​​a32​​​a13​a23​​a33​​​

The matrix remaining after the removal is:

[a11a13a31a33]\begin{bmatrix} a_{11} & a_{13} \\ a_{31} & a_{33} \end{bmatrix}[a11​a31​​a13​a33​​]

Thus, the minor M22M_{22}M22​ is the determinant of this remaining matrix:

M22=det⁡(a11a13a31a33)=(a11×a33)−(a13×a31)M_{22} = \det \begin{pmatrix} a_{11} & a_{13} \\ a_{31} & a_{33} \end{pmatrix} = (a_{11} \times a_{33}) - (a_{13} \times a_{31})M22​=det(a11​a31​​a13​a33​​)=(a11​×a33​)−(a13​×a31​)

Cofactor of a Matrix Element

After understanding what a minor is, the next step is to understand the "cofactor". The cofactor of an element aija_{ij}aij​, usually denoted as kijk_{ij}kij​ or CijC_{ij}Cij​, is calculated using its minor with the formula:

kij=(−1)i+jMijk_{ij} = (-1)^{i+j} M_{ij}kij​=(−1)i+jMij​

The (−1)i+j(-1)^{i+j}(−1)i+j part in this formula determines the sign (positive or negative) of the cofactor. The rule is simple:

  • If the sum i+ji+ji+j is an even number, then (−1)i+j=1(-1)^{i+j} = 1(−1)i+j=1. This means kij=Mijk_{ij} = M_{ij}kij​=Mij​ (the cofactor is equal to its minor).
  • If the sum i+ji+ji+j is an odd number, then (−1)i+j=−1(-1)^{i+j} = -1(−1)i+j=−1. This means kij=−Mijk_{ij} = -M_{ij}kij​=−Mij​ (the cofactor is the negative of its minor).

For a 3×33 \times 33×3 matrix, the sign pattern of (−1)i+j(-1)^{i+j}(−1)i+j will look like this:

(+−+−+−+−+)\begin{pmatrix} + & - & + \\ - & + & - \\ + & - & + \end{pmatrix}​+−+​−+−​+−+​​

This sign indicates whether the cofactor will be equal to its minor (sign +++) or the negative of its minor (sign −-−).

Finding the Cofactor

Let's continue with the example of matrix AAA and the minor M22M_{22}M22​ that we have already calculated.

The cofactor for element a22a_{22}a22​ is k22k_{22}k22​.

Since i=2i=2i=2 and j=2j=2j=2, then i+j=2+2=4i+j = 2+2 = 4i+j=2+2=4 (even).

k22=(−1)2+2M22=(1)M22=M22k_{22} = (-1)^{2+2} M_{22} = (1) M_{22} = M_{22}k22​=(−1)2+2M22​=(1)M22​=M22​

Now, let's try to find the cofactor for element a12a_{12}a12​, which is k12k_{12}k12​.

First, we find its minor, M12M_{12}M12​, by removing the first row and second column from matrix AAA:

M12=det⁡(a21a23a31a33)=(a21×a33)−(a23×a31)M_{12} = \det \begin{pmatrix} a_{21} & a_{23} \\ a_{31} & a_{33} \end{pmatrix} = (a_{21} \times a_{33}) - (a_{23} \times a_{31})M12​=det(a21​a31​​a23​a33​​)=(a21​×a33​)−(a23​×a31​)

Then, we calculate its cofactor. For a12a_{12}a12​, i=1i=1i=1 and j=2j=2j=2, so i+j=1+2=3i+j = 1+2 = 3i+j=1+2=3 (odd).

k12=(−1)1+2M12=(−1)M12=−M12k_{12} = (-1)^{1+2} M_{12} = (-1) M_{12} = -M_{12}k12​=(−1)1+2M12​=(−1)M12​=−M12​

Calculating the Determinant using Cofactor Expansion

The core of the cofactor expansion method is to calculate the determinant of matrix AAA (denoted det⁡(A)\det(A)det(A) or ∣A∣|A|∣A∣) by choosing one row or one column from the matrix.

Then, each element in the chosen row or column is multiplied by its respective cofactor, and all these products are summed up.

Formula for Cofactor Expansion Along the iii-th Row:

det⁡(A)=∣A∣=∑j=1naijkij=ai1ki1+ai2ki2+⋯+ainkin\det(A) = |A| = \sum_{j=1}^{n} a_{ij}k_{ij} = a_{i1}k_{i1} + a_{i2}k_{i2} + \dots + a_{in}k_{in}det(A)=∣A∣=j=1∑n​aij​kij​=ai1​ki1​+ai2​ki2​+⋯+ain​kin​

This means we choose the iii-th row. Then, for each column jjj in that row, we multiply the element aija_{ij}aij​ by its cofactor kijk_{ij}kij​, and sum them all.

Formula for Cofactor Expansion Along the jjj-th Column:

det⁡(A)=∣A∣=∑i=1naijkij=a1jk1j+a2jk2j+⋯+anjknj\det(A) = |A| = \sum_{i=1}^{n} a_{ij}k_{ij} = a_{1j}k_{1j} + a_{2j}k_{2j} + \dots + a_{nj}k_{nj}det(A)=∣A∣=i=1∑n​aij​kij​=a1j​k1j​+a2j​k2j​+⋯+anj​knj​

This means we choose the jjj-th column. Then, for each row iii in that column, we multiply the element aija_{ij}aij​ by its cofactor kijk_{ij}kij​, and sum them all.

The good news is, you can choose any row or column for the expansion, and the result will always be the same!

To simplify calculations, it is usually best to choose a row or column that contains many zero elements, as multiplication by zero will result in zero and reduce the number of terms to be calculated.

Example of Determinant Calculation

Let's calculate the determinant of the following matrix PPP using the cofactor expansion method:

P=[132262594]P = \begin{bmatrix} 1 & 3 & 2 \\ 2 & 6 & 2 \\ 5 & 9 & 4 \end{bmatrix}P=​125​369​224​​

We will perform cofactor expansion along the first row (i.e., i=1i=1i=1).

Based on the formula, the determinant of PPP is:

det⁡(P)=a11k11+a12k12+a13k13\det(P) = a_{11}k_{11} + a_{12}k_{12} + a_{13}k_{13}det(P)=a11​k11​+a12​k12​+a13​k13​

From matrix PPP, the elements of the first row are:

  • a11=1a_{11} = 1a11​=1
  • a12=3a_{12} = 3a12​=3
  • a13=2a_{13} = 2a13​=2

Now, we need to calculate the cofactors k11k_{11}k11​, k12k_{12}k12​, and k13k_{13}k13​.

  1. Calculating k11k_{11}k11​ (i=1,j=1i=1, j=1i=1,j=1, so i+j=2i+j=2i+j=2, even):

    M11=det⁡(6294)=(6×4)−(2×9)=24−18=6M_{11} = \det \begin{pmatrix} 6 & 2 \\ 9 & 4 \end{pmatrix} = (6 \times 4) - (2 \times 9) = 24 - 18 = 6M11​=det(69​24​)=(6×4)−(2×9)=24−18=6
    k11=(−1)1+1M11=(1)(6)=6k_{11} = (-1)^{1+1} M_{11} = (1)(6) = 6k11​=(−1)1+1M11​=(1)(6)=6
  2. Calculating k12k_{12}k12​ (i=1,j=2i=1, j=2i=1,j=2, so i+j=3i+j=3i+j=3, odd):

    M12=det⁡(2254)=(2×4)−(2×5)=8−10=−2M_{12} = \det \begin{pmatrix} 2 & 2 \\ 5 & 4 \end{pmatrix} = (2 \times 4) - (2 \times 5) = 8 - 10 = -2M12​=det(25​24​)=(2×4)−(2×5)=8−10=−2
    k12=(−1)1+2M12=(−1)(−2)=2k_{12} = (-1)^{1+2} M_{12} = (-1)(-2) = 2k12​=(−1)1+2M12​=(−1)(−2)=2
  3. Calculating k13k_{13}k13​ (i=1,j=3i=1, j=3i=1,j=3, so i+j=4i+j=4i+j=4, even):

    M13=det⁡(2659)=(2×9)−(6×5)=18−30=−12M_{13} = \det \begin{pmatrix} 2 & 6 \\ 5 & 9 \end{pmatrix} = (2 \times 9) - (6 \times 5) = 18 - 30 = -12M13​=det(25​69​)=(2×9)−(6×5)=18−30=−12
    k13=(−1)1+3M13=(1)(−12)=−12k_{13} = (-1)^{1+3} M_{13} = (1)(-12) = -12k13​=(−1)1+3M13​=(1)(−12)=−12

After all cofactors are obtained, we substitute them back into the determinant formula:

det⁡(P)=a11k11+a12k12+a13k13\det(P) = a_{11}k_{11} + a_{12}k_{12} + a_{13}k_{13}det(P)=a11​k11​+a12​k12​+a13​k13​
det⁡(P)=(1)(6)+(3)(2)+(2)(−12)\det(P) = (1)(6) + (3)(2) + (2)(-12)det(P)=(1)(6)+(3)(2)+(2)(−12)
det⁡(P)=6+6−24\det(P) = 6 + 6 - 24det(P)=6+6−24
det⁡(P)=12−24\det(P) = 12 - 24det(P)=12−24
det⁡(P)=−12\det(P) = -12det(P)=−12

So, the determinant of matrix PPP is −12-12−12.

Previous

Sarrus Method

Next

Properties of Matrix Determinant

  • Cofactor Expansion MethodLearn cofactor expansion to calculate matrix determinants step-by-step. Master minors, cofactors, and determinant calculation with clear examples.
On this page
  • What is Cofactor Expansion?
  • Minor of a Matrix Element
    • Finding the Minor
  • Cofactor of a Matrix Element
    • Finding the Cofactor
  • Calculating the Determinant using Cofactor Expansion
  • Example of Determinant Calculation
  • Comments
  • Report
  • Source code