<s>[INST] Calculating inverse matrices directly I'm trying to find the inverse matrix of 
$$ \begin{bmatrix}
  3 & 4 \\
  6 & 2
 \end{bmatrix}$$
I set up the following equation: 
$$
\begin{bmatrix}
  a & b \\
  c & d
 \end{bmatrix}
\,
\begin{bmatrix}
  3 & 4 \\
  6 & 2
 \end{bmatrix}
= 
\begin{bmatrix}
  1 & 0 \\
  0 & 1
 \end{bmatrix}
$$
So 
\begin{cases}
3a+6b = 1 \\[4px]
4a+2b = 0 \\[4px]
3c+6d = 1 \\[4px]
4c+2d = 0
\end{cases}
I solve $a,b,c,d$ and get 
\begin{cases}
a = \dfrac{1}{-9} \\[4px]
b = \dfrac{4}{18} \\[4px]
c = \dfrac{1}{-9} \\[4px]
d = \dfrac{4}{18}
\end{cases}
But I get $c,d$ wrong. They are supposed to be 
\begin{cases}
c = \dfrac{6}{18} \\[4px]
d = \dfrac{-3}{18}
\end{cases}
Why does my way not work?
 [/INST] You just switched $1$ with $0$ in the last two equations.
However, for $2\times2$ matrices there's a very simple method. Provided $ad-bc\ne0$, we have
$$
\begin{bmatrix} a & b \\ c & d\end{bmatrix}^{-1}=
\frac{1}{ad-bc}
\begin{bmatrix} d & -b \\ -c & a\end{bmatrix}
$$

Switch the diagonal elements and change the sign to the nondiagonal one, then divide by the determinant.

This can be verified by doing the multiplication.
In your case, $ad-bc=6-24=-18$, so
$$
\begin{bmatrix} 3 & 4 \\ 6 & 2 \end{bmatrix}^{-1}=
-\frac{1}{18}
\begin{bmatrix} 2 & -4 \\ -6 & 3\end{bmatrix}=
\begin{bmatrix}-1/9 & 2/9 \\ 1/3 & -1/6 \end{bmatrix}
$$
Important note. This cannot be extended to bigger matrices.
</s>