Calculator · Engineering Mathematics

Matrix Inverse Calculator

Compute the inverse matrix A⁻¹ of a real square matrix by solving A X = I against a single pivoted factorisation, then verify it from both sides: ‖A A⁻¹ − I‖∞ and ‖A⁻¹ A − I‖∞ are reported alongside the conditioning of A.

Matrix A

One row per line; entries separated by spaces or commas. Scientific notation such as 1.5e-3 is accepted. At most 10 × 10; ragged rows and blank entries are refused, never repaired.

What Anemodia read

A
A
21-1
-3-12
-212

Inverse

A⁻¹
A⁻¹
43-1
-2-21
54-1

Verification & conditioning

Size3 × 3
‖A A⁻¹ − I‖∞2.220e-15
‖A⁻¹ A − I‖∞1.776e-15
Relative ‖A A⁻¹ − I‖∞ / (‖A‖∞‖A⁻¹‖∞)3.701e-17
Relative ‖A⁻¹ A − I‖∞ / (‖A‖∞‖A⁻¹‖∞)2.961e-17
‖A‖∞6
‖A⁻¹‖∞10
κ₂(A)44.67
κ∞(A)60
Numerical rank3 of 3
Row swaps2

Both residuals are backward checks: they say how nearly the computed matrix behaves like an inverse of the A that was entered. They do NOT bound the forward error A⁻¹_computed − A⁻¹_true. For an ill-conditioned matrix the residual can be at roundoff while several leading digits of the entries are still meaningless — which is why κ is shown next to them rather than left out.

  • ⚠ If the real task is to solve A x = b, solve it directly instead of forming A⁻¹ and multiplying: the direct solve is cheaper and numerically better behaved.

Continue

Open in Linear Algebra Lab

The matrix continues into the Lab's Inverse workspace, where the same inverse sits beside the determinant, the factorisation and the conditioning of the same A. No right-hand side is carried over, because this calculator does not have one.

Assumptions & validity

  • · A must be square, real and at most 10 × 10. A 1 × 1 matrix is accepted: [a]⁻¹ = [1/a] for a ≠ 0.
  • · The inverse is computed by factorising A once as P A = L U and solving A xⱼ = eⱼ for each identity column. No adjugate, no cofactors, no determinant formula.
  • · When a pivot is at or below eps · n · ‖A‖∞ the matrix is singular at the working tolerance and NO inverse is reported. An unusable answer is refused, not rounded into existence.
  • · A matrix can be invertible and still be a bad matrix to invert. When κ is large the entries of A⁻¹ are sensitive to the last digits of A, and that is stated rather than implied away by a small residual.
  • · The residuals ‖A A⁻¹ − I‖∞ and ‖A⁻¹ A − I‖∞ are verification quantities, not the true error of the inverse.
  • · If the actual task is to solve A x = b, use the Linear System Solver: forming A⁻¹ and multiplying costs more and is numerically worse.

Technical reference

A A⁻¹ = A⁻¹ A = I

A X = I solved column by column from P A = L U

R_left = A A⁻¹ − I, R_right = A⁻¹ A − I

κ∞(A) = ‖A‖∞ ‖A⁻¹‖∞

A⁻¹
the unique inverse of a nonsingular square matrix A
I
identity matrix of the same order
‖·‖∞
infinity norm, the maximum absolute row sum
κ
condition number, the sensitivity of the problem

The inverse exists only for a square matrix of full rank, and when it exists it is unique and two-sided: A A⁻¹ and A⁻¹ A are both the identity. Both products are checked here, because a one-sided check would pass for shapes and ranks where no true inverse exists.

Solving A X = I one identity column at a time reuses a single factorisation: the expensive elimination happens once, and each column costs only a forward and a back substitution.

Engineering tasks that look like they need A⁻¹ usually do not. x = A⁻¹b should be computed as a direct solve of A x = b: it is roughly three times cheaper and has better rounding behaviour. Explicitly forming the inverse is justified when the entries themselves are the answer — covariance matrices, compliance matrices, stiffness inversion for interpretation.

The residuals are scaled by ‖A‖∞‖A⁻¹‖∞ so the relative figure is invariant when A is rescaled. A raw residual alone changes with the units the matrix is written in.

For an ill-conditioned A, a tiny residual and a badly inaccurate inverse coexist happily. The residual measures the equations; conditioning measures the problem.

Related tools