Compute the determinant of a 3x3 matrix by expanding along row 1. For each entry a_1j, the 2x2 minor M_1j is computed by deleting row 1 and column j; the cofactor is C_1j = (-1)^(1+j) * M_1j. An accumulator collects the products a_1j * C_1j one term at a time.

Example

Compute cofactors along row one and accumulate the determinant.

highlighted = computed this step

Step 1 — Set up

Start with the given matrix data.

A=[211032104]A=\begin{bmatrix}2&1&-1\\0&3&2\\1&0&4\end{bmatrix}

Step 2 — Minor and cofactor 1

Compute cofactor 1: minor 3*4-2*0=12; sign (-1)^(1+1)=1; cofactor 12.

M11=3420=12,(1)1+1M11=12M_{11}=3\cdot 4-2\cdot 0=12,\quad (-1)^{1+1}\cdot M_{11}=\hl{12}

Step 3 — Minor and cofactor 2

Compute cofactor 2: minor 0*4-2*1=-2; sign (-1)^(1+2)=-1; cofactor 2.

M12=0421=2,(1)1+2M12=2M_{12}=0\cdot 4-2\cdot 1=-2,\quad (-1)^{1+2}\cdot M_{12}=\hl{2}

Step 4 — Minor and cofactor 3

Compute cofactor 3: minor 0*0-3*1=-3; sign (-1)^(1+3)=1; cofactor -3.

M13=0031=3,(1)1+3M13=-3M_{13}=0\cdot 0-3\cdot 1=-3,\quad (-1)^{1+3}\cdot M_{13}=\hl{-3}

Step 5 — Add term 1

Add determinant term: 0 + 24 = 24.

detsum=24det_sum=\hl{24}

Step 6 — Add term 2

Add determinant term: 24 + 2 = 26.

detsum=26det_sum=\hl{26}

Step 7 — Add term 3

Add determinant term: 26 + 3 = 29.

detsum=29det_sum=\hl{29}

Step 8 — Result

Read the determinant: det = 29.

det=29,det(A)=29det=\hl{29},\quad \det(A)=29
cofactor expansion det(A) = sum over j of a_1j * C_1j, where C_1j = (-1)^(1+j) * M_1j and M_1j is the determinant of the 2x2 submatrix formed by deleting row 1 and column j.