Skip to content

Inversion of matrices ​

Introduction ​

Square matrices

A∈Kn×n

are invertible if and only if their determinant is not zero.

det(A)≠0⇔A−1 exists

Matrices that are not invertible are called singular or degenerate.

Matrices that are invertible are called regular or non-singular.

The inverse of a matrix is a matrix that when multiplied with the original matrix produces the identity matrix.

I=A⋅A−1=A−1⋅A

Inverse matrix can be calculated using sub determinant matrixes.

Inverse calculation ​

Let

A=[a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮an1an2⋯ann]

be a square matrix. The inverse of A is calculated using the following steps:

  1. Calculate the determinant of the matrix
  2. Calculate the sub determinant matrixes
  3. Calculate the cofactor matrix
  4. Calculate the adjugate matrix
  5. Calculate the inverse matrix

Determinant ​

The determinant of a matrix is calculated recursively using the following formula:

det(A)=∑i=1n(−1)i+j⋅aij⋅det(Aij)

where Aij is the sub determinant matrix of A, which is calculated by removing the i-th row and the j-th column from A.

Sub determinant matrices ​

The sub determinant matrixes are calculated by removing the i-th row and the j-th column from the original matrix.

Cofactor matrix ​

The cofactor matrix is calculated using the following formula:

C=[c11c12⋯c1nc21c22⋯c2n⋮⋮⋱⋮cn1cn2⋯cnn]

where

c∗ij=(−1)i+j⋅det(A∗ij)

is the cofactor of the i-th row and the j-th column.

Adjugate matrix ​

The adjugate matrix is calculated by transposing the cofactor matrix.

A∗=[c11c21⋯cn1c12c22⋯cn2⋮⋮⋱⋮c1nc2n⋯cnn]

The adjugate matrix is also called the classical adjoint matrix or the adjugate of A.

Inverse matrix ​

The inverse matrix is calculated using the following formula:

A−1=1det(A)⋅A∗

The result is checked by multiplying the original matrix with the inverse matrix.

A⋅A−1=I

Notes ​

  • The inverse matrix is calculated only if the original matrix is invertible.
  • The inverse matrix is calculated only for square matrices.

Example ​

Let

A=[31−4256148]

be a square matrix. The inverse of A is calculated using the following steps:

Determinant ​

det(A)=3⋅det[5648]−1⋅det[2618]−4⋅det[2514]==3⋅(5⋅8−6⋅4)−1⋅(2⋅8−6⋅1)−4⋅(2⋅4−5⋅1)==3⋅(40−24)−1⋅(16−6)−4⋅(8−5)==3⋅16−1⋅10−4⋅3=48−22=26

Determinant of A is 26. Since the determinant is not zero, the inverse matrix exists.

Sub determinant matrices ​

A11=[5648] A12=[2618] A13=[2514]A21=[1−448] A22=[3−418] A23=[3114]A31=[1−456] A32=[3−426] A33=[3125]

Sub determinants:

det(A11)=5⋅8−6⋅4=40−24=16det(A12)=2⋅8−6⋅1=16−6=10det(A13)=2⋅4−5⋅1=8−5=3det(A21)=1⋅8−(−4)⋅4=8+16=24det(A22)=3⋅8−(−4)⋅1=24+4=28det(A23)=3⋅4−1⋅1=12−1=11det(A31)=1⋅6−(−4)⋅5=6+20=26det(A32)=3⋅6−(−4)⋅2=18+8=26det(A33)=3⋅5−1⋅2=15−2=13

Cofactor matrix ​

C=[16−103−2428−1126−2613]

Adjugate matrix ​

A∗=[16−2426−1028−263−1113]

The adjugate matrix is also called the classical adjoint matrix or the adjugate of A.

Inverse matrix ​

A−1=1det(A)⋅A∗=126⋅[16−2426−1028−263−1113]

The result is checked by multiplying the original matrix with the inverse matrix.

A⋅A−1=[31−4256148]⋅126⋅[16−2426−1028−263−1113]==126⋅[3⋅16+1⋅(−24)+(−4)⋅33⋅(−24)+1⋅28+(−4)⋅113⋅26+1⋅(−26)+(−4)⋅132⋅16+5⋅(−24)+6⋅32⋅(−24)+5⋅28+6⋅(−11)2⋅26+5⋅(−26)+6⋅131⋅16+4⋅(−24)+8⋅31⋅(−24)+4⋅28+8⋅(−11)1⋅26+4⋅(−26)+8⋅13]==126⋅[260002600026]=[100010001]=I