another way to find inverse matrix The most common way to find inverse matrix is $M^{-1}=\frac1{\det(M)}\mathrm{adj}(M)$. However it is very trouble to find when the matrix is large.
I found a very interesting way to get inverse matrix and I want to know why it can be done like this. For example if you want to find the inverse of $$M=\begin{bmatrix}1 & 2 \\ 3 & 4\end{bmatrix}$$
First, write an identity matrix on the right hand side and carry out some steps:
$$\begin{bmatrix}1 & 2 &1 &0 \\ 3 & 4&0&1\end{bmatrix}\to\begin{bmatrix}1 & 2 &1 &0 \\ 3/2 & 2&0&1/2\end{bmatrix}\to\begin{bmatrix}1/2 & 0 &-1 &1/2 \\ 3/2 & 2&0&1/2\end{bmatrix}\to\begin{bmatrix}3/2 & 0 &-3 &3/2 \\ 3/2 & 2&0&1/2\end{bmatrix}$$
$$\to\begin{bmatrix}3/2 & 0 &-3 &3/2 \\ 0 & 2&3&-1\end{bmatrix}\to\begin{bmatrix}1 & 0 &-2 &1 \\ 0 & 2&3&-1\end{bmatrix}\to\begin{bmatrix}1 & 0 &-2 &1 \\ 0 & 1&3/2&-1/2\end{bmatrix}$$
You can 1. swap any two row of the matrix 2. multiply a constant in any row 3. add one row to the other row. Just like you are doing Gaussian elimination. when the identical matrix shift to the left, the right hand side become
$$M^{-1}=\begin{bmatrix}-2 &1 \\3/2&-1/2\end{bmatrix}$$
How to prove this method work?
 A: This is a very standard method; if you discovered it on your own, congratulations! It works because each of the elementary row operations that you’re performing is equivalent to multiplication by an elementary matrix. To convert $A$ to $I$, you perform some sequence of elementary row operations, which in effect is multiplying $A$ by a sequence of elementary matrices:
$$I=(E_mE_{m-1}\ldots E_2E_1)A\;,$$
say, if it took $m$ row operations. This says that $E_mE_{m-1}\ldots E_2E_1$ is $A^{-1}$. (Well, actually it says that $E_mE_{m-1}\ldots E_2E_1$ is a left inverse for $A$, but there’s a theorem that says that a left inverse of a square matrix is actually the inverse of the matrix.)
You’ve performed exactly the same operations to $I$ on the other side of the augmented matrix, so on that side you end up with
$$E_mE_{m-1}\ldots E_2E_1I=E_mE_{m-1}\ldots E_2E_1\;,$$
which we just saw is $A^{-1}$.
Thus, if you start with $\begin{bmatrix}A\mid I\end{bmatrix}$, you’re guaranteed to end up with $\begin{bmatrix}I\mid A^{-1}\end{bmatrix}$, exactly as you discovered.
A: The method you describe is called the Gauss-Jordan method. There is a nice description and an informal discussion of why it works here.
It's much more efficient and stable than the method based on determinants and adjugates. In practice, you would not use the determinant/adjugate method except for very small matrices (of size 2 or 3).
A: This is probably the standard way to compute the inverse of a matrix.
Suppose $AB = I$.  Looking at this equation column by column, we see that $Ab_1 = e_1,\ldots, A b_n = e_n$, where $b_1,\ldots,b_n$ are the columns of $B$ and $\{e_1,\ldots,e_n\}$ is the standard basis of $\mathbb R^n$.
Thus, to compute the inverse of $A$, we need to solve the equations
$Ax_1 = e_1,\ldots, Ax_n = e_n$.  These equations are all solved at once by Gaussian elimination in the method you described.
A: Because when you are performing Gauss reduction and elimination to
$$
(A \ \vert \ I) \ ,
$$
what your are doing in fact is finding the solutions of all these linear systems:
$$
AX_1 = e_1 , \dots , AX_n = e_n \ . 
$$
Aren't you?
So, the matrix formed by the columns $X_1, \dots , X_n$ is the inverse of $A$:
$$
A^{-1} = (X_1 \dots X_n) \ .
$$
If you did it one by one, the solution of every system would appear on the right at the end of the process:
$$
(A \ \vert \ e_i) \longrightarrow \dots \longrightarrow (I \ \vert \ X_i) \ .
$$
Hence, if you do it in one go,
$$
(A \ \vert \ I) = (A \ \vert \ e_1 \dots e_n) \longrightarrow \dots \longrightarrow (I \ \vert\ X_1\dots X_n) = (I \ \vert \ A^{-1}) \ ,
$$
the inverse of $A$ appears  where it should.
