Alternatively, we can also use row reduction.
Form the augmented matrix [ A | I ] = {\displaystyle [A|I]=} [ 2 1 3 1 0 0 1 0 1 0 1 0 0 1 2 0 0 1 ] {\displaystyle \left[{\begin{array}{ccc|ccc}2&1&3&1&0&0\\1&0&1&0&1&0\\0&1&2&0&0&1\end{array}}\right]}
Interchange R 2 {\displaystyle R_{2}} and R 1 {\displaystyle R_{1}} : [ 1 0 1 0 1 0 2 1 3 1 0 0 0 1 2 0 0 1 ] {\displaystyle \left[{\begin{array}{ccc|ccc}1&0&1&0&1&0\\2&1&3&1&0&0\\0&1&2&0&0&1\end{array}}\right]}
R 2 − 2 R 1 → R 2 {\displaystyle R_{2}-2R_{1}\rightarrow R_{2}} : [ 1 0 1 0 1 0 0 1 1 1 − 2 0 0 1 2 0 0 1 ] {\displaystyle \left[{\begin{array}{ccc|ccc}1&0&1&0&1&0\\0&1&1&1&-2&0\\0&1&2&0&0&1\end{array}}\right]}
R 3 − R 2 → R 3 {\displaystyle R_{3}-R_{2}\rightarrow R_{3}} : [ 1 0 1 0 1 0 0 1 1 1 − 2 0 0 0 1 − 1 2 1 ] {\displaystyle \left[{\begin{array}{ccc|ccc}1&0&1&0&1&0\\0&1&1&1&-2&0\\0&0&1&-1&2&1\end{array}}\right]}
R 1 − R 3 → R 1 {\displaystyle R_{1}-R_{3}\rightarrow R_{1}} : [ 1 0 0 1 − 1 − 1 0 1 1 1 − 2 0 0 0 1 − 1 2 1 ] {\displaystyle \left[{\begin{array}{ccc|ccc}1&0&0&1&-1&-1\\0&1&1&1&-2&0\\0&0&1&-1&2&1\end{array}}\right]}
R 2 − R 3 → R 2 {\displaystyle R_{2}-R_{3}\rightarrow R_{2}} : [ 1 0 0 1 − 1 − 1 0 1 0 2 − 4 − 1 0 0 1 − 1 2 1 ] {\displaystyle \left[{\begin{array}{ccc|ccc}1&0&0&1&-1&-1\\0&1&0&2&-4&-1\\0&0&1&-1&2&1\end{array}}\right]}
Therefore,
A − 1 = [ 1 − 1 − 1 2 − 4 − 1 − 1 2 1 ] . {\displaystyle A^{-1}={\begin{bmatrix}1&-1&-1\\2&-4&-1\\-1&2&1\end{bmatrix}}.}