BL2.ru

Inverse matrix calculator: adjugate method and Gauss-Jordan elimination

Enter a square matrix from 2x2 to 5x5. The calculator finds the inverse in two ways: with the determinant and cofactors, and by Gauss-Jordan elimination. The answer is in exact fractions, the solution is written out step by step and ends with the check A·A⁻¹ = E.

A
3
3
Cells accept integers, decimals (1.5 or 1,5) and fractions (-3/4). Change the size with the arrow buttons next to the matrix (2 to 5). You can also paste the matrix as text: rows, columns, then elements row by row.
Calculate

What an inverse matrix is

A matrix A−1 is the inverse of a square matrix A if A · A−1 = A−1 · A = E, where E is the identity matrix. The inverse is used to solve systems of linear equations (A · X = B, X = A−1 · B), matrix equations and coordinate transformations. It exists only if the determinant det A is not zero.

Method 1. Determinant and cofactors

The formula is A−1 = (1 / det A) · adj A, where adj A is the adjugate matrix.

  1. Find det A. If it is zero there is no inverse.
  2. Compute the minors Mij: the determinants of the matrices left after deleting row i and column j.
  3. Get the cofactors Aij = (−1)i+j · Mij. The signs alternate like a chessboard, starting with plus in the top left corner.
  4. Transpose the cofactor matrix; this is adj A. The most common mistake is forgetting the transposition.
  5. Divide every entry of adj A by det A.

For a 2x2 matrix with rows (a, b) and (c, d) this reduces to A−1 = 1/(ad − bc) · [[d, −b], [−c, a]].

Method 2. Gauss-Jordan elimination

Write the identity matrix to the right of A to get [A ∣ E]. Use elementary row operations (swap two rows, multiply a row by a number, add a multiple of one row to another) to reduce the left part to the identity. The same operations turn the right part into A−1: [A ∣ E] → [E ∣ A−1]. If at some point a column has no nonzero entry for the pivot, the matrix is singular.

Check

Multiply A by the inverse you found. The result must be the identity matrix. This is the quickest way to catch an arithmetic slip: ones on the diagonal and zeros everywhere else.

Typical mistakes

  • Forgetting to transpose the cofactor matrix.
  • Losing the sign (−1)i+j of the cofactors in odd positions.
  • Dividing only some entries by the determinant, or using the wrong sign of the determinant.
  • In Gauss-Jordan, changing only the left half of [A ∣ E] instead of the whole row.
  • Trying to invert a singular matrix: compute the determinant first.

Example

For A with rows (1, 2) and (3, 4): det A = 1·4 − 2·3 = −2, so A−1 = −1/2 · [[4, −2], [−3, 1]] = [[−2, 1], [3/2, −1/2]]. Press the example button to see a full solution for a 3x3 matrix.

FAQ

When does a matrix have no inverse?
Only a square matrix with a nonzero determinant (a nonsingular matrix) has an inverse. If det A = 0 the rows are linearly dependent, and neither the adjugate formula nor Gauss-Jordan elimination can build the inverse.
Which is faster: the determinant method or Gauss-Jordan?
For 2x2 and 3x3 matrices the cofactor formula is convenient and is what exams usually require. For 4x4 and larger, Gauss-Jordan is much shorter because you do not have to compute sixteen 3x3 minors.
What is the inverse of a 2x2 matrix?
For a matrix with rows (a, b) and (c, d) the inverse is 1/(ad − bc) times the matrix with rows (d, −b) and (−c, a). Swap the diagonal entries, change the sign of the other two, and divide everything by the determinant.
How can I check the inverse?
Multiply A by A⁻¹: the result must be the identity matrix E with ones on the diagonal and zeros elsewhere. The calculator shows this product under the solution.
Why are the answers fractions, not decimals?
Fractions are exact and do not accumulate rounding errors, as coursework requires. If you need decimals, tick the checkbox and approximate values appear below.