Introduction

let's say you have a 2D Matrix of this form : $$A = \begin{pmatrix} a & b\\ c & d \end{pmatrix}

And you want to calculate the determinant of a such matrix well there is a formula for it : $$ det(A) = ad-bc$$

Calculating the inverse

Once you have the determinant of a such matrix, you can easily calculate the inverse : $$A^{-1} = \frac{1}{det(A)}\begin{pmatrix} d & -b\\ -c & a \end{pmatrix} $$

$$ = \frac{1}{ad-bc}\begin{pmatrix} d & -b\\ -c & a \end{pmatrix} $$

$$ = \begin{pmatrix} \frac{d}{ad-bc} & \frac{-b}{ad-bc}\\ \frac{-c}{ad-bc} & \frac{a}{ad-bc} \end{pmatrix} $$

Conclusion

The end might be complicted but this is just putting the factor inside the matrix, inverting matrices can be important especially when you want to master the Euclidean space, being able to invert a 2d matrix will let you be able to change your coordinates from one base to an other etc...