Uni-Sine
MathematicsVectors and matrices

How to find the inverse of a matrix

Try it

Matrix Calculator

Multiply, invert and find determinants and eigenvalues

Go to its page

What is the inverse of a matrix?

For numbers, the inverse of 5 is 1/5, because 5 × 1/5 = 1. Matrices work the same way. The inverse of a square matrix A, written A−1, is the matrix that gives the identity matrix I when you multiply them together, in either order. OpenStax Precalculus defines it as AA−1 = A−1A = I.

The 2x2 identity:      The 3x3 identity:

| 1  0 |               | 1  0  0 |
| 0  1 |               | 0  1  0 |
                       | 0  0  1 |

The identity matrix acts like the number 1: multiplying any matrix by it changes nothing. Only square matrices (same number of rows and columns) can have inverses, and only when their determinant isn't zero.

How to find the inverse of a 2x2 matrix

\left[a,\ b;\ c,\ d\right]^{-1}=\frac{1}{ad-bc}\left[d,\ -b;\ -c,\ a\right]Rows are separated by semicolons
  1. Find the determinant: ad − bc. If it is 0, stop: there is no inverse.
  2. Swap the two numbers on the leading diagonal, a and d.
  3. Change the signs of the other two, b and c. Don't move them.
  4. Divide every entry by the determinant.

Example 1: a determinant of 1

Find the inverse of A = [5, 3; 3, 2]. The determinant is 5 × 2 − 3 × 3 = 10 − 9 = 1. Swap the 5 and 2, change the signs of the 3s, and divide by 1:

A^{-1}=\left[2,\ -3;\ -3,\ 5\right]

Check: multiply them. The top left entry is 5 × 2 + 3 × (−3) = 10 − 9 = 1, and the top right is 5 × (−3) + 3 × 5 = 0. The full product is [1, 0; 0, 1], the identity, so the inverse is right.

Example 2: keeping the fraction outside

Find the inverse of B = [4, 2; 3, 5]. The determinant is 4 × 5 − 2 × 3 = 20 − 6 = 14. So:

B^{-1}=\frac{1}{14}\left[5,\ -2;\ -3,\ 4\right]

Leaving the 1/14 outside keeps the working clean. Multiply it in only if the question asks, giving [5/14, −1/7; −3/14, 2/7].

How to find the inverse of a 3x3 matrix

There is no quick swap for 3x3 matrices. The standard hand method uses minors, cofactors and the adjugate:

A^{-1}=\frac{1}{\det A}\operatorname{adj}A
  1. Find the determinant. If it is 0, there is no inverse.
  2. Find the matrix of minors. For each entry, cover its row and column and find the determinant of the 2x2 left over.
  3. Make the matrix of cofactors by changing the sign of every other minor, in a checkerboard pattern starting with + in the top left.
  4. Transpose it (swap rows and columns) to get the adjugate, adj A.
  5. Divide by the determinant.

Example 3: a 3x3 inverse by cofactors

    | 1  0  2 |
A = | 2  1  0 |
    | 1  1  3 |

Step 1, the determinant. Expand along the top row. Each top row entry multiplies the 2x2 determinant left when you cover its row and column, with signs +, −, +:

\det A=1(1\times3-0\times1)-0(\ldots)+2(2\times1-1\times1)=3+2=5

Step 2, the minors. For the top left entry, cover row 1 and column 1, leaving [1, 0; 1, 3], whose determinant is 3. For the top middle, cover row 1 and column 2, leaving [2, 0; 1, 3], which gives 6. Doing all nine:

Minors:            Signs:          Cofactors:
|  3   6   1 |     | +  -  + |     |  3  -6   1 |
| -2   1   1 |     | -  +  - |     |  2   1  -1 |
| -2  -4   1 |     | +  -  + |     | -2   4   1 |

Step 3, the cofactors. Apply the checkerboard of signs to the minors, as shown on the right.

Step 4, the adjugate. Transpose the cofactors: the first row becomes the first column, and so on.

        |  3   2  -2 |                 |  3   2  -2 |
adj A = | -6   1   4 |    A^-1 = 1/5 x | -6   1   4 |
        |  1  -1   1 |                 |  1  -1   1 |

Step 5, divide by the determinant, 5, which gives the inverse on the right. Check: A × adj A should be 5 times the identity. The top left entry is 1 × 3 + 0 × (−6) + 2 × 1 = 5 and the top middle is 1 × 2 + 0 × 1 + 2 × (−1) = 0, as they should be. Paste A into the Matrix Calculator to check every entry.

The other method: row reduction

You can also write A next to the identity, [A | I], and use row operations to turn A into I. Whatever the identity has turned into is A−1. This method, Gauss-Jordan elimination, is quicker for 4x4 and larger matrices and is how computers do it. Our inverse matrix calculator guide works through a full example.

When a matrix has no inverse

A matrix whose determinant is 0 is called singular and has no inverse. Take [2, 4; 3, 6]: its determinant is 2 × 6 − 4 × 3 = 12 − 12 = 0, so the formula would mean dividing by zero. Notice the second row is 1.5 times the first. Whenever one row (or column) is a multiple or combination of the others, the determinant is 0. Geometrically, a singular matrix squashes space flat, and you can't undo a squash.

Using the inverse to solve simultaneous equations

Simultaneous equations can be written as one matrix equation, AX = B. Multiply both sides on the left by A−1 and you get X = A−1B. Solve:

5x+3y=21\ \ \ \ \ 3x+2y=13

The matrix of coefficients is A = [5, 3; 3, 2], whose inverse we found in Example 1 is [2, −3; −3, 5]. So x = 2 × 21 + (−3) × 13 = 42 − 39 = 3 and y = (−3) × 21 + 5 × 13 = −63 + 65 = 2. Check in the first equation: 5 × 3 + 3 × 2 = 21. Our Simultaneous Equations Calculator solves systems like this with working.

Try one: this question gives you a pair of simultaneous equations to solve. Use any method you like, including the inverse.

Solve a pair of simultaneous equations for x and y.

Press Mark to have your answer marked in the Algebra course.

Useful properties of inverses

  • (A−1)−1 = A: undoing the undo gets you back.
  • (AB)−1 = B−1A−1: the order reverses, like taking off socks and shoes.
  • det(A−1) = 1 ÷ det A: for Example 3, det A−1 = 1/5.
  • (AT)−1 = (A−1)T: transposing and inverting can be done in either order.

Common mistakes

  • Swapping b and c in a 2x2. Only a and d swap; b and c just change sign.
  • Forgetting to divide by the determinant. [d, −b; −c, a] is only the inverse when the determinant is 1.
  • Missing the checkerboard signs when turning minors into cofactors.
  • Forgetting to transpose. Skip that step and the off-diagonal entries end up in the wrong places.
  • Writing X = BA−1. Matrix multiplication isn't commutative: from AX = B, X = A−1B.
  • Not checking. Multiplying A by your answer and getting the identity catches almost every slip.

Common questions

How do you find the inverse of a 2x2 matrix?
Swap the two entries on the leading diagonal, change the signs of the other two, and divide every entry by the determinant ad − bc.
How do you find the inverse of a 3x3 matrix?
Find the determinant, then the matrix of minors, apply the checkerboard of signs to get the cofactors, transpose to get the adjugate, and divide by the determinant. Or row reduce [A | I] until the left side is the identity.
When does a matrix not have an inverse?
When its determinant is 0. Such a matrix is called singular. Non-square matrices don't have inverses either.
How do I check my inverse?
Multiply the original matrix by your answer. If you get the identity matrix, with 1s on the leading diagonal and 0s elsewhere, it is correct.
What is the adjugate of a matrix?
The transpose of its matrix of cofactors. Dividing the adjugate by the determinant gives the inverse.
Is A inverse times A the same as A times A inverse?
Yes. Both give the identity matrix. This is one of the few cases where the order of matrix multiplication doesn't matter.

Revision cards

Read the front, say your answer, then flip to check.

Where to go next

  • Solve it

    Matrix Calculator

    Multiply, invert and find determinants and eigenvalues

    Open the tool
  • Learn it

    Algebra

    Master equations, inequalities and the language of abstract mathematics

    Start the course
  • Test it

    College Linear Algebra

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Maths · Vectors and matricesWhat is a matrix in maths? Definition, types and examplesA matrix is a rectangular grid of numbers in rows and columns. Learn matrix types, how to add, multiply and invert matrices, and what they are used for.