Wolfram Research

Function Repository Resource:

CofactorMatrix

Source Notebook

Give the matrix of cofactors for a given input matrix

Contributed by: Wolfram|Alpha math team

ResourceFunction["CofactorMatrix"][mat]

gives the cofactor matrix of the matrix mat.

Examples

Basic Examples

Find the matrix of cofactors of an input matrix:

In[1]:=
ResourceFunction["CofactorMatrix"][{{3, 2, 5}, {4, 3, -1}, {2, 3, 4}}]
Out[1]=

The identity matrix is equal to its own cofactor matrix:

In[2]:=
ResourceFunction["CofactorMatrix"][{{1, 0}, {0, 1}}]
Out[2]=

Find the matrix of cofactors of another matrix:

In[3]:=
ResourceFunction["CofactorMatrix"][{{3, 0, 2}, {2, 0, -2}, {0, 1, 1}}]
Out[3]=

Find the cofactor matrix of a matrix having symbolic elements:

In[4]:=
ResourceFunction[
 "CofactorMatrix"][{{1, 1, 1}, {a^2, a, 1}, {b^2, b, 1}}]
Out[4]=

Scope

CofactorMatrix returns unevaluated for non-square matrix input:

In[5]:=
ResourceFunction["CofactorMatrix"][Sin[x]]
Out[5]=
In[6]:=
ResourceFunction["CofactorMatrix"][{{3, 0}, {2, 0}, {0, 1}}]
Out[6]=

Resource History

See Also

License Information