Identity relating coefficients of degrees $0$ and $1$ from characteristic polynomials

Let $M = A - I$. We have $p(t) = \det(M - tI)$, and the columns of $M$ all have sum zero.

The matrix $B$ that you describe can be written as $$ B = M + e_n(e^T - e_n^TM), $$ where $e = (1,1,\dots,1)$ and $e_n = (0,\dots,0,1)$ are column-vectors. By the matrix determinant lemma, we have $$ \det(B) = \det(M) + (e^T - e_n^TM)\operatorname{adj}(M)e_n, $$ where adj denotes the adjugate. Because $M$ is not invertible, $\det(M)$ and $M\operatorname{adj}(M)$ must be zero. Thus, this simplifies to $$ \det(B) = e^T \operatorname{adj}(M)e_3 = e_1^T\operatorname{adj}(M)e_n + e_2^T\operatorname{adj}(M)e_n + \cdots + e_n^T\operatorname{adj}(M)e_n. $$ This can be expanded as $$ \det(B) = C_{11} + C_{12} + \cdots + C_{1n} $$ where the $C_{ij}$ denote cofactors. If $M$ has rank $n-2$ or less, then all cofactors are zero, which means that $\det(B) = 0$. Otherwise, because $\operatorname{adj}(M)M = 0$, we may conclude that the rows of $\operatorname{adj}(M)$ must be constant, from which we may conclude that $C_{ij} = C_{jj}$ for all $i,j$.

On the other hand, it is known that the coefficient that you're looking for can be expressed as the sum of all size $n-1$ principal minors of $M$. That is, your coefficient is equal to $$ \operatorname{tr}(\operatorname{adj}(M))) = C_{11} + C_{22} +\cdots + C_{nn}. $$ So, if $M$ has rank smaller than $n-1$, both quantities are zero. Otherwise, the above shows that they are still equal.

Thus, the two quantities are indeed equal in all cases.


Let $P$ be the matrix obtained by filling the last row of $I$ by ones. Then $$ P(A-I)P^{-1}=\pmatrix{X&y\\ 0&0} \ \text{ and }\ P(A-I+e_ne^T)P^{-1}=\pmatrix{X&y\\ 0&1} $$ for some $(n-1)$-rowed square matrix $X$ and some vector $y$. Note that if you add the first $n-1$ rows of $A-I+e_ne_n^T$ to the last row, you get $B$. Therefore $$ \det(B)=\det(A-I+e_ne^T)=\det(X). $$ Hence the coefficient of $t$ in $\det(A-I-tI)=\det\left(P(A-I)P^{-1}-tI\right)=-t\det(X-tI)$ is $-\det(X)=-\det(B)$.