In[]:=

Basic Examples

Find the matrix of cofactors of an input matrix:
In[]:=
[◼]
CofactorMatrix
[{{3,2,5},{4,3,-1},{2,3,4}}]
Out[]=
{{15,-18,6},{7,2,-5},{-17,23,1}}
The identity matrix is equal to its own cofactor matrix:
In[]:=
[◼]
CofactorMatrix
[{{1,0},{0,1}}]
Out[]=
{{1,0},{0,1}}
Find the matrix of cofactors of another matrix:
In[]:=
[◼]
CofactorMatrix
[{{3,0,2},{2,0,-2},{0,1,1}}]
Out[]=
{{2,-2,2},{2,3,-3},{0,10,0}}
Find the cofactor matrix of a matrix having symbolic elements:
In[]:=
[◼]
CofactorMatrix
[{{1,1,1},{a^2,a,1},{b^2,b,1}}]
Out[]=
{{a-b,-
2
a
+
2
b
,
2
a
b-a
2
b
},{-1+b,1-
2
b
,-b+
2
b
},{1-a,-1+
2
a
,a-
2
a
}}

Scope

CofactorMatrix returns unevaluated for non-square matrix input:
In[]:=
[◼]
CofactorMatrix
[Sin[x]]
Out[]=
[◼]
CofactorMatrix
[Sin[x]]
In[]:=
[◼]
CofactorMatrix
[{{3,0},{2,0},{0,1}}]
Out[]=
[◼]
CofactorMatrix
[{{3,0},{2,0},{0,1}}]