# nxn Inverse Matrix Calculator

Matrix A

|A|  =  -70

A-1

The resulting matrix should be simplified
CALCULATE

nxn Inverse Matrix Calculator calculates a inverse of a square matrix $A$ with real elements. It is an online math tool specially programmed to calculate the inverse matrices of given 2x2, 3x3 and 4x4 matrices. Select the appropriate calculator from the list of three.
It is necessary to follow the next steps:

1. Enter elements of matrix in the box. Elements of matrices must be real numbers.
2. Press the "GENERATE WORK" button to make the computation;
3. $n\times n$ inverse matrix calculator will give the matrix which represents the inverse matrix of the given matrix.
Input: A matrix with real elements;
Output: A matrix with real elements.

Inverse Matrix Formula:
2x2 Inverse Matrix Formula:
The inverse matrix of the matrix $A=\left( \begin{array}{cc} a & b \\ c &d \\ \end{array} \right)$ is determined by the following formula
$$A^{-1}=\frac{1}{ad-bc}\left( \begin{array}{cc} d & -b \\ -c &a \\ \end{array} \right)$$
3x3 Inverse Matrix Formula:
The inverse matrix of the matrix $A=\left( \begin{array}{ccc} a & b & c \\ d& e & f \\ g & h & i \\ \end{array} \right)$ is determined by the following formula
\begin{align} A^{-1}&=\frac{1}{det(A)}\left( \begin{array}{ccc} +\left| \begin{array}{cc} e & f \\ h &i \\ \end{array} \right| & -\left| \begin{array}{cc} b & c \\ h &i \\ \end{array} \right| & +\left| \begin{array}{cc} b & c \\ e &f \\ \end{array} \right| \\ \ -\left| \begin{array}{cc} d & f \\ g &i \\ \end{array} \right|& +\left| \begin{array}{cc} a & c \\ g &i \\ \end{array} \right| & -\left| \begin{array}{cc} a & c \\ d &f \\ \end{array} \right| \\ \ +\left| \begin{array}{cc} d & e \\ g &h \\ \end{array} \right| & -\left| \begin{array}{cc} a & b \\ g &h \\ \end{array} \right| & +\left| \begin{array}{cc} a & b \\ d &e \\ \end{array} \right| \\ \end{array} \right)\\ \newline &=\frac{\left( \begin{array}{ccc} ei-fh & hc-ib & bf-ce \\ gf-di& ai-gc & dc-af \\ dh-ge & gb-ah & ae-db\\ \end{array} \right)}{aei+bfg+cdh-ceg-afh-bdi}\end{align}
4x4 Inverse Matrix Formula:
The inverse matrix of the matrix $A=\left( \begin{array}{cccc} a & b & c & d \\ e & f & g & h \\ i & j & k & l \\ m & n & o & p \\ \end{array} \right)$ is determined by the following formula \begin{align} A^{-1}&=\frac{1}{det(A)}adj({A})\end{align} where $adj({A})$ is the adjugate matrix of $A$. Adjugate matrix of $A$ is
\begin{align} adj({A})&=\left( \begin{array}{cccc} a_{11} & a_{12} & a_{13} & a_{14} \\ a_{21} & a_{22} & a_{23} & a_{24} \\ a_{31} & a_{32} & a_{33} & a_{34} \\ a_{41} & a_{42} & a_{43} & a_{44} \\ \end{array} \right)\end{align} \begin{align} &a_{11}= -h k n+g l n+h j o-f l o-g j p+f k p \\ &a_{12}=d k n-c l n-d j o+b l o+c j p-b k p\\ &a_{13}=-d g n+c h n+d f o-b h o-c f p+b g p\\ &a_{14}=d g j-c h j-d f k+b h k+c f l-b g l\\ &a_{21}= h k m-g l m-h i o+e l o+g i p-e k p\\ &a_{22}= -d k m+c l m+d i o-a l o-c i p+a k p\\ &a_{23}= d g m-c h m-d e o+a h o+c e p-a g p\\ &a_{24}=-d g i+c h i+d e k-a h k-c e l+a g l\\ &a_{31}= -h j m+f l m+h i n-e l n-f i p+e j p\\ &a_{32}= d j m-b l m-d i n+a l n+b i p-a j p\\ &a_{33}= -d f m+b h m+d e n-a h n-b e p+a f p\\ &a_{34}=d f i-b h i-d e j+a h j+b e l-a f l \\ &a_{41}= g j m-f k m-g i n+e k n+f i o-e j o\\ &a_{42}= -c j m+b k m+c i n-a k n-b i o+a j o\\ &a_{43}=c f m-b g m-c e n+a g n+b e o-a f o\\ &a_{44}=-c f i+b g i+c e j-a g j-b e k+a f k \end{align}

## What is Inverse Matrix?

A square matrix is a matrix with the same number of rows and columns. A square matrix with all elements as zeros except for the main diagonal, which has only ones, is called an identity matrix. The identity matrix for multiplication for any square matrix $A$ is the matrix $I$, such that $IA=A$ and $AI=A$. For instance, the following matrices

$$I_1=(1),\; I_2=\left( \begin{array}{cc} 1 & 0 \\ 0 & 1 \\ \end{array} \right),\ldots ,I_n=\left( \begin{array}{cccc} 1 & 0 & \ldots & 0 \\ 0 & 1 & \ldots & 0 \\ \ldots & \ldots & \ldots & \ldots \\ 0 & 0 & \ldots & 1 \\ \end{array} \right)$$
are identity matrices of size 1x1, 2x2, .... nxn respectively. Let $A$ be a nxn square matrix. A matrix $B$ of the same size nxn is called the inverse matrix of the matrix $A$ if $$AB=BA=I$$ where $I$ is an $n\times n$ identity matrix. For a square matrix $A$, its inverse matrix is denoted by $A^{-1}$. If we multiply $A$ by its inverse matrix, $A^{-1}$, the result is the identity matrix $I$ of the corresponding size. Non-square matrices do not have inverses. A square matrix $A$ which has an inverse $A^{-1}$ is called an invertible or non-singular matrix. Some square matrices do not have inverse matrices. A square matrix which does not have an inverse matrix is called a non-invertible or singular matrix.

### How to Find Inverse Matrix?

There are many different methods for finding the inverse of a given matrix. Some of them are: inverse of a matrix by Gauss-Jordan elimination and inverse of a matrix using minors, cofactors and adjugate. We will present the second one. The minor of an element of any $n\times n$ matrix is a $(n-1)\times (n-1)$ matrix determinant. If we delete the row and column containing the element, then we get appropriate minor. For example, the minor of the element $a$, element in the first row and first column, of the matrix

The matrix formed by all of the cofactors of a square matrix $A$ is called the cofactor matrix. The $a_{ij}$ cofactor is derived by multiplying the minor by $( - 1 )^{i + j}$. For example, the cofactor matrix of 3x3
matrix $A=\left( \begin{array}{ccc} a & b & c \\ d& e & f \\ g & h & i \\ \end{array} \right)$ is \begin{align}\left( \begin{array}{ccc} ( - 1 )^{1 + 1}\left| \begin{array}{cc} e & f \\ h &i \\ \end{array} \right| & ( - 1 )^{1 + 2} \left| \begin{array}{cc} d & f \\ g &i \\ \end{array} \right|& ( - 1 )^{1 + 3} \left| \begin{array}{cc} d & e \\ g &h \\ \end{array} \right|\\ \ ( - 1 )^{2 + 1}\left| \begin{array}{cc} b & c \\ h &i \\ \end{array} \right|& ( - 1 )^{2 + 2}\left| \begin{array}{cc} a & c \\ g &i \\ \end{array} \right| & ( - 1 )^{2 + 3}\left| \begin{array}{cc} a & b \\ g &h \\ \end{array} \right| \\ \ ( - 1 )^{3 + 1}\left| \begin{array}{cc} b & c \\ e &f \\ \end{array} \right| & ( - 1 )^{3 + 2}\left| \begin{array}{cc} a & c \\ d &f \\ \end{array} \right| & ( - 1 )^{3 + 3}\left| \begin{array}{cc} a & b \\ d &e \\ \end{array} \right| \\ \end{array} \right)\\ \newline = \left( \begin{array}{ccc} +\left| \begin{array}{cc} e & f \\ h &i \\ \end{array} \right| & - \left| \begin{array}{cc} d & f \\ g &i \\ \end{array} \right|& + \left| \begin{array}{cc} d & e \\ g &h \\ \end{array} \right|\\ \ -\left| \begin{array}{cc} b & c \\ h &i \\ \end{array} \right|& +\left| \begin{array}{cc} a & c \\ g &i \\ \end{array} \right| & -\left| \begin{array}{cc} a & b \\ g &h \\ \end{array} \right| \\ \ +\left| \begin{array}{cc} b & c \\ e &f \\ \end{array} \right| & -\left| \begin{array}{cc} a & c \\ d &f \\ \end{array} \right| &+\left| \begin{array}{cc} a & b \\ d &e \\ \end{array} \right| \\ \end{array} \right)\end{align}
The adjugate of a square matrix is the transpose of its cofactor matrix. The transpose of a matrix is a new matrix whose rows are the columns of the original. So,
$$adj(A)=\left( \begin{array}{ccc} +\left| \begin{array}{cc} e & f \\ h &i \\ \end{array} \right| & -\left| \begin{array}{cc} b & c \\ h &i \\ \end{array} \right| & +\left| \begin{array}{cc} b & c \\ e &f \\ \end{array} \right| \\ \ -\left| \begin{array}{cc} d & f \\ g &i \\ \end{array} \right|& +\left| \begin{array}{cc} a & c \\ g &i \\ \end{array} \right| & -\left| \begin{array}{cc} a & c \\ d &f \\ \end{array} \right| \\ \ +\left| \begin{array}{cc} d & e \\ g &h \\ \end{array} \right| & -\left| \begin{array}{cc} a & b \\ g &h \\ \end{array} \right| & +\left| \begin{array}{cc} a & b \\ d &e \\ \end{array} \right| \\ \end{array} \right)$$
For any nxn square matrix $A$, if $det(A)\ne0$, then the inverse matrix is determined by the formula $$A^{-1}=\frac{1}{det(A)}adj(A)$$ To find the inverse matrix of the given matrix $A$, we need to check whether a matrix $A$ invertible.
• If $det (A)\ne0$, the matrix $A$ is invertible;
• If $det (A)=0$, the matrix $A$ is not invertible or singular.
By help of the nxn inverse matrix calculator we can easily calculate the inverse matrix of the given matrix. If we assume that the matrix $A$ is invertible, i.e. $det(A)\ne 0$, in the following we will give a stepwise guide for calculation the inverse matrix of the given matrix:
• Find the determinant of the matrix $A$, $det(A)$;
• Find the minors of the matrix $A$;
• Find the cofactor matrix,
• Inverse matrix of the matrix $A$ is the scalar multiplication of the adjugate by $\frac 1{det(A)}$.
For example, let us find the inverse matrix of the matrix $A=\left( \begin{array}{ccc} 10 & 20 & 10 \\ 4 & 5 & 6 \\ 2 & 3 & 5 \\ \end{array} \right)$ Firstly, using the 3x3 matrix determinant formula, we obtain $det(A)=-70$. The cofactor matrix is
\begin{align}\left( \begin{array}{ccc} ( - 1 )^{1 + 1}\left| \begin{array}{cc} 5 & 6 \\ 3 &5 \\ \end{array} \right| & ( - 1 )^{1 + 2} \left| \begin{array}{cc} 4 & 6 \\ 2 &5 \\ \end{array} \right|& ( - 1 )^{1 + 3} \left| \begin{array}{cc} 4 & 5 \\ 2 &3 \\ \end{array} \right|\\ \\ ( - 1 )^{2 + 1}\left| \begin{array}{cc} 20 & 10 \\ 3 &5 \\ \end{array} \right|& ( - 1 )^{2 + 2}\left| \begin{array}{cc} 10 & 10 \\ 2 &5 \\ \end{array} \right| & ( - 1 )^{2 + 3}\left| \begin{array}{cc} 10 & 20 \\ 2 &3 \\ \end{array} \right| \\ \\ ( - 1 )^{3 + 1}\left| \begin{array}{cc} 20 & 10 \\ 5 &6 \\ \end{array} \right| & ( - 1 )^{3 + 2}\left| \begin{array}{cc} 10 & 10 \\ 4 &6 \\ \end{array} \right| & ( - 1 )^{3 + 3}\left| \begin{array}{cc} 10 & 20 \\ 4 &5 \\ \end{array} \right| \\ \end{array} \right)\\ \newline = \left( \begin{array}{ccc} 7 & -8& 2 \\ -70& 30&10 \\ 70 & -20 &-30\\ \end{array} \right)\end{align}
If we transpose the cofactor matrix, we get
$$\left( \begin{array}{ccc} 7 & -70& 70 \\ -8& 30&-20 \\ 2 & 10 &-30\\ \end{array} \right)$$
Finally, the inverse matrix $A^{-1}$ of the matrix $A$ is
$$A^{-1}=\frac 1{-70}\left( \begin{array}{ccc} 7 & -70& 70 \\ -8& 30&-20 \\ 2 & 10 &-30\\ \end{array} \right)=\left( \begin{array}{ccc} -\frac 1{10} & 1& 1 \\ \frac4{35}& -\frac37&\frac27 \\ -\frac{1}{35} & -\frac17 &\frac37\\ \end{array} \right)$$
The nxn inverse matrix work with steps shows the complete step-by-step calculation for finding a determinant of 4x4, 3x3 or 2x2 matrix $A$ using the matrix inverse formula. For any other matrices, just supply real numbers as elements of matrix and click on the GENERATE WORK button. The grade school students and people who study math use this nxn inverse matrix calculator to generate the work, verify the results of matrix inverse derived by hand, or do their homework problems efficiently. The grade school students can also use this calculator for solving system of linear equations.

### Real World Problems Using Inverse Matrix

Using inverse of matrix, we can solve matrix equations of the types $$AX=B,\quad\mbox{and}\quad XA=B$$ for given matrices $A$ and $B$. If $A^{-1}$ exists, solutions of these equations are

$$X=A^{-1}B,\quad\mbox{and}\quad X=BA^{-1}$$
The solutions of this type exist if and only if products $A^{-1}B$ and $BA^{-1}$ respectively exist. Inverse matrices are useful for $2D$ or $3D$ transformations. For instance, if we consider a point $(a,b)$ in the two-dimensional plane and rotate it around the origin by an angle $\theta$. So, we use the rotation matrix, defined as: $$R(\theta)=\left( \begin{array}{cc} \cos \theta & -\sin\theta \\ \sin\theta &\cos\theta \\ \end{array} \right)$$ If we multiply this matrix by a point, we get the point rotated around the origin by $\theta$. But, if we want to reverse the action, we should use the inverse of the matrix of rotation. So, this concept plays a significant role in computer graphics, particularly in $3D$ graphics and $3D$ simulations.

### Inverse Matrix Practice Problems

Practice Problem 1 :
Solve the matrix equation $\left( \begin{array}{cc} 1 & 7 \\ -1 &3 \\ \end{array} \right)X=\left( \begin{array}{cc} 1& -1 \\ -2 &2\\ \end{array} \right)$

Practice Problem 2:
Point $A'(3,5,1)$ is the image of the point $A$ after $90^o$ counterclockwise rotation about the origin $O$. Find the coordinate of the point $A$.

The nxn inverse matrix calculator, equations, example calculation, work with steps, real world problems and practice problems would be very useful for grade school students (K-12 education) to learn the concept of inverse matrix. This concept is conceived in almost all areas of science, so it will be helpful in solving more complex problems.