# Calculate the determinant of the matrix using cofactor expansion along the first row

The problem:

A block diagonal matrix is a square matrix where nonzero element occurs in blocks along the diagonal. an example of a 4x4 block diagonal matrix with two 2x2 blocks is

$$A_{} = \begin{pmatrix} {1} & {2} & {0} & {0} \\ {3} & {4} & {0} & {0} \\ {0} & {0} & {5} & {6} \\ {0} & {0} & {7} & {8} \\ \end{pmatrix}$$

Calculate the determinant of the matrix by hand using cofactor expansion along the first row

I'am confusing with all the zeros in the matrix, and using cofactor expansion along the first row? Could someone explain how to solve this kind of problem?

$$\det A = 1 \cdot (-1)^{1 + 1} \det S_{11} + 2 \cdot (-1)^{1+2} \det S_{12} + 0 \cdot \dotsb + 0 \cdot \dotsb$$ with $$S_{11} = \begin{pmatrix} \times & \times & \times & \times \\ \times & 4 & 0 & 0 \\ \times & 0 & 5 & 6 \\ \times & 0 & 7 & 8 \end{pmatrix} = \begin{pmatrix} 4 & 0 & 0 \\ 0 & 5 & 6 \\ 0 & 7 & 8 \end{pmatrix} \\ S_{12} = \begin{pmatrix} \times & \times & \times & \times \\ 3 & \times & 0 & 0 \\ 0 & \times & 5 & 6 \\ 0 & \times & 7 & 8 \end{pmatrix} = \begin{pmatrix} 3 & 0 & 0 \\ 0 & 5 & 6 \\ 0 & 7 & 8 \end{pmatrix}$$ where $S_{ij}$ is the matrix $A$ with row $i$ and column $j$ removed.
The determinants of $S_{11}$ and $S_{12}$ are then calculated again by expansion along the first row, e.g. $$\det S_{11} = 4 \cdot (-1)^{1+1} \det \begin{pmatrix} \times & \times & \times \\ \times & 5 & 6 \\ \times & 7 & 8 \end{pmatrix} = 4 \det \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} \\ \det S_{12} = 3 \cdot (-1)^{1+1} \det \begin{pmatrix} \times & \times & \times \\ \times & 5 & 6 \\ \times & 7 & 8 \end{pmatrix} = 3 \det \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}$$ until one hits a $2\times2$ matrix where one knows the direct formula.