Inverse Matrix Calculator

Size:
A =

Lesson on Inverse Matrices

Lesson Contents

Rules for an Inverse Matrix

A square matrix A is invertible if there exists an inverse matrix A-1 such that:
A×A-1 = A-1×A = I
Where I is the identity matrix of A and A×A-1 denotes matrix multiplication of the original and inverse matrix.

The inverse matrix is not a result of dividing 1 by the matrix (such as 5-1 = 15), rather, calculating it is a process that requires several steps and depends on the size of the matrix. Sometimes we will not even know if A is invertible until we have performed several calculation steps.

How to Calculate the Inverse Matrix

Hand calculating the inverse matrix is a process that depends on the size of the matrix. For a 2×2 matrix, we may follow a simple formula that is shown below. For a 3×3 matrix, we may use the much larger and more complex formula that is also shown below.

However, anything larger than a 3×3 matrix is very complex to solve by hand. For 4×4 and larger matrices, finding the inverse is best done by using a calculator. It is unlikely that we will be tested on our ability to invert a 4×4 or larger matrix by hand and calculators can perform inversion very quickly.

The formula for the inverse of a 2×2 matrix is given as:
$${A}={\begin{bmatrix}a&b\\c&d\\\end{bmatrix}} \quad {A}^{-1}={\frac {1}{ad-bc}}{\begin{bmatrix}\,\,\,d&\!\!-b\\-c&\,a\\\end{bmatrix}}$$
The formula for the inverse of a 3×3 matrix is given as:
$${A}={\begin{bmatrix}a&b&c\\d&e&f\\g&h&i\\\end{bmatrix}} \quad {A}^{-1}={\frac {1}{\det(\mathbf {A} )}}{\begin{bmatrix}\,A&\,D&\,G\\\,B&\,E&\,H\\\,C&\,F&\,I\\\end{bmatrix}}$$
$${\begin{alignedat}{6}A&={}&(ei-fh)&\quad &D&={}&-(bi-ch)&\quad &G&={}&(bf-ce)\\B&={}&-(di-fg)&\quad &E&={}&(ai-cg)&\quad &H&={}&-(af-cd)\\C&={}&(dh-eg)&\quad &F&={}&-(ah-bg)&\quad &I&={}&(ae-bd)\\\end{alignedat}}$$

How the Calculator Works

The calculator on this page is written in the programming language JavaScript (JS) and utilizes a JS native computer algebra system (CAS). Your device’s internet browser contains a built-in JS engine that runs the calculator’s code, allowing for near-instant solutions at the click of a button.

When the calculate button is clicked, your inputted matrix is built into a two-dimensional JS array using a nested for loop. Then, the array is fed to the CAS which performs symbolic operations to convert the input matrix to its inverse matrix. The inverse matrix is formatted into LaTeX (a math rendering language) and displayed in the answer area of the calculator.

Many matrices are not invertible because they do not meet the requirements for having an inverse. When the inputted matrix is not invertible or an error occurs during calculations, the calculator displays an error message in the answer area.

Scroll to Top