Search for a tool
Inverse of a Matrix

Tool to invert a matrix. The inverse of a square matrix M is a matrix denoted M^-1 such as que M.M^-1=I where I is the identity matrix.

Results

Inverse of a Matrix -

Tag(s) : Matrix

Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!

Please, check our community Discord for help requests!

Thanks to your feedback and relevant comments, dCode has developed the best 'Inverse of a Matrix' tool, so feel free to write! Thank you!

# Inverse of a Matrix

## Square Matrix Inverse Calculator NxN

(if this message do not disappear, try to refresh this page)

## Matrix Modular Inverse Calculator

(if this message do not disappear, try to refresh this page)

Tool to invert a matrix. The inverse of a square matrix M is a matrix denoted M^-1 such as que M.M^-1=I where I is the identity matrix.

## Answers to Questions

### How to calculate the inverse of an invertible matrix?

The inverse of a square matrix is calculated in several ways, the easiest is the cofactor method which necessitate to calculate the determinant of the matrix but also the comatrix and its transposed matrix:

$$M^{-1}=\frac1{\det M} \,^{\operatorname t}\!{{\rm com} M} = \frac1{\det M} \,^{\rm t}\!C$$

The dCode calculator works for any size of square matrix.

For a 2x2 matrix (order 2):

$$M^{-1} = \begin{bmatrix} a & b \\ c & d \\ \end{bmatrix}^{-1} = \frac{1}{\det(M)} \begin{bmatrix} d & -b \\ -c & a \\ \end{bmatrix} = \frac{1}{ad - bc} \begin{bmatrix} d & -b \\ -c & a \\ \end{bmatrix}$$

Example: $$M = \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ \end{bmatrix} \Rightarrow M^{-1} = \frac{1}{\det(M)} \begin{bmatrix} 4 & -2 \\ -3 & 1 \\ \end{bmatrix} = -\frac{1}{2} \begin{bmatrix} 4 & -2 \\ -3 & 1 \\ \end{bmatrix}$$

For a 3x3 matrix (order 3):

$$M^{-1} = \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix}^{-1} = \left( \begin{bmatrix} \frac{e i-f h}{-c e g+b f g+c d h-a f h-b d i+a e i} & \frac{c h-b i}{-c e g+b f g+c d h-a f h-b d i+a e i} & \frac{b f-c e}{-c e g+b f g+c d h-a f h-b d i+a e i} \\ \frac{f g-d i}{-c e g+b f g+c d h-a f h-b d i+a e i} & \frac{a i-c g}{-c e g+b f g+c d h-a f h-b d i+a e i} & \frac{c d-a f}{-c e g+b f g+c d h-a f h-b d i+a e i} \\ \frac{d h-e g}{-c e g+b f g+c d h-a f h-b d i+a e i} & \frac{b g-a h}{-c e g+b f g+c d h-a f h-b d i+a e i} & \frac{a e-b d}{-c e g+b f g+c d h-a f h-b d i+a e i} \end{bmatrix} \right)$$

It is essential that the determinant of the matrix to be inverted is not equal to zero for the matrix to be invertible.

### How to prove that a matrix is invertible?

A matrix is invertible if its determinant is non-zero (different from 0).

A non invertible matrix is called singular (inversion is not possible).

Avoid the term inversible which is wrong.

### How to inverse a matrix with zero determinant?

A matrix with a determinant equal to 0 is not invertible. It does not have an inverse, it is not possible to calculate its inverse.

### How to check that a matrix is the inverse of another?

The multiplication of the matrix by its inverse must give the identity matrix. So the computation of $M . M^{-1} = I$.

### How to calculate the modular inverse of a matrix?

The principle is the same, but instead of calculating the determinant, calculate the modular inverse of the matrix determinant.

## Source code

dCode retains ownership of the online 'Inverse of a Matrix' tool source code. Except explicit open source licence (indicated CC / Creative Commons / free), any algorithm, applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any function (convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (PHP, Java, C#, Python, Javascript, Matlab, etc.) no data, script or API access will be for free, same for Inverse of a Matrix download for offline use on PC, tablet, iPhone or Android !

## Need Help ?

Please, check our community Discord for help requests!

## Questions / Comments

Thanks to your feedback and relevant comments, dCode has developed the best 'Inverse of a Matrix' tool, so feel free to write! Thank you!

Source : https://www.dcode.fr/matrix-inverse
© 2021 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.
Feedback