How to Find the Inverse of a Matrix Step by Step: A Complete Beginner’s Guide
Understanding how to find the inverse of a matrix step by step is an important skill. The inverse of a matrix plays a similar role to the reciprocal of a number in that it undoes the effect of matrix multiplication. Once you learn how to compute it, you can use it to solve systems of equations and understand many concepts in advanced mathematics.
In this guide, you’ll learn what an inverse matrix is and how to calculate it using three different methods, including formulas for 2×2 and diagonal matrices, row operations, and using determinants and the adjoint matrix.
You’ll also see how inverse matrices can be applied to solve systems of linear equations. By the end of this article, you’ll understand how to find a matrix’s inverse.
The following infographic illustrates the concepts covered in this article.
What Is an Inverse Matrix?
Definition
For a square matrix \( A \), the inverse matrix \( A^{-1} \) is the unique matrix satisfying
$$AA^{-1} = A^{-1} A = I.$$
For a review on identity matrices and matrix multiplication, please refer to the article The Ultimate Step-by-Step Guide to Basic Matrix Operations for Beginners.
Example
Example 1: Show $$\begin{bmatrix}
2 & 1 \\
1 & 1
\end{bmatrix}^{-1}
=
\begin{bmatrix}
1 & -1 \\
-1 & 2
\end{bmatrix}.$$
Solution: We show that
$$\begin{bmatrix}
2 & 1 \\
1 & 1
\end{bmatrix}
\begin{bmatrix}
1 & -1 \\
-1 & 2
\end{bmatrix}
=
\begin{bmatrix}
1 & -1 \\
-1 & 2
\end{bmatrix}
\begin{bmatrix}
2 & 1 \\
1 & 1
\end{bmatrix}.$$
Performing matrix multiplication, we get
$$\begin{bmatrix}
2(1) + 1(-1) & 2(-1) + 1(2) \\
1(1) + 1(-1) & 1(-1) + 1(2)
\end{bmatrix}
=
\begin{bmatrix}
1(2) – 1(1) & 1(1) – 1(1) \\
-1(2) + 2(1) & -1(1) + 2(1)
\end{bmatrix}.$$
Multiplying we obtain
$$\begin{bmatrix}
2 – 1 & -2 + 2 \\
1 – 1 & -1 + 2
\end{bmatrix}
=
\begin{bmatrix}
2 – 1 & 1 – 1 \\
-2 + 2 & -1 + 2
\end{bmatrix}.$$
Adding and subtracting, we arrive at
$$\begin{bmatrix}
1 & 0 \\
0 & 1
\end{bmatrix}
=
\begin{bmatrix}
1 & 0 \\
0 & 1
\end{bmatrix}.$$
Since the identity appears on both sides of the equation, the matrices we started with are inverses.
How to Find the Inverse of 2 x 2 Matrices and Diagonal Matrices
For \( 2 \times 2 \) matrices and diagonal matrices, there’s a formula you can use to find the inverse.
2 x 2 Matrices
The formula for the inverse of a \( 2 \times 2 \) matrix is
$$\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}^{-1}
= \frac{1}{ad – bc}
\begin{bmatrix}
d & -b \\
-c & a
\end{bmatrix}.$$
Diagonal Matrices
A diagonal matrix is one in which all off-diagonal elements are zero. The formula for the inverse of a diagonal matrix is
$$\begin{bmatrix}
d_1 & 0 & \dots & 0 \\
0 & d_2 & \dots & 0 \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \dots & d_n
\end{bmatrix}^{-1}
=
\begin{bmatrix}
\frac{1}{d_1} & 0 & \dots & 0 \\
0 & \frac{1}{d_2} & \dots & 0 \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \dots &\frac{1}{d_n}
\end{bmatrix}.$$
Example
Example 2: Find the inverse of the matrices:
(a) $$\begin{bmatrix}
4 & 2 \\
3 & 1
\end{bmatrix}$$
(b) $$\begin{bmatrix}
5 & 0 \\
0 & 10
\end{bmatrix}$$
Solution: (a) $$\begin{bmatrix}
4 & 2 \\
3 & 1
\end{bmatrix}$$
Applying the formula for \( 2 \times 2 \) matrices gives
$$\frac{1}{4(1) – 2(3)}\begin{bmatrix}
1 & -2 \\
-3 & 4
\end{bmatrix}.$$
Multiplying we obtain
$$\frac{1}{4 – 6}\begin{bmatrix}
1 & -2 \\
-3 & 4
\end{bmatrix}.$$
Subtracting we get
$$\frac{1}{-2}\begin{bmatrix}
1 & -2 \\
-3 & 4
\end{bmatrix}.$$
Dividing gives
$$-\frac{1}{2}\begin{bmatrix}
1 & -2 \\
-3 & 4
\end{bmatrix}.$$
Multiplying each entry by \( -\frac{1}{2} \) we arrive at a final answer of
$$\begin{bmatrix}
-\frac{1}{2} & 1 \\
\frac{3}{2} & -2
\end{bmatrix}.$$
(b) $$\begin{bmatrix}
5 & 0 \\
0 & 10
\end{bmatrix}$$
Applying the formula for diagonal matrices, we arrive at a final answer of
$$\begin{bmatrix}
\frac{1}{5} & 0 \\
0 & \frac{1}{10}
\end{bmatrix}.$$
How to Find the Inverse of a Matrix Using Row Operations
In general, row operations are needed to find the inverse of a matrix. The general procedure is to form the matrix \( [A | I] \), then use row operations to turn \( A \) into the identity matrix. We are then left with \( [I | A^{-1}] \).
For a review of row operations, please refer to the article How to Solve a System of Equations Using Gaussian Elimination: A Step-by-Step Guide.
Example
Example 3: Find the inverse of the matrix
$$\begin{bmatrix}
2 & 1 & 1 \\
1 & 2 & 1 \\
1 & 1 & 2
\end{bmatrix}.$$
Solution: We start by forming the matrix
$$\begin{bmatrix}
2 & 1 & 1 & 1 & 0 & 0 \\
1 & 2 & 1 & 0 & 1 & 0 \\
1 & 1 & 2 & 0 & 0 & 1
\end{bmatrix}.$$
Next, we swap row 1 and row 2 to obtain
$$\begin{bmatrix}
1 & 2 & 1 & 0 & 1 & 0 \\
2 & 1 & 1 & 1 & 0 & 0 \\
1 & 1 & 2 & 0 & 0 & 1
\end{bmatrix}.$$
Subtracting 2 times row 1 from row 2 and 1 times row 1 from row 3, we get
$$\begin{bmatrix}
1 & 2 & 1 & 0 & 1 & 0 \\
0 & -3 & -1 & 1 & -2 & 0 \\
0 & -1 & 1 & 0 & -1 & 1
\end{bmatrix}.$$
Subtracting 4 times row 3 from row 2, we have
$$\begin{bmatrix}
1 & 2 & 1 & 0 & 1 & 0 \\
0 & 1 & -5 & 1 & 2 & -4 \\
0 & -1 & 1 & 0 & -1 & 1
\end{bmatrix}.$$
Subtracting 2 times row 2 from row 1 and -1 times row 2 from row 3, we obtain
$$\begin{bmatrix}
1 & 0 & 11 & -2 & -3 & 8 \\
0 & 1 & -5 & 1 & 2 & -4 \\
0 & 0 & -4 & 1 & 1 & -3
\end{bmatrix}.$$
Dividing row 3 by -4, we arrive at
$$\begin{bmatrix}
1 & 0 & 11 & -2 & -3 & 8 \\
0 & 1 & -5 & 1 & 2 & -4 \\
0 & 0 & 1 & -\frac{1}{4} & -\frac{1}{4} & \frac{3}{4}
\end{bmatrix}.$$
Subtracting 11 times row 3 from row 1 and -5 times row 3 from row 2 gives
$$\begin{bmatrix}
1 & 0 & 0 & \frac{3}{4} & -\frac{1}{4} & -\frac{1}{4} \\
0 & 1 & 0 & -\frac{1}{4} & \frac{3}{4} & -\frac{1}{4} \\
0 & 0 & 1 & -\frac{1}{4} & -\frac{1}{4} & \frac{3}{4}
\end{bmatrix}.$$
Our final answer is then
$$\begin{bmatrix}
\frac{3}{4} & -\frac{1}{4} & -\frac{1}{4} \\
-\frac{1}{4} & \frac{3}{4} & -\frac{1}{4} \\
-\frac{1}{4} & -\frac{1}{4} & \frac{3}{4}
\end{bmatrix}.$$
How to Find the Inverse Using Determinants and Cofactors
Determinants and cofactors provide another valuable tool for finding the inverse of a matrix. For a review of determinants and cofactors, please refer to the article How to Find the Determinant of a Matrix Step by Step: A Complete Beginner’s Guide.
The inverse of a matrix is given by
$$A^{-1} = \frac{1}{\det(A)} \text{adj}(A).$$
Where \( \text{adj}(A) \), called the adjoint, is the transpose of the cofactor matrix, obtained by replacing each entry of a matrix by its respective cofactor.
Example
Example 4: Find the inverse of the matrix
$$\begin{bmatrix}
1 & 2 & 3 \\
0 & 1 & 4 \\
5 & 6 & 0
\end{bmatrix}.$$
Solution: Applying the formula, we obtain
$$\frac{1}{\begin{vmatrix}
1 & 2 & 3 \\
0 & 1 & 4 \\
5 & 6 & 0
\end{vmatrix}}\begin{bmatrix}
1\begin{vmatrix}
1 & 4 \\
6 & 0
\end{vmatrix} & -2\begin{vmatrix}
0 & 4 \\
5 & 0
\end{vmatrix} & 3\begin{vmatrix}
0 & 1 \\
5 & 6
\end{vmatrix} \\
-0\begin{vmatrix}
2 & 3 \\
6 & 0
\end{vmatrix} & 1\begin{vmatrix}
1 & 3 \\
5 & 0
\end{vmatrix} & -4\begin{vmatrix}
1 & 2 \\
5 & 6
\end{vmatrix} \\
5\begin{vmatrix}
2 & 3 \\
1 & 4
\end{vmatrix} & -6\begin{vmatrix}
1 & 3 \\
0 & 4
\end{vmatrix} & 0\begin{vmatrix}
1 & 2 \\
0 & 1
\end{vmatrix}
\end{bmatrix}^T.$$
Extending the 3 x 3 matrix gives
$$\frac{1}{\begin{vmatrix}
1 & 2 & 3 \\
0 & 1 & 4 \\
5 & 6 & 0
\end{vmatrix}\begin{matrix}
1 & 2 \\
0 & 1 \\
5 & 6
\end{matrix}}\begin{bmatrix}
1\begin{vmatrix}
1 & 4 \\
6 & 0
\end{vmatrix} & -2\begin{vmatrix}
0 & 4 \\
5 & 0
\end{vmatrix} & 3\begin{vmatrix}
0 & 1 \\
5 & 6
\end{vmatrix} \\
-0\begin{vmatrix}
2 & 3 \\
6 & 0
\end{vmatrix} & 1\begin{vmatrix}
1 & 3 \\
5 & 0
\end{vmatrix} & -4\begin{vmatrix}
1 & 2 \\
5 & 6
\end{vmatrix} \\
5\begin{vmatrix}
2 & 3 \\
1 & 4
\end{vmatrix} & -6\begin{vmatrix}
1 & 3 \\
0 & 4
\end{vmatrix} & 0\begin{vmatrix}
1 & 2 \\
0 & 1
\end{vmatrix}
\end{bmatrix}^T.$$
Computing the determinant using the formula for 2 x 2 matrices and the trick for 3 x 3 matrices, we obtain
$$\frac{1}{1(1)(0) + 2(4)(5) + 3(0)(6) – 5(1)(3) – 6(4)(1) – 0(0)(2)}\begin{bmatrix}
1(1(0) – 4(6)) & -2(0(0) – 4(5)) & 3(0(6) – 1(5)) \\
-0(2(0) – 3(6)) & 1(1(0) – 3(5)) & -4(1(6) – 2(5)) \\
5(2(4) – 3(1)) & -6(1(4) – 3(0)) & 0(1(1) – 2(0))
\end{bmatrix}^T.$$
Multiplying, then gives
$$\frac{1}{0 + 40 + 0 – 15 – 24 – 0}\begin{bmatrix}
1(0 – 24) & -2(0 – 20) & 3(0 – 5) \\
-0(0 – 18) & 1(0 – 15) & -4(6 – 10) \\
5(8 – 3) & -6(4 – 0) & 0(1 – 0)
\end{bmatrix}^T.$$
Adding and subtracting, we get
$$\frac{1}{1}\begin{bmatrix}
1(-24) & -2(-20) & 3(-5) \\
-0(-18) & 1(–15) & -4(-4) \\
5(5) & -6(4) & 0(1)
\end{bmatrix}^T.$$
Multiplying and dividing, we obtain
$$1\begin{bmatrix}
-24 & 40 & -15 \\
0 & –15 & 16 \\
25 & -24 & 0
\end{bmatrix}^T.$$
Taking the transpose by transforming the rows into columns and the columns into rows, we get
$$1\begin{bmatrix}
-24 & 0 & 25 \\
40 & –15 & -24 \\
-15 & 16 & 0
\end{bmatrix}.$$
Multiplying each entry by 1, we arrive at a final answer of
$$\begin{bmatrix}
-24 & 0 & 25 \\
40 & –15 & -24 \\
-15 & 16 & 0
\end{bmatrix}.$$
Using the Inverse of a Matrix to Solve Systems of Equations
One application of inverse matrices is solving systems of linear equations. If you have a system written in the form
$$A \mathbf{x} = \mathbf{b},$$
then,
$$\mathbf{x} = A^{-1} \mathbf{b}.$$
Example
Example 5: Solve the system
$$\begin{aligned}
2x + y &= 5 \\
3x + 2y &= 8
\end{aligned}.$$
Solution: In matrix form, this is
$$\begin{bmatrix}
2 & 1 \\
3 & 2
\end{bmatrix}
\begin{bmatrix}
x \\
y
\end{bmatrix}
=
\begin{bmatrix}
5 \\
8
\end{bmatrix}.$$
We now find the inverse of the coefficient matrix. Applying the formula for \( 2 \times 2 \) matrices gives
$$\frac{1}{2(2) – 1(3)}\begin{bmatrix}
2 & -1 \\
-3 & 2
\end{bmatrix}.$$
Multiplying we obtain
$$\frac{1}{4 – 3}\begin{bmatrix}
2 & -1 \\
-3 & 2
\end{bmatrix}.$$
Subtracting we get
$$\frac{1}{1}\begin{bmatrix}
2 & -1 \\
-3 & 2
\end{bmatrix}.$$
Dividing gives
$$1\begin{bmatrix}
2 & -1 \\
-3 & 2
\end{bmatrix}.$$
Multiplying each entry by 1, we arrive at
$$\begin{bmatrix}
2 & -1 \\
-3 & 2
\end{bmatrix}.$$
Multiplying both sides of our system by the inverse matrix gives
$$\begin{bmatrix}
2 & -1 \\
-3 & 2
\end{bmatrix}
\begin{bmatrix}
2 & 1 \\
3 & 2
\end{bmatrix}
\begin{bmatrix}
x \\
y
\end{bmatrix}
=
\begin{bmatrix}
2 & -1 \\
-3 & 2
\end{bmatrix}
\begin{bmatrix}
5 \\
8
\end{bmatrix}.$$
Performing matrix multiplication, we get
$$\begin{bmatrix}
2(2) – 1(3) & 2(1) – 1(2) \\
-3(2) + 2(3) & -3(1) + 2(2)
\end{bmatrix}
\begin{bmatrix}
x \\
y
\end{bmatrix}
=
\begin{bmatrix}
2(5) – 1(8) \\
-3(5) + 2(8)
\end{bmatrix}.$$
Multiplying we obtain
$$\begin{bmatrix}
4 – 3 & 2 – 2 \\
-6 + 6 & -3 + 4
\end{bmatrix}
\begin{bmatrix}
x \\
y
\end{bmatrix}
=
\begin{bmatrix}
10 – 8 \\
-15 + 16
\end{bmatrix}.$$
Adding and subtracting, we find
$$\begin{bmatrix}
1 & 0 \\
0 & 1
\end{bmatrix}
\begin{bmatrix}
x \\
y
\end{bmatrix}
=
\begin{bmatrix}
2 \\
1
\end{bmatrix}.$$
Performing matrix multiplication again, we get
$$\begin{bmatrix}
1x + 0y \\
0x + 1y
\end{bmatrix}
=
\begin{bmatrix}
2 \\
1
\end{bmatrix}.$$
Multiplying we obtain
$$\begin{bmatrix}
x + 0 \\
0 + y
\end{bmatrix}
=
\begin{bmatrix}
2 \\
1
\end{bmatrix}.$$
Adding we have
$$\begin{bmatrix}
x \\
y
\end{bmatrix}
=
\begin{bmatrix}
2 \\
1
\end{bmatrix}.$$
Thus, our final solution is
$$x = 2, y = 1.$$
Conclusion
Inverse matrices are an important tool in linear algebra and have many applications. In this guide on how to find the inverse of a matrix step by step, we explored multiple methods for finding inverses, including the formulas for 2×2 and diagonal matrices, row operations, and using cofactors and determinants.
Further Reading
The Ultimate Step by Step Guide to Basic Matrix Operations for Beginners – Now that you know about inverse matrices, I recommend rereading this article, given your understanding of inverse matrices.

