Gauth

Linear algebra

Matrix Inverse: Two Ways to Compute It

The adjugate formula and Gauss-Jordan elimination give the same answer by very different routes. Knowing which to reach for saves more time than being fast at either.

By the Gauth editorial teamHow this content is produced and checkedUpdated 10 September 2026

The idea

There is no division for matrices. What there is instead is an undo button. The inverse of a square matrix is the matrix that cancels it out:

where is the identity — ones down the diagonal, zeros elsewhere — which acts on matrices exactly the way 1 acts on numbers. So plays the role of , and that is the only sense in which matrix division exists.

The useful way to picture it is as a transformation. A matrix takes every vector in the plane and moves it somewhere else: rotating, stretching, shearing, reflecting. Its inverse is the transformation that puts every vector back. If rotates by 30 degrees and doubles lengths, then halves lengths and rotates back by 30 degrees.

That picture immediately explains when an inverse fails to exist. The determinant measures how much the transformation scales area, in two dimensions, or volume in three. A determinant of zero means the transformation squashes the whole plane onto a single line — every point on some line of inputs lands on the same output. There is no way back, because the information about where you came from has been destroyed. A matrix with zero determinant is called singular, and no formula and no amount of row reduction will produce an inverse for it.

One consequence people find counterintuitive: a singular does not mean has no solution. It means there is no unique solution. Depending on , the system has either no solutions at all or infinitely many — the same two outcomes you meet with parallel and coincident lines in two-variable systems, because that is exactly what a singular two-by-two matrix describes.

Change the entries and watch the determinant

Matrix A

Determinant

(2)(3) − (1)(5) = 1

Inverse

1/1 × swap diagonal, negate the other two

3-1-52

Try setting the second row to a multiple of the first — 2, 1 on top and 4, 2 underneath, say. The determinant drops to zero and the inverse disappears, because the two rows now describe the same direction and the matrix flattens the plane onto a line.

When you need it

Solving the same system for many right-hand sides. Writing a linear system as and left-multiplying by the inverse gives in one step. For a single system this is slower than row-reducing directly, and the systems solver will do that for you. The inverse wins when is fixed and keeps changing, because then the expensive work happens once.

Reversing a transformation. In graphics, robotics, and coordinate geometry you constantly need to undo a rotation, a scaling, or a change of basis. The inverse matrix is that undo.

Testing whether a system is well posed. Often the question is not what the solution is but whether a unique one exists. Computing the determinant answers that on its own, without ever building the inverse.

Rearranging matrix equations. Matrix algebra follows most of the ordinary rules, with the crucial exception that multiplication does not commute. To get out of you must multiply on the left of both sides, giving . To get it out of you must multiply on the right, giving . These are different matrices, and choosing the wrong side is a silent error.

The method

1. Compute the determinant before anything else. If it is zero, stop and write that the matrix is singular — that is the complete answer. If it is non-zero, you know an inverse exists and you already have the number the adjugate method will need.

2. For 2×2, use the shortcut. It is not a different rule; it is the adjugate formula worked out in advance.

Swap the two diagonal entries, negate the other two, divide by the determinant. Everything about the 3×3 case is a generalisation of those three moves.

3. The adjugate method, in general.Replace each entry by its cofactor: the determinant of the smaller matrix you get by deleting that entry's row and column, multiplied by a sign from the checkerboard pattern. Then transpose the whole thing and divide by the determinant.

The transpose is not decoration. Skipping it produces a matrix that looks entirely plausible and is wrong except in the symmetric case.

4. Gauss-Jordan, in general. Write and the identity side by side as one wide block, then row-reduce until the left half is the identity. Whatever the right half has turned into is the inverse.

Three operations are allowed: swap two rows, multiply a row by a non-zero constant, add a multiple of one row to another. Each one must be applied across the full width of the row, both halves. Work column by column — clear below each leading entry first, then clear above, then scale.

5. Verify by multiplying. Compute . If it is the identity you are finished with certainty, and if it is not, the pattern of the error usually points straight at the entry that went wrong. This check takes under a minute for a 3×3 and it is the difference between thinking you are right and knowing it.

Worked examples

Worked example

  1. 1

    Determinant first. It is non-zero, so an inverse exists.

  2. 2

    Apply the shortcut: swap 4 and 6, negate 7 and 2, and divide everything by 10.

  3. 3

    Verify. Each entry of the product is a row of A dotted with a column of the candidate inverse.

  4. 4

    With the inverse in hand, any system using this A takes one multiplication. For the right-hand side (18, 14) the solution is x = 1 and y = 2, which you can confirm satisfies 4x + 7y = 18 and 2x + 6y = 14.

Answer

Worked example

  1. 1

    Augment A with the 3×3 identity. Every row operation from here acts on all six entries of a row.

  2. 2

    Clear the first column below the leading 1: subtract 5 times row 1 from row 3.

  3. 3

    Clear the second column below the pivot: add 4 times row 2 to row 3. The left block is now upper triangular with a 1 in the bottom-right corner.

  4. 4

    Now work upwards. Clear the third column from rows 2 and 1.

  5. 5

    Finally clear the second column from row 1. The left block is the identity, so the right block is the inverse.

  6. 6

    Check one entry as a spot test: row 1 of A dotted with column 1 of the answer is 1(−24) + 2(20) + 3(−5) = −24 + 40 − 15 = 1, which is the correct diagonal entry of the identity.

Answer

Worked example

  1. 1

    Expand the determinant along the top row. The middle term vanishes because that entry is zero, which is why this row is worth choosing.

  2. 2

    Build the cofactor matrix. Each entry is the 2×2 determinant left after deleting its row and column, with the checkerboard sign applied.

  3. 3

    Transpose the cofactor matrix to get the adjugate. Rows become columns; this is the step that is easiest to forget.

  4. 4

    Divide by the determinant. Here it is 1, so the adjugate is already the inverse — a convenient accident, not the general case.

  5. 5

    Verify with the first row of B against all three columns: (1, 0, 2) gives −11 + 0 + 12 = 1, then 2 + 0 − 2 = 0, then 2 + 0 − 2 = 0. That is the first row of the identity.

Answer

Try one of your own

Type a matrix and you will get the determinant, the route chosen, and every elementary row operation listed in order. The matrix calculator with steps covers determinants, inverses, multiplication, and row reduction, and the linear algebra solver carries the same working through to eigenvalues and systems.

Solve a linear algebra problem now

First solution free

Where people go wrong

Inverting entry by entry

Writing the inverse of as . Reciprocals of the entries have nothing to do with the inverse of the matrix, and multiplying the two together produces something nowhere near the identity. The inverse is defined by what the whole matrix does as a transformation, not by what its individual numbers are.

Forgetting to transpose the cofactor matrix

The adjugate is , not . Because the cofactor matrix has the right entries in the wrong places, the resulting answer looks completely reasonable and is wrong unless the matrix happens to be symmetric. This is the single strongest argument for always verifying: the error is invisible on inspection and obvious the moment you multiply.

Losing the checkerboard signs

The cofactor of an entry is its minor determinant multiplied by , which is the alternating pattern starting with a plus in the top-left. Four of the nine positions in a 3×3 carry a minus. Writing the sign grid down beside your working before you start, rather than reconstructing it entry by entry, is the practical fix.

Applying a row operation to only half the augmented matrix

In Gauss-Jordan the two halves are one matrix, not two. If you subtract five times row 1 from row 3, that subtraction has to reach all six entries. Operating on the left block alone leaves the right block recording a different sequence of operations, and the result is not an inverse of anything. Ruling a vertical line and then deliberately reading across it every time is a habit worth building, alongside the other verification routines in how to check your own work.

Practice

For the second problem, give the four entries of the inverse reading left to right and top to bottom, separated by commas.

Matrix inverse practice

Answers are checked here — nothing is sent anywhere.

  1. 1
  2. 2
  3. 3
  4. 4

Frequently asked questions

Which method should I actually use?
For 2×2, always the shortcut: swap the diagonal entries, negate the other two, divide by the determinant. For 3×3, Gauss-Jordan is usually faster and involves fewer separate calculations, unless you already need the determinant for another part of the question. For 4×4 and beyond, Gauss-Jordan is the only sensible hand method, because the adjugate would require you to evaluate sixteen 3×3 determinants.
Why does a determinant of zero mean there is no inverse?
The determinant is the factor by which the matrix scales area in two dimensions or volume in three. A determinant of zero means the transformation flattens space onto a line or a plane, so different input vectors get mapped to the same output. Nothing can undo that, because the information about which input you started from is gone.
Is finding the inverse the best way to solve a system?
Not for a single system. Row-reducing the augmented matrix [A | b] directly is faster and numerically better behaved than computing A inverse and then multiplying. The inverse earns its keep when you have to solve Ax = b repeatedly with the same A and many different b vectors, since then you do the hard work once.
Does the order matter when I multiply by an inverse?
Yes, in general, because matrix multiplication is not commutative. A and its own inverse are the exception: AA⁻¹ and A⁻¹A both equal the identity. But to solve AX = B you must left-multiply both sides to get X = A⁻¹B, whereas XA = B needs right-multiplication and gives X = BA⁻¹. Those are different matrices.
What is the inverse of a product?
The inverses in reverse order: (AB)⁻¹ = B⁻¹A⁻¹. Think of putting on socks then shoes — undoing it means removing shoes then socks. A related fact worth remembering is that det(A⁻¹) = 1/det(A), which follows from det(A)·det(A⁻¹) = det(I) = 1.

Keep going

Gauth AIAsk me for any help!