# Determinant of $I-aa^T+bb^T$

Are there any nice formulas for exactly computing the determinant of identity - rank 2 matrix, e.g.

$$\det(M) = \det(I-aa^T+bb^T)?$$

Here we cannot assume that $a$ and $b$ are orthogonal. ($a^Tb > 0$.)

I think it is ok to use projections on range spaces, e.g.

$$proj_{range(a)} = \frac{1}{a^Ta} aa^T, \quad proj_{range(a)^\perp} = I - \frac{1}{a^Ta} aa^T.$$

But the answer is still not clear to me.

Thanks!

• Sylvester's determinant identity: $\det(I+AB) = \det(I+BA)$ where $A = \pmatrix{a & b}$, $B = \pmatrix{-a^T\cr b^T}$. – Robert Israel Aug 8 '18 at 1:04
• I was suprised when I found out that $\det(I - ab^T) = \det(I - a^Tb)$. (Note that the matrix on the left is not the same size as the one on the right.). I wonder if this can be generalized to your problem? – steven gregory Aug 8 '18 at 1:05
• Thanks to both of you! This identity is very slick! – Y. S. Aug 8 '18 at 1:26

In particular, we first need to find $(\mathbf I - \mathbf a \mathbf a^{\mathsf T})^{-1}$, which by the Woodbury identity (or by some of its special cases) is $\mathbf I + \frac{\mathbf a \mathbf a^{\mathsf T}}{1 - \mathbf a \boldsymbol{\cdot} \mathbf a}$. Next, plug this into $$\det(\mathbf I - \mathbf a \mathbf a^{\mathsf T} + \mathbf b \mathbf b^{\mathsf T}) = (1 + \mathbf b^{\mathsf T}(\mathbf I - \mathbf a \mathbf a^{\mathsf T})^{-1} \mathbf b) \det(\mathbf I - \mathbf a \mathbf a^{\mathsf T})$$ and apply the matrix determinant lemma to $\det(\mathbf I - \mathbf a \mathbf a^{\mathsf T})$. The final answer should be $$\det(\mathbf I - \mathbf a \mathbf a^{\mathsf T} + \mathbf b \mathbf b^{\mathsf T}) = (1 + \mathbf b \boldsymbol\cdot \mathbf b)(1-\mathbf a\boldsymbol\cdot \mathbf a) + (\mathbf a \boldsymbol\cdot \mathbf b)^2.$$