TITLE: How can we prove Sylvester's determinant identity?
QUESTION [40 upvotes]: Sylvester's determinant identity states that if $A$ and $B$ are matrices of sizes $m\times n$ and $n\times m$, then 
$$ \det(I_m+AB) = \det(I_n+BA)$$ 
where $I_m$ and $I_n$ denote the $m \times m$ and $n \times n$ identity matrices, respectively.
Could you sketch a proof for me, or point to an accessible reference?

REPLY [12 votes]: We will calculate $\det\begin{pmatrix} I_m & -A \\ B & I_n \end{pmatrix}$ in two different ways. We have 
$$ \det\begin{pmatrix} I_m & -A \\ B & I_n \end{pmatrix} 
  = \det\begin{pmatrix} I_m & 0 \\ B & I_n + BA \end{pmatrix} = \det(I_n + BA). $$
On the other hand, 
$$ \det\begin{pmatrix} I_m & -A \\ B & I_n \end{pmatrix} 
  = \det\begin{pmatrix} I_m+AB & 0 \\ B & I_n  \end{pmatrix} = \det(I_m + AB). $$