Linear Algebra · Undergraduate

The Inverse of a Matrix

Quick answer

A square matrix A is invertible when some matrix A⁻¹ satisfies AA⁻¹ = A⁻¹A = I. To find it, row reduce the augmented matrix [A | I]: if A reduces to the identity, the right half becomes A⁻¹, and if a zero row appears on the left, A has no inverse. The inverse undoes the transformation A performs, solves Ax = b as x = A⁻¹b, and reverses products in the order (AB)⁻¹ = B⁻¹A⁻¹. For square matrices, being invertible is equivalent to a long list of other conditions from the course.

What you'll learn

  • Find the inverse of a matrix by row reducing [A | I]
  • Recognize a matrix with no inverse
  • Solve Ax = b with an inverse
  • Use (AB)⁻¹ = B⁻¹A⁻¹ and the Invertible Matrix Theorem

Undoing a matrix

A matrix AA transforms vectors. If some other matrix transforms them back, it is the inverse of AA:

AA−1=IandA−1A=IAA^{-1} = I \qquad\text{and}\qquad A^{-1}A = I

Only square matrices can have two-sided inverses, and many square matrices have none. The precalculus formula handles the 2×22 \times 2 case:

[abcd]−1=1ad−bc[d−b−ca]ad−bc≠0\begin{bmatrix} a & b\\ c & d \end{bmatrix}^{-1} = \frac{1}{ad - bc}\begin{bmatrix} d & -b\\ -c & a \end{bmatrix} \qquad ad - bc \ne 0

For larger matrices, row reduction does the job.

Finding A−1A^{-1}. Row reduce the n×2nn \times 2n matrix [ A∣I ][\,A \mid I\,]. If the left half becomes II, the right half is A−1A^{-1}. If a row of zeros appears on the left, AA has no inverse.

Why row reducing [A | I] finds the inverse

Every row operation is the same as multiplying on the left by a matrix, called an elementary matrix: do the operation to II and you have it. A sequence of row operations that turns AA into II is therefore a product E=Ek⋯E2E1E = E_k \cdots E_2E_1 with EA=IEA = I, which says E=A−1E = A^{-1}. Performing the same operations on II builds EI=EEI = E on the right-hand side. The row operations that reduce AA to II multiply together to make A−1A^{-1}, and carrying II alongside records that product.

Worked examples

The Invertible Matrix Theorem

For an n×nn \times n matrix AA, the following statements are either all true or all false:

  1. AA is invertible.
  2. AA row reduces to II; equivalently, it has nn pivots.
  3. Ax=0A\mathbf{x} = \mathbf{0} has only the trivial solution.
  4. The columns of AA are linearly independent.
  5. Ax=bA\mathbf{x} = \mathbf{b} has exactly one solution for every b\mathbf{b}.
  6. The columns of AA span ℝⁿ.
  7. The transformation x↦Ax\mathbf{x} \mapsto A\mathbf{x} is one-to-one and onto.

Every item is a way of saying ”nn pivots in an n×nn \times n matrix”. For a square matrix a pivot in every column and a pivot in every row are the same condition, which is why independence and spanning coincide here and nowhere else.

Common mistakes

Practice problems

  1. Invert [3152]\begin{bmatrix} 3 & 1\\ 5 & 2 \end{bmatrix}.

    Answer

    [2−1−53]\begin{bmatrix} 2 & -1\\ -5 & 3 \end{bmatrix}

    Full solution

    ad−bc=6−5=1ad - bc = 6 - 5 = 1. Swap the diagonal entries, negate the others, and divide by 11.

  2. Invert [4726]\begin{bmatrix} 4 & 7\\ 2 & 6 \end{bmatrix}.

    Answer

    [0.6−0.7−0.20.4]\begin{bmatrix} 0.6 & -0.7\\ -0.2 & 0.4 \end{bmatrix}

    Full solution

    ad−bc=24−14=10ad - bc = 24 - 14 = 10, so the inverse is 110[6−7−24]\tfrac{1}{10}\begin{bmatrix} 6 & -7\\ -2 & 4 \end{bmatrix}.

  3. Solve [2153]x=[12]\begin{bmatrix} 2 & 1\\ 5 & 3 \end{bmatrix}\mathbf{x} = \begin{bmatrix} 1 \\ 2 \end{bmatrix} with the inverse from Example 1.

    Answer

    x=(1,−1)\mathbf{x} = (1, -1)

    Full solution

    [3−1−52][12]=[3−2−5+4]\begin{bmatrix} 3 & -1\\ -5 & 2 \end{bmatrix}\begin{bmatrix} 1 \\ 2 \end{bmatrix} = \begin{bmatrix} 3 - 2 \\ -5 + 4 \end{bmatrix}.

  4. Does [2613]\begin{bmatrix} 2 & 6\\ 1 & 3 \end{bmatrix} have an inverse?

    Answer

    No

    Full solution

    ad−bc=6−6=0ad - bc = 6 - 6 = 0. The first row is twice the second, so row reduction leaves a zero row.

  5. Invert [200040005]\begin{bmatrix} 2 & 0 & 0\\ 0 & 4 & 0\\ 0 & 0 & 5 \end{bmatrix}.

    Answer

    [120001400015]\begin{bmatrix} \tfrac{1}{2} & 0 & 0\\ 0 & \tfrac{1}{4} & 0\\ 0 & 0 & \tfrac{1}{5} \end{bmatrix}

    Full solution

    A diagonal matrix scales each axis, and scaling back takes the reciprocals.

  6. Invert [110011111]\begin{bmatrix} 1 & 1 & 0\\ 0 & 1 & 1\\ 1 & 1 & 1 \end{bmatrix}.

    Answer

    [0−1111−1−101]\begin{bmatrix} 0 & -1 & 1\\ 1 & 1 & -1\\ -1 & 0 & 1 \end{bmatrix}

    Full solution

    Row reduce [ A∣I ][\,A \mid I\,]: R3−R1R_3 - R_1 gives (0,0,1∣−1,0,1)(0, 0, 1 \mid -1, 0, 1), which is already the third row of the inverse. Then R2−R3R_2 - R_3 gives (0,1,0∣1,1,−1)(0, 1, 0 \mid 1, 1, -1), and R1−R2R_1 - R_2 gives (1,0,0∣0,−1,1)(1, 0, 0 \mid 0, -1, 1).

  7. If AA and BB are invertible 3×33 \times 3 matrices, write (AB)−1(AB)^{-1} and (A−1)−1\left(A^{-1}\right)^{-1}.

    Answer

    B−1A−1B^{-1}A^{-1} and AA

    Full solution

    (AB)(B−1A−1)=A(BB−1)A−1=AA−1=I(AB)(B^{-1}A^{-1}) = A(BB^{-1})A^{-1} = AA^{-1} = I. And AA undoes A−1A^{-1}, so it is its inverse.

  8. A 4×44 \times 4 matrix has independent columns. Is it invertible?

    Answer

    Yes

    Full solution

    Independent columns give four pivots, and by the Invertible Matrix Theorem a square matrix with nn pivots is invertible.

  9. For a 5×55 \times 5 matrix, Ax=0A\mathbf{x} = \mathbf{0} has a nonzero solution. Can Ax=bA\mathbf{x} = \mathbf{b} have a unique solution for some b\mathbf{b}?

    Answer

    No

    Full solution

    A nonzero solution of the homogeneous system means a free variable, so every consistent system Ax=bA\mathbf{x} = \mathbf{b} has infinitely many solutions.

  10. A student inverts [1234]\begin{bmatrix} 1 & 2\\ 3 & 4 \end{bmatrix} by taking reciprocals of the entries. What went wrong?

    Hint

    Multiply the student’s matrix by the original.

    Answer

    Reciprocals do not give the inverse. The inverse is [−211.5−0.5]\begin{bmatrix} -2 & 1\\ 1.5 & -0.5 \end{bmatrix}.

    Full solution

    The product of the original with the matrix of reciprocals has first entry 1⋅1+2⋅13=531 \cdot 1 + 2 \cdot \tfrac{1}{3} = \tfrac{5}{3}, not 11. With ad−bc=4−6=−2ad - bc = 4 - 6 = -2, the formula gives −12[4−2−31]-\tfrac{1}{2}\begin{bmatrix} 4 & -2\\ -3 & 1 \end{bmatrix}.

Frequently asked questions

How do you find the inverse of a matrix?

Row reduce the augmented matrix [A | I]. When the left half becomes I, the right half is A⁻¹.

How can you tell that a matrix has no inverse?

Row reduction of A produces a row of zeros, meaning fewer than n pivots. Such a matrix is called singular.

What is the inverse of a product?

(AB)⁻¹ = B⁻¹A⁻¹. The order reverses, the way taking off shoes and socks reverses putting them on.

Do non-square matrices have inverses?

Not two-sided ones. An inverse must undo the transformation in both directions, which needs the input and output spaces to have the same dimension.

What is the Invertible Matrix Theorem?

A list of conditions on a square matrix that are all true or all false together: invertible, n pivots, independent columns, columns spanning ℝⁿ, Ax = 0 having only the trivial solution, and more.

What to learn next