Given
A=
\begin{pmatrix} A & B \\
C & D \end{pmatrix}
.
Determine the entries \color{blue}a, b, c,d
such that
A^{-1} = \begin{pmatrix}
\color{blue}{a} & \color{blue}{b} \\ \color{blue}{c} & \color{blue}{d} \end{pmatrix}
.
\color{blue}a
=
D/det
\color{blue}b
=
-B/det
\color{blue}c
=
-C/det
\color{blue}d
=
A
One approach is using the determinant: here it's \det(A) = det
and afterwards
using the formula to get
A^{-1}=
\dfrac 1{det}\begin{pmatrix} D & -B \\
-C & A \end{pmatrix}
=\begin{pmatrix} fractionReduce(D,det) & fractionReduce(-B,det) \\
fractionReduce(-C,det) & fractionReduce(A,det)\end{pmatrix}
.
Without the determinant, compute:
\begin{pmatrix} A & B \\
C & D \end{pmatrix} \cdot
\begin{pmatrix} \color{blue}{a} & \color{blue}{b} \\ \color{blue}{c} & \color{blue}{d} \end{pmatrix}
=\begin{pmatrix} 1 & 0\\
0 & 1\end{pmatrix}
and solve the 4 \times 4
linear system of equations.