# 1.1.6 Inverse matrix
A matrix is said to be invertible if $AA^{-1} = I = A^{-1}A$ where A is a square matrix
The inverse of the product of two invertible matrices is equal to the product of the matrix inverses
$$
(AB)^{-1} = A^{-1}B^{-1}
$$
The inverse of a transpose matrix is equal to the transpose of an inverse matrix
$$
(A^T)^{-1} = (A^{-1})^T
$$
The following is a derivation of the equation to invert a matrix
$$
A = \begin{bmatrix}
a & b \\
c & d \\
\end{bmatrix} \\
A^{-1} = \begin{bmatrix}
x_1 & x_2 \\
y_1 & y_2 \\
\end{bmatrix}
$$
We know that
$$
A A^{-1} = I \\
\begin{bmatrix} a & b \\
c & d \\
\end{bmatrix} \begin{bmatrix}
x_1 & x_2 \\
y_1 & y_2 \\
\end{bmatrix} =
\begin{bmatrix} 1 & 0 \\
0 & 1
\\ \end{bmatrix}
$$
Therefore
$$
a x_1 + by_1 = 1 \\
a x_2 + by_2 = 0 \\
c x_1 + dy_1 = 0 \\
c x_2 + dy_2 = 1
$$
Rearranging the two middle equations gives
$$
y_1=\dfrac{-c}{d} x_1 \\
y_2=\dfrac{-a}{b} x_2
$$
Substituting into the top equation
$$
a x_1 + b \dfrac{-c}{d} x_1 = 1 \\
x_1\left(a + \dfrac{-bc}{d}\right) = 1 \\
x_1 = \dfrac{1}{\left(a + \dfrac{-bc}{d}\right)} \\
x_1 = \dfrac{d}{ad-bc} \\
y_1 = \dfrac{-c}{d}\dfrac{d}{ad-bc} \\
y_1 = \dfrac{-c}{ad-bc}
$$
And then the bottom equation
$$
c x_2 + d \dfrac{-a}{b} x_2 = 1 \\
x_2\left(c + \dfrac{-ad}{b}\right) = 1 \\
x_2 = \dfrac{1}{\left(c + \dfrac{-ad}{b}\right)} \\
x_2 = \dfrac{-b}{ad-bc} \\
y_2 = \dfrac{-a}{b}\dfrac{-b}{ad-bc} \\
y_2 = \dfrac{a}{ad-bc}
$$
Therefore
$$
A^{-1} = \dfrac{1}{ad-bc}
\begin{bmatrix}
d & -b \\
-c & a
\end{bmatrix}
$$
Where $\dfrac{1}{ad-bc}$ is the matrix *determinant*