Cofactor Matrix Calculator


Instructions: Use this calculator to get compute the cofactor matrix associated to a given matrix that you provide. First, click on one of the buttons below to specify the dimension of the matrix.

Then, click on the first cell and type the value, and move around the matrix by pressing "TAB" or by clicking on the corresponding cells, to define ALL the matrix values.


[
]



More about this cofactor matrix calculator.

Cofactors are tightly associated with the inverse of a matrix, and they are stepping stone of the adjoint method used to compute the inverse of a matrix (when it exists).

Probably without knowing about, you have dealt with cofactors when computing a determinant of a matrix of 3x3 or larger. So, as you suspect, cofactors have to do with the determinants obtained when removing one row and one column.

Cofactor Matrix

How do you find the cofactor of a matrix?

The first thing is to compute the minors matrix. So, for a given n x n matrix AA, the element in the i-th row and j-th column of the minors matrix is equal to the determinant of the sub-matrix formed by removing the i-th row and j-th column of the given matrix AA.

So, if we call A[i,j]A[i,j] to the sub-matrix obtained by removing the i-th row and the j-th column of AA, formally we define the matrix of minors, MM as:

Mij=detA[i,j] M_{ij} = \det A[i,j]

Notice that if AA is an n x n matrix, then MM is n x n as well.

So, Whats a cofactor matrix?

Almost there. So the minors is the matrix that contains all these determinant of the corresponding sub-matrices obtained by deleting one row and one column. The cofactor is almost that, except that you add a sign (positive or negative), depending on the i and j.

Indeed, the cofactor matrix, CC is defined as:

Cij=(1)i+jMij=(1)i+jdetA[i,j] C_{ij} = (-1)^{i+j} M_{ij} = (-1)^{i+j} \det A[i,j]

That looks pretty much like what you use when you compute determinants, huh? So, in order to compute the cofactor matrix, you need to compute a bunch of determinants.

How to use this Cofactor matrix calculator with steps

In order to use this cofactor calculator, all you need to do is to provide the matrix AA. The calculator will guide you through the process of computing the minors and the signs to get to the cofactors.

Cofactor Matrix Calculator

Example of cofactor Matrix calculation

Question: Assume you have the following matrix

[121231112] \begin{bmatrix} \displaystyle 1&\displaystyle 2&\displaystyle 1\\[0.6em]\displaystyle 2&\displaystyle 3&\displaystyle 1\\[0.6em]\displaystyle 1&\displaystyle 1&\displaystyle 2 \end{bmatrix}

Solution:We need to compute the cofactor matrix of the 3×33 \times 3 matrix that has been provided.

First we compute the minors matrix. We have that, by definition, the minors matrix MM is defined by the formula

Mij=detAi,j M_{ij} = \det A^{i,j}

where in this case Ai,j A^{i,j} is the matrix AA after deleting row ii and column jj.

Therefore, and based on the matrix AA provided we get the following coefficients of the minors matrix:

For A1,1A^{ 1, 1}:

M11=detA11=3112=3(2)1(1)=5M_{ 1 1} = \det A^{ 1 1} = \begin{vmatrix} \displaystyle 3&\displaystyle 1\\[0.6em]\displaystyle 1&\displaystyle 2 \end{vmatrix} = 3 \cdot \left( 2 \right) - 1 \cdot \left(1 \right) = 5

For A1,2A^{ 1, 2}:

M12=detA12=2112=2(2)1(1)=3M_{ 1 2} = \det A^{ 1 2} = \begin{vmatrix} \displaystyle 2&\displaystyle 1\\[0.6em]\displaystyle 1&\displaystyle 2 \end{vmatrix} = 2 \cdot \left( 2 \right) - 1 \cdot \left(1 \right) = 3

For A1,3A^{ 1, 3}:

M13=detA13=2311=2(1)1(3)=1M_{ 1 3} = \det A^{ 1 3} = \begin{vmatrix} \displaystyle 2&\displaystyle 3\\[0.6em]\displaystyle 1&\displaystyle 1 \end{vmatrix} = 2 \cdot \left( 1 \right) - 1 \cdot \left(3 \right) = -1

For A2,1A^{ 2, 1}:

M21=detA21=2112=2(2)1(1)=3M_{ 2 1} = \det A^{ 2 1} = \begin{vmatrix} \displaystyle 2&\displaystyle 1\\[0.6em]\displaystyle 1&\displaystyle 2 \end{vmatrix} = 2 \cdot \left( 2 \right) - 1 \cdot \left(1 \right) = 3

For A2,2A^{ 2, 2}:

M22=detA22=1112=1(2)1(1)=1M_{ 2 2} = \det A^{ 2 2} = \begin{vmatrix} \displaystyle 1&\displaystyle 1\\[0.6em]\displaystyle 1&\displaystyle 2 \end{vmatrix} = 1 \cdot \left( 2 \right) - 1 \cdot \left(1 \right) = 1

For A2,3A^{ 2, 3}:

M23=detA23=1211=1(1)1(2)=1M_{ 2 3} = \det A^{ 2 3} = \begin{vmatrix} \displaystyle 1&\displaystyle 2\\[0.6em]\displaystyle 1&\displaystyle 1 \end{vmatrix} = 1 \cdot \left( 1 \right) - 1 \cdot \left(2 \right) = -1

For A3,1A^{ 3, 1}:

M31=detA31=2131=2(1)3(1)=1M_{ 3 1} = \det A^{ 3 1} = \begin{vmatrix} \displaystyle 2&\displaystyle 1\\[0.6em]\displaystyle 3&\displaystyle 1 \end{vmatrix} = 2 \cdot \left( 1 \right) - 3 \cdot \left(1 \right) = -1

For A3,2A^{ 3, 2}:

M32=detA32=1121=1(1)2(1)=1M_{ 3 2} = \det A^{ 3 2} = \begin{vmatrix} \displaystyle 1&\displaystyle 1\\[0.6em]\displaystyle 2&\displaystyle 1 \end{vmatrix} = 1 \cdot \left( 1 \right) - 2 \cdot \left(1 \right) = -1

For A3,3A^{ 3, 3}:

M33=detA33=1223=1(3)2(2)=1M_{ 3 3} = \det A^{ 3 3} = \begin{vmatrix} \displaystyle 1&\displaystyle 2\\[0.6em]\displaystyle 2&\displaystyle 3 \end{vmatrix} = 1 \cdot \left( 3 \right) - 2 \cdot \left(2 \right) = -1

Summarizing, the minors matrix is:

M=[531311111]M = \begin{bmatrix} \displaystyle 5&\displaystyle 3&\displaystyle -1\\[0.6em]\displaystyle 3&\displaystyle 1&\displaystyle -1\\[0.6em]\displaystyle -1&\displaystyle -1&\displaystyle -1 \end{bmatrix}

Now, we can compute the elements of the cofactor matrix CC using the formula

Cij=(1)i+jMij C_{ij} = (-1)^{i+j}M_{ij}

The above formula can be used directly because the minors are known already. We get

C11=(1)1+15=(1)25=5 C_{ 1 1} = (-1)^{ 1+1} \cdot 5 = (-1)^{ 2} \cdot 5 = 5 C12=(1)1+23=(1)33=3C_{ 1 2} = (-1)^{ 1+2} \cdot 3 = (-1)^{ 3} \cdot 3 = -3 C13=(1)1+3(1)=(1)4(1)=1C_{ 1 3} = (-1)^{ 1+3} \left(-1\right)= (-1)^{ 4} \left(-1\right) = -1 C21=(1)2+13=(1)33=3C_{ 2 1} = (-1)^{ 2+1} \cdot 3 = (-1)^{ 3} \cdot 3 = -3 C22=(1)2+21=(1)41=1C_{ 2 2} = (-1)^{ 2+2} \cdot 1 = (-1)^{ 4} \cdot 1 = -1 C23=(1)2+3(1)=(1)5(1)=1C_{ 2 3} = (-1)^{ 2+3} \left(-1\right)= (-1)^{ 5} \left(-1\right) = 1 C31=(1)3+1(1)=(1)4(1)=1C_{ 3 1} = (-1)^{ 3+1} \left(-1\right)= (-1)^{ 4} \left(-1\right) = 1 C32=(1)3+2(1)=(1)5(1)=1C_{ 3 2} = (-1)^{ 3+2} \left(-1\right)= (-1)^{ 5} \left(-1\right) = 1 C33=(1)3+3(1)=(1)6(1)=1C_{ 3 3} = (-1)^{ 3+3} \left(-1\right)= (-1)^{ 6} \left(-1\right) = 1

Summarizing, the cofactor matrix is:

C=[531311111]C = \begin{bmatrix} \displaystyle 5&\displaystyle -3&\displaystyle -1\\[0.6em]\displaystyle -3&\displaystyle -1&\displaystyle 1\\[0.6em]\displaystyle 1&\displaystyle 1&\displaystyle 1 \end{bmatrix}

which concludes the calculation.

log in to your account

Don't have a membership account?
REGISTER

reset password

Back to
log in

sign up

Back to
log in