In mathematics, a cofactor is a component of a matrix computation of the matrix determinant.
Let M be a square matrix of size n. The (i,j) minor refers to the determinant of the (n-1)×(n-1) submatrix Mi,j formed by deleting the i-th row and j-th column from M (or sometimes just to the submatrix Mi,j itself). The corresponding cofactor is the signed determinant
![{\displaystyle (-1)^{i+j}\det M_{i,j}.\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b77318e35645188f18ada65e7c58714966faca64)
The adjugate matrix adj M is the square matrix whose (i,j) entry is the (j,i) cofactor. We have
![{\displaystyle M\cdot \mathop {\mbox{adj}} M=(\det M)I_{n}=\mathop {\mbox{adj}} M\cdot M,\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/924e9f69a8450c11de07d46ac92a4c6d7ed34d41)
which encodes the rule for expansion of the determinant of M by any the cofactors of any row or column.
This expression shows that if det M is invertible, then M is invertible and the matrix inverse is determined as
![{\displaystyle M^{-1}=(\det M)^{-1}\mathop {\mbox{adj}} M.\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b658177fde552347778c114e5c6ff4a5ea37efa7)
Example
Consider the following example matrix,
![{\displaystyle M={\begin{pmatrix}a_{1}&a_{2}&a_{3}\\b_{1}&b_{2}&b_{3}\\c_{1}&c_{2}&c_{3}\\\end{pmatrix}}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/cea2f378cd292cdd940fba75f53fa72f4e2bc4ea)
Its minors are the determinants (bars indicate a determinant):
![{\displaystyle M_{11}={\begin{vmatrix}b_{2}&b_{3}\\c_{2}&c_{3}\\\end{vmatrix}}\quad M_{12}={\begin{vmatrix}b_{1}&b_{3}\\c_{1}&c_{3}\\\end{vmatrix}}\quad M_{13}={\begin{vmatrix}b_{1}&b_{2}\\c_{1}&c_{2}\\\end{vmatrix}}\quad M_{21}={\begin{vmatrix}a_{2}&a_{3}\\c_{2}&c_{3}\\\end{vmatrix}}\quad M_{22}={\begin{vmatrix}a_{1}&a_{3}\\c_{1}&c_{3}\\\end{vmatrix}}\quad }](https://wikimedia.org/api/rest_v1/media/math/render/svg/1873599186259c36a1ea38431a8b46d093867cb0)
![{\displaystyle M_{23}={\begin{vmatrix}a_{1}&a_{2}\\c_{1}&c_{2}\\\end{vmatrix}}\quad M_{31}={\begin{vmatrix}a_{2}&a_{3}\\b_{2}&b_{3}\\\end{vmatrix}}\quad M_{32}={\begin{vmatrix}a_{1}&a_{3}\\b_{1}&b_{3}\\\end{vmatrix}}\quad M_{33}={\begin{vmatrix}a_{1}&a_{2}\\b_{1}&b_{2}\\\end{vmatrix}}\quad }](https://wikimedia.org/api/rest_v1/media/math/render/svg/8277b52f6fdf16f3ff70a93c334e08b6f95d46f0)
The adjugate matrix of M is
![{\displaystyle \mathrm {adj} M=A={\begin{pmatrix}M_{11}&-M_{21}&M_{31}\\-M_{12}&M_{22}&-M_{32}\\M_{13}&-M_{23}&M_{33}\\\end{pmatrix}},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f8360dba1fb39377b4be50c5096bcd9c75e75a6b)
and the inverse matrix is
![{\displaystyle M^{-1}=|M|^{-1}A\,.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/bed61d9ef31ee8b15c710f2d91d062de5ee7823f)
Indeed,
![{\displaystyle {\begin{aligned}\left(M\;M^{-1}\right)_{11}&=|M|^{-1}\left(a_{1}M_{11}-a_{2}M_{12}+a_{3}M_{13}\right)={\frac {|M|}{|M|}}=1\\\left(M\;M^{-1}\right)_{21}&=|M|^{-1}\left(b_{1}M_{11}-b_{2}M_{12}+b_{3}M_{13}\right)=|M|^{-1}\left[b_{1}(b_{2}c_{3}-b_{3}c_{2})-b_{2}(b_{1}c_{3}-b_{3}c_{1})+b_{3}(b_{1}c_{2}-b_{2}c_{1})\right]=0,\\\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/666c962980956d9194404c9e3af6f0e44d9db2f2)
and the other matrix elements of the product follow likewise.
References