The inverse of a $2\times2$ matrix is given by swapping the diagonal entries, negating the off-diagonal entries, and dividing by the determinant: $$\begin{pmatrix}a&b\\c&d\end{pmatrix}^{-1} = \frac{1}{ad-bc} \begin{pmatrix}d & -b \\ -c & a\end{pmatrix}$$