# Inverse

Inverse[m]

gives the inverse of a square matrix m.

# Details and Options • Inverse works on both symbolic and numerical matrices.
• For matrices with approximate real or complex numbers, the inverse is generated to the maximum possible precision given the input. A warning is given for illconditioned matrices.
• Inverse[m,Modulus->n] evaluates the inverse modulo n.
• Inverse[m,ZeroTest->test] evaluates test[m[[i,j]]] to determine whether matrix elements are zero. The default setting is .
• A Method option can also be given. Settings for exact and symbolic matrices include "CofactorExpansion", "DivisionFreeRowReduction", and "OneStepRowReduction". The default setting of Automatic switches among these methods depending on the matrix given.

# Examples

open allclose all

## Basic Examples(3)

Inverse of a 2×2 matrix:

Enter the matrix in a grid:

Inverse of a symbolic matrix:

## Scope(10)

### Basic Uses(6)

Find the inverse of a machine-precision matrix:

Invert a complex matrix:

Inverse of an exact matrix:

Inverse of an arbitrary-precision matrix:

Inverse of a symbolic matrix:

The inversion of large machine-precision matrices is efficient:

### Special Matrices(4)

The inverse of a sparse matrix is returned as a normal matrix:

Format the result:

When possible, the inverse of a structured matrix is returned as another structured matrix:

This is not always possible:

IdentityMatrix is its own inverse:

Inverse of HilbertMatrix:

## Applications(3)

Exact inverse of a Hilbert matrix:

Plot the imaginary parts of a Vandermonde matrix for a discrete Fourier transform:

Plot the inverse of a matrix, shading according to absolute value:

Show positive entries as black and others as white:

## Possible Issues(3)

The inverse may not exist: Typically a pseudo inverse does:

Full inverses do not exist for rectangular matrices: Accurate inverses cannot be found for ill-conditioned machine-precision numerical matrices: Exact result:

Arbitrary-precision result: