# Determinant of diagonal plus constant matrix [duplicate]

Is there a way to simplify $$\det(D + C)$$, where $$D,C$$ are square matrices of matching dimensions, $$D$$ is diagonal (with different diagonal elements, $$D_{ij} = \delta_{ij}d_i$$), and $$C$$ is a constant matrix, that is, all entries $$C_{ij}=c$$ are equal to the same number?

To be more explicit, assuming $$D,C\in\mathbb{R}^{n\times n}$$, the matrix $$D+C$$ has the form:

$$D + C = \left(\begin{array}{ccccc} d_1 + c & c & c & \cdots & c\\ c & d_2 + c & c & \cdots & c\\ c & c & d_3 + c & \cdots & c\\ \vdots & \vdots & \vdots & & \vdots\\ c & c & c & \cdots & d_n + c \end{array}\right)$$

## marked as duplicate by José Carlos Santos, darij grinberg, Community♦Sep 26 '18 at 16:40

• If you subtract the first row from all other rows, then the resulting matrix has a particular structure. – daw Sep 26 '18 at 14:35
• What if row one is subtracted from all other rows? That would be simpler to find det. – coffeemath Sep 26 '18 at 14:36
• Following @YvesDaoust suggestion, another idea might be to take $det(D+C)$ to be the computation of the characteristic polynomial of the matrix $C$ (well, take $-D$ instead of $D$). As $C$ has $n-1$ vectors in the kernel and 1 eigenvalue $n\cdot c$, the characteristic polynomial should be easy to be written explicitely – Guillermo Mosse Sep 26 '18 at 14:42
• @YvesDaoust note that the entries of the diagonal are distinct, $D_{ij} = \delta_{ij}d_i$. – becko Sep 26 '18 at 14:48
• @GuillermoMosse note that the diagonal of $D$ has distinct elements (see edit). – becko Sep 26 '18 at 15:02

$$\left(\begin{array}{cccccc} d_1 + c & c & c & \cdots & c & c\\ - d_1 & d_2 & 0 & 0 & \cdots & 0\\ - d_1 & 0 & d_3 & 0 & \cdots & 0\\ - d_1 & 0 & 0 & d_4 & \cdots & 0\\ \vdots & \vdots & \vdots & \vdots & & \vdots\\ - d_1 & 0 & 0 & 0 & \cdots & d_n \end{array}\right)$$
$$\det(C+D)=\left( 1 + c \sum_{i = 1}^n d_i^{- 1} \right) d_1 d_2 \ldots d_n$$
• Note that if some of the $d_1, d_2, \ldots, d_n$ equals $0$, then the right hand side needs to be first expanded and then evaluated (note that no negative powers are left after the expansion). – darij grinberg Sep 26 '18 at 16:27
• @darijgrinberg Also in this case the sum reduces to a single term (the one not containing the zero $d_i$). If there are two or more zero $d_i$s, the determinant is zero. – becko Sep 26 '18 at 18:33