ThisCalculator

Math

Calculate an Inverse Matrix: Formula and Example

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Calculate an Inverse Matrix: Formula and Example

To calculate an inverse matrix, enter the elements of a square matrix and find the matrix that multiplies with it to produce the identity matrix. This calculator uses a 2 × 2 matrix, returns its inverse when one exists, and reports the determinant used to check whether the matrix is invertible.

Formula

For a 2 × 2 matrix, swap the two diagonal entries, change the signs of the off-diagonal entries, and divide every resulting entry by the determinant:

A = [[a, b], [c, d]],   det(A) = ad − bc,   A−1 = (1 / (ad − bc)) [[d, −b], [−c, a]].

Here, a, b, c, and d are the four numeric entries; the determinant is a scalar, and each inverse entry is a number. Matrix entries can represent quantities with units, but the units must be treated consistently for the matrix operations to make sense. This calculator assumes ordinary numeric entries.

An inverse exists exactly when the determinant is nonzero. If ad − bc = 0, division by the determinant is impossible and the matrix is singular. A very small determinant is not necessarily zero, but it can indicate that rounding or measurement error may strongly affect the computed inverse.

Worked Example

Using the calculator’s default entries gives A = [[4, 7], [2, 6]]. First calculate the determinant:

det(A) = (4 × 6) − (7 × 2) = 24 − 14 = 10.

Since 10 is not zero, the inverse exists. Apply the 2 × 2 formula:

A−1 = (1 / 10) [[6, −7], [−2, 4]] = [[0.6, −0.7], [−0.2, 0.4]].

Rounded to the calculator’s four decimal places, the inverse entries are 0.6000, −0.7000, −0.2000, and 0.4000. The determinant output is 10.00. As a check, multiplying the original matrix by this inverse gives [[1, 0], [0, 1]], the 2 × 2 identity matrix.

How to Calculate an Inverse Matrix

For a 2 × 2 matrix, the calculation is short enough to do by hand:

  1. Write the entries in their correct row and column positions: [[a, b], [c, d]].
  2. Calculate the determinant, ad − bc.
  3. If the determinant is zero, stop: the matrix has no inverse.
  4. Swap a and d, change the signs of b and c, then divide each entry by the determinant.
  5. Check the result by multiplying the original matrix by the proposed inverse. The product should be the identity matrix, apart from small rounding differences.

Keep the positions straight: the entry in row 1, column 2 becomes the negative entry in row 1, column 2 of the inverse, and likewise for row 2, column 1. A useful memory aid is “swap the diagonal, negate the other two.”

What an Inverse Matrix Does

The inverse reverses a matrix transformation. If Ax = b and A is invertible, multiplying both sides by A−1 gives x = A−1b. This makes matrix inverses useful for solving systems of linear equations and undoing transformations such as rotations, scaling, or combinations of linear operations.

The identity matrix plays the role of 1 in scalar arithmetic: multiplying a matrix by its inverse gives the identity, just as multiplying a nonzero number by its reciprocal gives 1. Matrix multiplication is generally not commutative, so order matters. For a valid inverse, both AA−1 = I and A−1A = I.

Beyond 2 × 2 Matrices

Only square matrices can have a conventional two-sided inverse. For a 3 × 3 or larger matrix, the same determinant test applies in principle, but the hand calculation involves more work. In practical numerical computation, elimination methods such as Gaussian elimination or LU decomposition are commonly used to solve systems or calculate an inverse. These approaches are generally preferable to expanding a large determinant and applying a cofactor formula.

A rectangular matrix has no ordinary inverse because its row and column dimensions do not match. In some applications, a pseudoinverse is used instead. It is a different, generalized tool that can provide a least-squares solution or a useful substitute when a matrix is rectangular or singular; it is not the same as an ordinary inverse.

Common Errors and Limits

  • Using the wrong determinant order: The formula is ad − bc, not bc − ad. Reversing the subtraction changes the sign.
  • Changing the wrong signs: Only the off-diagonal entries are negated; the diagonal entries are swapped without changing their signs.
  • Trying to invert a non-square matrix: The ordinary inverse is defined only for square matrices.
  • Treating a rounded determinant as exact: With decimal inputs, rounding can make a small nonzero determinant appear to be zero, or conceal numerical instability. Keep extra precision during calculation where possible.
  • Rounding too early: Calculate with full available precision and round the displayed answer at the end. The rounded entries may not multiply to the identity exactly.

This calculator covers only 2 × 2 matrices. It does not take a complete matrix of arbitrary size, assess measurement uncertainty, or calculate a pseudoinverse. Its formula is exact in arithmetic, but a computer’s displayed decimal values are rounded representations.

Frequently Asked Questions

How do I know if a matrix has an inverse?
For a square matrix, calculate its determinant. If the determinant is nonzero, the matrix is invertible; if it is zero, the matrix is singular and has no ordinary inverse.

Can a 2 × 3 matrix have an inverse?
It cannot have an ordinary two-sided matrix inverse. The number of rows and columns must match. A pseudoinverse may be useful in some rectangular-matrix problems, but it is a distinct concept.

What is the inverse of the identity matrix?
The identity matrix is its own inverse: multiplying it by itself leaves it unchanged.

Why does my calculated inverse not multiply to exactly the identity?
Most often, the displayed entries have been rounded. Use more digits during the calculation and compare the product with the identity within an appropriate numerical tolerance.

Is the inverse the same as dividing a matrix?
Not exactly. Matrix division is not generally defined as scalar division is. In an equation such as Ax = b, an invertible matrix lets you solve by multiplying by A−1, though numerical methods often solve the system without explicitly forming the inverse.

Related

Formula used
in a | Entry a | - | 4 | 
in b | Entry b | - | 7 | 
in c | Entry c | - | 2 | 
in d | Entry d | - | 6 | 
out determinant | Determinant | - | a * d - b * c | 2
out inv_a | Inverse entry 1,1 | - | d / determinant | 4
out inv_b | Inverse entry 1,2 | - | -b / determinant | 4
out inv_c | Inverse entry 2,1 | - | -c / determinant | 4
out inv_d | Inverse entry 2,2 | - | a / determinant | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.