TITLE: Determinant of a block matrix including non-square matrices
QUESTION [7 upvotes]: I am trying to find a nice way of computing the determinant of the matrix
\begin{equation}
M=
\begin{bmatrix}
A & B \\ C & D
\end{bmatrix} \in \mathbb{R}^{T\times T}
\end{equation}
where $A \in \mathbb{R}^{M\times N}$, $B \in \mathbb{R}^{M\times (T-N)}$, $C \in \mathbb{R}^{(T-M)\times N}$ and $D \in \mathbb{R}^{(T-M)\times (T-N)}$. Furthermore, $(A)_{i,j} = f_i(x_j)$, $(C)_{i,j} = g_i(x_j)$ where $f$ and $g$ are differentiable functions. 
I know there are nice ways to compute it when either $A$ or $D$ are invertible but is there a way to do it in the more general case above?
When $A$ is invertible, 
$$|M|=|A||D-CA^{-1}B|$$
 A similar formula holds when $D$ is invertible. The question is specifically if such formulas can be extended to give $|M|$ in the case where neither $A$ nor $D$ is invertible (indeed, both could be non-square).

REPLY [2 votes]: We suppose the following matrix multiplication by the original matrix and own transposed form:
$$
\begin{aligned}
MM^{\text{T}}=&
\begin{bmatrix}
A & B \\
C & D
\end{bmatrix}
\begin{bmatrix}
A^{\text{T}} & C^{\text{T}} \\
B^{\text{T}} & D^{\text{T}}
\end{bmatrix}
\\=&
\begin{bmatrix}
AA^{\text{T}}+BB^{\text{T}} & AC^{\text{T}}+BD^{\text{T}} \\
CA^{\text{T}}+DB^{\text{T}} & CC^{\text{T}}+DD^{\text{T}}
\end{bmatrix}
\end{aligned}
$$
Then, each diagonal block matrix becomes a square form. Therefore we can apply the determinant formula of a block matrix:
$$
\begin{aligned}
\det(MM^{\text{T}})=&\det(M)^2 \\=&
\det\left|
\begin{array}{cc}
AA^{\text{T}}+BB^{\text{T}} & AC^{\text{T}}+BD^{\text{T}} \\
CA^{\text{T}}+DB^{\text{T}} & CC^{\text{T}}+DD^{\text{T}}
\end{array}
\right|
\geq 0
\end{aligned}
$$
Hence we obtain:
$$
\begin{aligned}
&\det(M)= \\ \pm& \sqrt{
\det
\Big(
AA^{\text{T}}+BB^{\text{T}}
\Big) 
\det
\Big(
(CC^{\text{T}}+DD^{\text{T}})-
(CA^{\text{T}}+DB^{\text{T}})
(AA^{\text{T}}+BB^{\text{T}})^{-1}
(AC^{\text{T}}+BD^{\text{T}})
\Big)
}
\end{aligned}
$$