Inverse[m]
gives the inverse of a square matrix m.


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 ill‐conditioned matrices.
- The following options can be given
-
Method Automatic method to use Modulus 0 integer modulus to use ZeroTest Automatic test for whether an element is zero - Inverse[m,Modulus->p] evaluates the inverse of rational matrices modulo the integer n. If n is zero, ordinary arithmetic is used. If n is not prime, the computation may fail. »
- Inverse[m,ZeroTest->test] evaluates test[m[[i,j]]] to determine whether matrix elements are zero.
- Settings of Method applicable to exact and symbolic matrices include "CofactorExpansion", "DivisionFreeRowReduction", and "OneStepRowReduction". The default setting of Automatic switches among these methods depending on the matrix given.
- Inverse[m] formats as
in StandardForm and TraditionalForm. »
Examples
open all close allBasic Examples (3)
Scope (14)
Basic Uses (9)
Find the inverse of a machine-precision matrix:
Inverse of an arbitrary-precision matrix:
Verifying a symbolic inverse may require simplification:
The inversion of large machine-precision matrices is efficient:
Inverse of a matrix over a finite field:
Inverse of a CenteredInterval matrix:
Find a random representative mrep of m:
Special Matrices (5)
The inverse of a sparse matrix is returned as a normal matrix:
When possible, the inverse of a structured matrix is returned as another structured matrix:
IdentityMatrix is its own inverse:
Inverse of HilbertMatrix:
Visualize the inverses for several matrix sizes:
Compute the inverse of a matrix of univariate polynomials of degree
:
Options (7)
Method (4)
The Automatic method attempts to use a method appropriate for a given matrix:
Here, the Automatic method has avoided numerical instability possible for some methods when applied to an ill-conditioned matrix:

Generate a random numeric matrix with small off-diagonal elements and compute its inverse using various methods:
The results are very close but can differ slightly in the least significant digits due to numerical precision handling:
Compare timings using different methods on a matrix with exact numeric entries:
Create a matrix with several symbolic elements:
Compare timings and result sizes using the different methods on this matrix:
Modulus (1)
ZeroTest (1)
Applications (10)
Solving Equations (4)
Solve the system of equations ,
,
. First, form the coefficient matrix
and constant vector
:
Substitute the solution into the original system of equations to verify the solution:
Multiplying both sides of the equation on the left by shows
:
Confirm the result using LinearSolve:
For numerical and especially sparse systems, LinearSolve can be considerably faster:
Multiplying both sides of the equation on the left by shows
:
Substitute the solution into the equation for verification:
Solve the system of ODEs ,
,
. First, construct the coefficient matrix
for the right-hand side:
Find the eigenvalues and eigenvectors:
Construct a diagonal matrix whose entries are the exponential of :
Construct the matrix whose columns are the corresponding eigenvectors:
The general solution is , for three arbitrary starting values:
Verify the solution using DSolveValue:
Change of Basis/Coordinates (6)
Express a general vector in as a linear combination of the vectors
,
and
. First, verify the vectors are linearly independent by checking that their null space is empty:
Form the matrix whose columns are the basis vectors:
The coefficients of a general vector are given by
:
Verify that does indeed equal the linear combination
:
Find the change-of-basis matrix that transforms coordinates with respect to the basis to coordinates with respect to the basis
:
The matrix whose columns are the
transforms from
-coordinates to standard coordinates:
The matrix whose columns are the
transforms from
-coordinates to standard coordinates:
Its inverse converts from standard coordinates back to -coordinates:
Therefore, converts from
-coordinates to
-coordinates:
Express the linear operator whose representation in the standard is given by
in the basis
,
,
The matrix whose columns are the
transforms from
-coordinates to standard coordinates:
Its inverse converts from standard coordinates to -coordinates:
Therefore the representation of in
-coordinates is:
Inverse can be used to diagonalize a matrix as . Compute
's eigenvalues and eigenvectors:
Construct a diagonal matrix from the eigenvalues and a matrix
whose columns are the eigenvectors:
Any function of the matrix can now be computed as . For example, MatrixPower:
Similarly, MatrixExp becomes trivial, requiring only exponentiating the diagonal elements of :
Inverse of a transformation matrix gives the matrix for the reverse operation. For example, consider a translation by :
The inverse of its transformation matrix gives a translation by the opposite motion:
Consider a general affine transformation:
Construct the inverse transformation:
Verify that the two transformations really do undo each other:
For a mapping , the Jacobian of the inverse mapping
is given by
. Consider the mapping from Cartesian to spherical coordinates:
Compute the Jacobian at the point :
The inverse mapping is the transformation from spherical back to Cartesian coordinates:
Compute the Jacobian of the inverse mapping at the coordinates corresponding to
:
Properties & Relations (13)
Inverse satisfies the relation for an
matrix
:
Inverse satisfies the relation :
Inverse satisfies the relation :
A square matrix has an inverse if and only if its determinant is nonzero:

Moreover, determinant of the inverse equals
:
MatrixPower[m,-1] equals Inverse[m]:
For an invertible matrix , Inverse[a] equals Adjugate[a]/Det[a]:
Inverse[m] equals LinearSolve[m,IdentityMatrix[n]] for an invertible n×n matrix:
The inverse of an orthogonal matrix is given by Transpose:
The inverse of a unitary matrix is given by ConjugateTranspose:
A matrix and its inverse have the same symmetry:
A QuantityArray and its inverse have reciprocal units:
For an invertible matrix , Inverse[a] and PseudoInverse[a] coincide:
PseudoInverse extends to singular as well as rectangular matrices:
For an invertible matrix , Inverse[a] and DrazinInverse[a] coincide:
DrazinInverse extends to singular square matrices:
Possible Issues (4)

Typically a pseudo inverse does:
Full inverses do not exist for rectangular matrices:

Use PseudoInverse instead:
Accurate inverses cannot be found for ill-conditioned machine-precision numerical matrices:

The computation may fail if a non-prime modulus is provided:

See Also
PseudoInverse LinearSolve RowReduce NullSpace LinearSolveFunction DrazinInverse Adjugate MatrixRank
Function Repository: LinearAlgebraMod TridiagonalInverse
History
Introduced in 1988 (1.0) | Updated in 1996 (3.0) ▪ 2022 (13.2) ▪ 2024 (14.0) ▪ 2025 (14.3)
Text
Wolfram Research (1988), Inverse, Wolfram Language function, https://reference.wolfram.com/language/ref/Inverse.html (updated 2025).
CMS
Wolfram Language. 1988. "Inverse." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/Inverse.html.
APA
Wolfram Language. (1988). Inverse. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Inverse.html
BibTeX
@misc{reference.wolfram_2025_inverse, author="Wolfram Research", title="{Inverse}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/Inverse.html}", note=[Accessed: 13-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_inverse, organization={Wolfram Research}, title={Inverse}, year={2025}, url={https://reference.wolfram.com/language/ref/Inverse.html}, note=[Accessed: 13-August-2025]}