Matrix inverses

Find a matrix inverse step by step

Enter a square matrix, augment it with the identity matrix, and follow the row operations that turn the left side into the identity. If that cannot happen, the matrix is singular.

Enter a square matrix

Matrix A

2 × 2

Select any entry, then type with the math keyboard or your device keyboard.

An inverse exists only when the matrix is square and has a pivot in every column.

The determinant is 10, so the inverse exists

A1=[357101525]A^{-1}=\begin{bmatrix}\frac35&-\frac7{10}\\-\frac15&\frac25\end{bmatrix}
Conditions
  • A is a 2 by 2 square matrix.
  • det(A)=10, which is nonzero.
  • Entries are kept as exact fractions during row reduction.

Steps

  1. Augment A with the identity Place the 2 by 2 identity matrix beside A.[47102601]\left[\begin{array}{cc|cc}4&7&1&0\\2&6&0&1\end{array}\right]
  2. Create the first pivot Swap the rows, divide the new first row by 2, then eliminate the entry below its pivot.[130120512]\left[\begin{array}{cc|cc}1&3&0&\frac12\\0&-5&1&-2\end{array}\right]
  3. Create the second pivot Divide the second row by negative 5 and clear the entry above the pivot.[1035710011525]\left[\begin{array}{cc|cc}1&0&\frac35&-\frac7{10}\\0&1&-\frac15&\frac25\end{array}\right]
Independent check

Exact multiplication gives AA^{-1}=I_2 and A^{-1}A=I_2, so both the row operations and entry values are checked.

What this matrix inverse covers

A square matrix has an inverse exactly when its determinant is nonzero. Row reduction transforms the augmented matrix [A | I] into [I | A^{-1}], and multiplying the reported inverse by A checks the result.

Invert 1 by 1 through 4 by 4 matrices

Use exact Gauss-Jordan row operations on a square matrix with integer, finite decimal, or fractional entries.

Examples: 2 by 2 inverse, 3 by 3 inverse, fractional entries

Detect a singular matrix

Stop when the left block cannot acquire a pivot in every column, rather than displaying a divided-by-zero result.

Examples: dependent rows, zero row, determinant zero

Show the augmented matrix after each operation

Keep the left and right blocks aligned so every row swap, scaling, and replacement can be inspected.

Examples: swap rows 1 and 2, replace row 2 by row 2 minus 4 times row 1

Verify both multiplication orders

Multiply the result on the left and right of A. A true inverse produces the identity in both orders.

Examples: AA^{-1}=I, A^{-1}A=I

Enter enough information for one clear task

  1. 1
    Choose one square size

    Set the same number of rows and columns. A rectangular matrix cannot have a two-sided matrix inverse.

  2. 2
    Enter every matrix entry

    Use signed integers, finite decimals, or simple fractions. Exact fractions avoid rounding a small pivot to zero.

  3. 3
    Follow the pivot operations

    Read each elementary row operation from [A | I] until the left block becomes I or a missing pivot proves singularity.

  4. 4
    Check the identity products

    Confirm that multiplying in either order gives diagonal ones and off-diagonal zeros.

Examples to try

Use these examples to recognize the method, compare equivalent forms, and check your own work.

Two by two with integer determinant

Use exact row reduction or the 2 by 2 inverse formula.

A=[4726]A=\begin{bmatrix}4&7\\2&6\end{bmatrix}

Expected result

A1=[357101525]A^{-1}=\begin{bmatrix}\frac35&-\frac7{10}\\-\frac15&\frac25\end{bmatrix}

Diagonal matrix

Replace each nonzero diagonal entry by its reciprocal.

D=[2005]D=\begin{bmatrix}2&0\\0&-5\end{bmatrix}

Expected result

D1=[120015]D^{-1}=\begin{bmatrix}\frac12&0\\0&-\frac15\end{bmatrix}

Upper triangular matrix

Pivot in each column and clear the entry above the second pivot.

A=[1203]A=\begin{bmatrix}1&2\\0&3\end{bmatrix}

Expected result

A1=[123013]A^{-1}=\begin{bmatrix}1&-\frac23\\0&\frac13\end{bmatrix}

Singular matrix

The second row is twice the first, so the second pivot is missing.

A=[1224]A=\begin{bmatrix}1&2\\2&4\end{bmatrix}

Expected result

det(A)=0A1 does not exist\det(A)=0\quad\Rightarrow\quad A^{-1}\text{ does not exist}

Permutation matrix

Swapping twice restores the original order, so P is its own inverse.

P=[0110]P=\begin{bmatrix}0&1\\1&0\end{bmatrix}

Expected result

P1=PP^{-1}=P

Three by three matrix

Use three pivots and clear every nonpivot entry in the left block.

A=[120011002]A=\begin{bmatrix}1&2&0\\0&1&1\\0&0&2\end{bmatrix}

Expected result

A1=[12101120012]A^{-1}=\begin{bmatrix}1&-2&1\\0&1&-\frac12\\0&0&\frac12\end{bmatrix}

Invert a matrix without switching to decimals

The determinant is 1, so an inverse exists and every exact row operation stays especially simple.

A=[2153]A=\begin{bmatrix}2&1\\5&3\end{bmatrix}
  1. 1
    Build the augmented matrix

    Attach the identity matrix to record how the same row operations transform it.

    [21105301]\left[\begin{array}{cc|cc}2&1&1&0\\5&3&0&1\end{array}\right]
  2. 2
    Make a unit first pivot

    Replace row 2 by row 2 minus twice row 1, then swap the rows.

    [11212110]\left[\begin{array}{cc|cc}1&1&-2&1\\2&1&1&0\end{array}\right]
  3. 3
    Clear the first column

    Replace row 2 by row 2 minus twice row 1, then scale it by negative 1.

    [11210152]\left[\begin{array}{cc|cc}1&1&-2&1\\0&1&-5&2\end{array}\right]
  4. 4
    Clear above the second pivot

    Subtract row 2 from row 1 to make the left block the identity.

    [10310152]\left[\begin{array}{cc|cc}1&0&3&-1\\0&1&-5&2\end{array}\right]
A1=[3152]A^{-1}=\begin{bmatrix}3&-1\\-5&2\end{bmatrix}

Verification: Multiplication gives [[2,1],[5,3]][[3,-1],[-5,2]]=[[1,0],[0,1]].

Common mistakes and how to fix them

Using the reciprocal of every entry

Problem: Replace each a_ij by 1/a_ij.

Why it matters: Entrywise reciprocals do not undo the row and column interactions in matrix multiplication.

Better approach: Reduce [A | I] or use a valid inverse formula, then verify by matrix multiplication.

Ignoring a zero determinant

Problem: Continue dividing by a zero pivot until numbers appear.

Why it matters: A missing pivot means the rows are dependent and no two-sided inverse exists.

Better approach: Try a row swap; if no nonzero pivot is available, report the matrix as singular.

Changing only the left block

Problem: Apply row operations to A but leave I unchanged.

Why it matters: The right block records the same transformations and becomes the inverse only when every operation affects the full augmented row.

Better approach: Apply each swap, scale, or row replacement across the separator.

Rounding before the last row operation

Problem: Replace 1/3 by 0.33 and treat a small remainder as zero.

Why it matters: Early rounding can corrupt pivots and the final identity check.

Better approach: Keep exact fractions throughout, then add a decimal approximation only if it is useful.

Checks, assumptions, and limits

How results are checked

  • Exact Gauss-Jordan operations are replayed on the full augmented matrix.
  • The left block must equal the identity before the right block is accepted.
  • Both AA^{-1} and A^{-1}A are recomputed from the original entries.
  • A separate determinant check identifies singular square matrices.

When to stop and revise the input

  • Only square matrices from 1 by 1 through 4 by 4 are accepted.
  • Entries must be finite real integers, decimals, or simple fractions.
  • Symbolic parameters and complex entries are outside this release.
  • A nearly singular decimal matrix may be sensitive to rounding; exact input is preferable.

Find a matrix inverse step by step FAQ

How do I know whether a matrix has an inverse?

A square matrix is invertible exactly when its determinant is nonzero. In row reduction, the same fact appears as a pivot in every column of the left block.

Why must the matrix be square?

A two-sided inverse must undo a linear transformation in both orders. A rectangular matrix changes dimension, so it cannot multiply with one matrix to produce both required identity matrices.

What is a singular matrix?

A singular matrix is a square matrix with determinant zero. Its rows or columns are dependent, a pivot is missing, and no ordinary inverse exists.

Why check multiplication in both orders?

For square matrices, either identity product is enough in exact theory, but checking both orders is a practical way to catch a transposed entry or row-operation mistake.

Can I enter fractions in the matrix?

Yes. Simple fractions remain exact during elimination, which avoids the rounding drift that can appear when decimal pivots are used.

Sources and curriculum alignment

This page follows standard introductory mathematics notation and learning sequences. Use these references to continue with a complete course treatment.

Choose the resource that matches what you need to do next.

Created by Mathos AI. Methods, conditions, and checks are shown so you can review the mathematical reasoning.