<s>[INST] How to solve linear equation using inversion method? I do not understand the inversion method to solve a pair of linear equations:

2x1 + 4x2 = 4
9x1 + 3x2 = 6

How to solve this? Please clarify steps.
 [/INST] Write in a matrix form $Ax=b$, i.e.
$$\pmatrix{2&4\\9&3}\pmatrix{x_1\\x_2}=\pmatrix{4\\6}$$
Using the following formula of inverse matrix
$$\pmatrix{a&b\\c&d}^{-1}=\frac{1}{a d-bc}\pmatrix{d&-b\\-c&a}$$
one get
$$x=\pmatrix{x_1\\x_2}=A^{-1}b=\frac{1}{2\cdot3-9\cdot4}\pmatrix{3&-4\\-9&2}\pmatrix{4\\6} =\\
-\frac{1}{30}\pmatrix{3\cdot4-4\cdot6\\-9\cdot4+ 2\cdot6}=
-\frac{1}{30}\pmatrix{-12\\-24}=\frac{1}{5}\pmatrix{2\\4} $$
Alternatively one obtain an inverse using matrix ranking
$$\pmatrix{2&4&|&1&0\\9&3&|&0&1}\rightarrow_{swap}\\
\pmatrix{9&3&|&0&1\\2&4&|&1&0}\rightarrow_{\text{second row}\times 4.5}\\
\pmatrix{9&3&|&0&1\\9&18&|&4.5&0}\rightarrow_{row_2=row_2-row_1}\\
\pmatrix{9&3&|&0&1\\0&15&|&4.5&-1}\rightarrow_{row_1=row_1/9,row_1=row_1/15}\\
\pmatrix{1&1/3&|&0&1/9\\0&1&|&3/10&-1/15}\rightarrow_{row_1=row_1-row_2/3}\\
\pmatrix{1&0&|&-1/10&2/15\\0&1&|&3/10&-1/15}
$$
Thus
$$
A^{-1}=\pmatrix{-1/10&2/15\\3/10&-1/15}=\frac{1}{30}\pmatrix{-3&4\\9&-2}
$$
</s>