Reading the Determinant from the Diagonal
A diagonal matrix has a simple structure: every entry away from the main diagonal is zero. That structure makes its determinant much easier to compute than a general determinant. Rather than expanding into many terms, we can read the answer directly from the diagonal entries. The formula also makes the effects of zero and negative entries explicit.
For an \(n\times n\) matrix, the main diagonal consists of the entries in positions \((1,1),(2,2),\dots,(n,n)\). A diagonal matrix has zero in every other position. We consider \(n\ge 1\) and real diagonal entries \(d_1,\dots,d_n\).
The determinant of a \(1\times1\) matrix \([d_1]\) is \(d_1\). For a larger matrix, cofactor expansion along the first row says to multiply each entry in that row by its cofactor and add the results. In a diagonal matrix, only the first entry in that row can be nonzero. After deleting its row and column, the remaining matrix is again diagonal. This observation leads to the diagonal-product formula.
Proof. We use induction on the positive integer \(n\). When \(n=1\), the determinant of \([d_1]\) is \(d_1\), which is the stated product. Now suppose \(n\ge2\) and that the formula holds for diagonal matrices of size \(n-1\). Expanding \(\det\mathbf{D}\) along the first row, every term except the first is zero because \(d_{1j}=0\) for \(j\ne1\). The first cofactor has sign \((-1)^{1+1}=1\), and its minor is the diagonal matrix \(\operatorname{diag}(d_2,\dots,d_n)\). Therefore $$ \det\mathbf{D} =d_1\det\bigl(\operatorname{diag}(d_2,\dots,d_n)\bigr) =d_1(d_2\cdots d_n) =d_1d_2\cdots d_n, $$ where the second equality follows from the induction hypothesis. This proves the formula for every \(n\ge1\). \(\square\)
Using the Formula with Zero and Negative Entries
The formula is an ordinary product of real numbers. A zero diagonal entry makes the whole product zero, regardless of the other entries. Negative entries contribute their signs just as they do in any multiplication: an even number of negative factors gives a positive product when none of the factors is zero, while an odd number gives a negative product.
Worked Example: A Four-by-Four Matrix with Negative Entries
Find the determinant of $$ \mathbf{D}= \begin{bmatrix} -2&0&0&0\\ 0&3&0&0\\ 0&0&-1&0\\ 0&0&0&4 \end{bmatrix}. $$
The diagonal entries, in order, are \(-2,3,-1,4\). Applying the formula gives $$ \det\mathbf{D}=(-2)(3)(-1)(4). $$
Multiplying from left to right, \((-2)(3)=-6\), \((-6)(-1)=6\), and \(6(4)=24\). Thus \(\det\mathbf{D}=24\).
Check by cofactor expansion: Expanding first along the first row leaves \((-2)\) times the determinant of the \(3\times3\) diagonal matrix with entries \(3,-1,4\). Expanding that matrix along its first row gives \(3\) times the determinant of the \(2\times2\) diagonal matrix with entries \(-1,4\). The \(2\times2\) determinant is \((-1)(4)-0\cdot0=-4\). Hence the expansions give \((-2)\bigl(3(-4)\bigr)=(-2)(-12)=24\), agreeing with the product.
Worked Example: A Symbolic Diagonal Entry Is Zero
Let \(x,z\in\mathbb{R}\) and consider $$ \mathbf{D}= \begin{bmatrix} -x&0&0\\ 0&0&0\\ 0&0&z \end{bmatrix}. $$ Find its determinant for all real \(x\) and \(z\).
The diagonal-product formula gives $$ \det\mathbf{D}=(-x)(0)(z)=0. $$ This remains true for every choice of \(x\) and \(z\), including choices where one or both of them are zero.
Check by cofactor expansion: Expanding along the first row leaves \((-x)\) times the determinant of \(\begin{bmatrix}0&0\\0&z\end{bmatrix}\). Using the \(2\times2\) formula, that minor has determinant \((0)(z)-(0)(0)=0\). Therefore \(\det\mathbf{D}=(-x)(0)=0\), as the product formula predicts.
Worked Example: Two Negative Symbolic Entries
For real \(a,b,c\), evaluate $$ \det \begin{bmatrix} -a&0&0\\ 0&b&0\\ 0&0&-c \end{bmatrix}. $$
The diagonal entries are \(-a,b,-c\), so their product is $$ (-a)b(-c)=abc. $$ The two negative signs cancel, so the determinant is \(abc\), not \(-abc\). The value may be positive, negative, or zero depending on \(a,b,c\); the expression \(abc\) gives the value in all cases.
Check by cofactor expansion: Expanding along the first row gives \((-a)\) times the determinant of \(\begin{bmatrix}b&0\\0&-c\end{bmatrix}\). The \(2\times2\) determinant is \(b(-c)-0\cdot0=-bc\). Thus the full determinant is \((-a)(-bc)=abc\), agreeing with the diagonal product.
Exactly When Is the Determinant Zero?
The product formula gives a precise test for a zero determinant. Over \(\mathbb{R}\), a product is zero exactly when at least one of its factors is zero. This fact applies no matter how many diagonal entries there are.
Proof. By the diagonal-product formula, \(\det\mathbf{D}=d_1\cdots d_n\). If \(d_i=0\) for some \(i\), this product contains a zero factor, so \(\det\mathbf{D}=0\). Conversely, suppose \(\det\mathbf{D}=0\). If every \(d_i\) were nonzero, then each \(d_i\) would have a real multiplicative inverse. Their product would also have an inverse, namely \(1/(d_1\cdots d_n)\), so \(d_1\cdots d_n\) could not equal zero. This contradicts \(\det\mathbf{D}=0\). Therefore at least one diagonal entry must be zero. \(\square\)
When every diagonal entry is nonzero, the determinant is nonzero. For diagonal matrices, this conclusion requires no further determinant calculation: inspect the diagonal and multiply. The corollary concerns the determinant specifically; it does not require a general criterion for when an arbitrary matrix is invertible.
Common Pitfall: Losing a Negative Sign
A common error is to treat negative diagonal entries as if the determinant were the absolute value of their product. For example, for \(\operatorname{diag}(-2,3,-4)\), one might incorrectly write \(\det\mathbf{D}=-|(-2)(3)(-4)|=-24\). The correction is to multiply the entries with their signs intact: $$ (-2)(3)(-4)=(-6)(-4)=24. $$ There are two negative factors, so their signs cancel. Cofactor checkerboard signs do not add an extra minus sign here: the only nonzero entry in the first row is in position \((1,1)\), whose cofactor sign is \((-1)^{1+1}=1\). Further expansions of the remaining diagonal minors follow the same pattern.
Another useful check is to separate the zero case from the sign case. If any diagonal entry is zero, the determinant is zero, even if other entries are negative. Only when all entries are nonzero does counting the negative factors determine whether the product is positive or negative.
Applying the Formula Reliably
For a matrix to use this formula, it must be square and diagonal. A matrix with nonzero entries away from the diagonal is not diagonal, even if most of its entries are zero. For a diagonal matrix, keep the order of the diagonal entries when writing the product, preserve every negative sign, and check whether any factor is zero before deciding the sign.
Check that the matrix is square and every off-diagonal entry is zero.
List the entries \(d_1,\dots,d_n\) from top left to bottom right.
Compute \(d_1\cdots d_n\); any zero factor makes the result zero.
For a small matrix, a cofactor expansion along the first row reduces to the same product calculation.
The key point is that the determinant of a diagonal matrix is the product of its diagonal entries, not the product of their absolute values. The formula follows directly from cofactor expansion because each first row has only one potentially nonzero term, and the minor left behind has the same diagonal structure.
Check Your Understanding
Use the diagonal-product formula, and show enough arithmetic to make the sign and zero cases clear.
- Find the determinant of \(\operatorname{diag}(2,-5,3)\).
- For real \(r,s\), evaluate the determinant of \(\operatorname{diag}(r,0,-s,2)\).
- Evaluate the determinant of \(\operatorname{diag}(-a,-b,-c)\) in terms of \(a,b,c\).
- State and justify when \(\operatorname{diag}(d_1,\dots,d_n)\) has determinant zero.
- Explain why the determinant of \(\operatorname{diag}(-2,3,-4)\) is not \(-24\).