What is cofactor?
If we have a square matrix, say \(\displaystyle A = [a_{ij}]\), then \(\displaystyle C_{ij}\) is the cofactor of the entry \(\displaystyle a_{ij}\).
And \(\displaystyle C_{ij}\) is defined as:
\(\displaystyle C_{ij} = (-1)^{i+j}M_{ij}\), where \(\displaystyle M_{ij}\) is the minor and it is equal to the determinant of \(\displaystyle (n - 1) \times (n - 1)\) matrix by deleting the \(\displaystyle i\)th row and \(\displaystyle j\)th column of \(\displaystyle A\).
Confused? One example and you'll be the master of cofactor expansion
\(\displaystyle \bold{1.} \rightarrow \ \bold{(a)}\)
We can work along the \(\displaystyle i\)th row or along the \(\displaystyle j\)th column. Let us make a decision. We will work along \(\displaystyle i\)th row. We will choose to work along the first row, so
\(\displaystyle \text{det} \ A = \left| \begin{matrix}-4 & 2 \\3 & 3\end{matrix} \right| = -4C_{11} + 2C_{12}\)
\(\displaystyle C_{11} = (-1)^{1+1}M_{11} = M_{11}\)
\(\displaystyle M_{11} \rightarrow\) means delete the first row and delete the first column and take the determinant of what left.
Then,
\(\displaystyle M_{11} = |3| = 3\)
\(\displaystyle C_{11} = 3\)
And
\(\displaystyle C_{12} = (-1)^{1+2}M_{12} = -M_{12}\)
\(\displaystyle M_{12} \rightarrow\) means delete the first row and delete the second column and take the determinant of what left.
Then,
\(\displaystyle M_{12} = |3| = 3\)
\(\displaystyle C_{12} = -3\)
Finally, we have:
\(\displaystyle \text{det} \ A = -4C_{11} + 2C_{12} = -4(3) + 2(-3) = -12 - 6 = -18\)
Easy ha?
I told you!