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.
- Find det A. If it is zero there is no inverse.
- Compute the minors Mij: the determinants of the matrices left after deleting row i and column j.
- Get the cofactors Aij = (−1)i+j · Mij. The signs alternate like a chessboard, starting with plus in the top left corner.
- Transpose the cofactor matrix; this is adj A. The most common mistake is forgetting the transposition.
- 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.