# Matrix, Determinant and Vector Calculations with Online Calculators

## Term Matrix

As matrix is called a system of elements aij, which are arranged in a 2-dimensional rectangular pattern. The scheme of m-rows and n-columns is called a (m, n)-matrix or a m x n matrix. The position of an element within the matrix is characterized by two subscripts. The first index is the row number and the second index is the column number. The numbering starts at the top left of the matrix and going from left to right and from top to bottom. If for a matrix is n = m then the matrix is called a square matrix.

$A=\left({a}_{ij}\right)=\left(\begin{array}{cccc}{a}_{11}& {a}_{12}& \dots & {a}_{1m}\\ {a}_{21}& {a}_{22}& \dots & {a}_{2m}\\ & ⋮\\ {a}_{n1}& {a}_{n2}& \dots & {a}_{nm}\end{array}\right)$

### Main Diagonal

The elements of the matrix for the subscripts i = j are the main diagonal elements. The elements from the lower left to upper right are referred as secondary diagonal.

Here the main diagonal elements are shown in red color:

$\left(\begin{array}{cccc}{a}_{11}& {a}_{12}& \dots & {a}_{1m}\\ {a}_{21}& {a}_{22}& \dots & {a}_{2m}\\ & ⋮\\ {a}_{n1}& {a}_{n2}& \dots & {a}_{nm}\end{array}\right)$

and the secondary diagonal elements in green color:

$\left(\begin{array}{ccccc}{a}_{11}& {a}_{12}& \dots & {a}_{1\mathrm{m-1}}& {a}_{1m}\\ {a}_{21}& {a}_{22}& \dots & {a}_{2\mathrm{m-1}}& {a}_{2m}\\ & ⋮\\ {a}_{n1}& {a}_{n2}& \dots & {a}_{n\mathrm{m-1}}& {a}_{nm}\end{array}\right)$

### Unit Matrix

The matrix in which all elements of the main diagonal equal to 1 and all other elements are equal to 0 means unit matrix E.

$E=\left(\begin{array}{cccc}1& 0& \dots & 0\\ 0& 1& \dots & 0\\ & ⋮\\ 0& 0& \dots & 1\end{array}\right)$

### Transposed Matrix

The matrix mirrored on the main diagonal is called the matrix transpose. For a matrix A = (aij) the transposed matrix AT = (aji). The transposed of a transposed matrix is the matrix itself A = (AT)T.

${A}^{T}={\left({a}_{ij}\right)}^{T}={\left(\begin{array}{cccc}{a}_{11}& {a}_{12}& \dots & {a}_{1m}\\ {a}_{21}& {a}_{22}& \dots & {a}_{2m}\\ & ⋮\\ {a}_{n1}& {a}_{n2}& \dots & {a}_{nm}\end{array}\right)}^{T}=\left(\begin{array}{cccc}{a}_{11}& {a}_{21}& \dots & {a}_{n1}\\ {a}_{12}& {a}_{22}& \dots & {a}_{n2}\\ & ⋮\\ {a}_{1m}& {a}_{2m}& \dots & {a}_{nm}\end{array}\right)$

### Determinant

Each square matrix can be assigned a unique number, which is called the determinant (det(A)) of the matrix. In general, the determinant of an NxN matrix is defined by the Leibniz formula:

$det A= ∑ σ ∈ Sn ( sgn (σ) Π i = 1 n Aiρ(i) )$

here the sum has to be extended over all the permutations σ. Thus, from the elements of A, all possible products are formed for each n-element in such a way that each of the products of each row and column contains exactly one element. These products are added and the sum is the determinant of A. The sign of the summands is positive for even permutations and negative for odd permutations.

### Calculation Rules for Matrices

The matrix multiplication is associative:

$A⋅(B⋅C)=(A⋅B)⋅C$

The matrix multiplication and matrix addition are distributive:

$A⋅(B+C)=A⋅B+A⋅C$

For addition and multiplication by real numbers λ, μ:

$(λ+μ)⋅A=λ⋅A+μ⋅A$

and:

$λ⋅(A+B)=λ⋅A+λ⋅B$

There are zero divisor matrices A ≠ 0 and B ≠ 0 applies to

$A⋅B=0$

For square matrices is:

$det(A+B)=det(A)+det(B)$

### Inverse Matrix

The inverse matrix A-1 is defined by the following equation

$A⋅A-1=E$

Matrices for which an inverse exists is referred to as regular matrices. Matrices which have no inverse are called singular matrices.

For the inverse matrix, the following calculation rules are valid:

$(A⋅B)-1=A-1⋅B-1$

$(A-1)-1=A$

The calculation of the inverse matrix A-1 is either done by the Gauss-Jordan algorithm or with the adjuncts. The Gauss-Jordan method transforms the matrix (A | E) in the form (E | A-1) from which the inverse can be read directly. With the adjuncts and the determinant the inverse can be calculated directly as

$A-1=1det(A)adj(A)T$

### Clases of Matrices

A square matrix A is called a symmetric matrix if and only if AT = A and a antisymmetric matrix applies if AT = A. A orthogonal matrix if and only if AT = A-1

The adjunct of matrix A is calculated in a way that for each matrix element aij is set a sub determinant with removing the line i and the column j. The value of this determinat is multiplied by (-1)i+j that gives the element i,j of the adjungate matrix.

## Matrix Calculations

### Matrix Summation

The addition of two matrices A and B is done by adding the elements of the matrices. C = A + B with ci, j = ai, j + b i, j

$\left(\begin{array}{cccc}{a}_{11}& {a}_{12}& \dots & {a}_{1m}\\ {a}_{21}& {a}_{22}& \dots & {a}_{2m}\\ & ⋮\\ {a}_{n1}& {a}_{n2}& \dots & {a}_{nm}\end{array}\right)+\left(\begin{array}{cccc}{b}_{11}& {b}_{12}& \dots & {b}_{1m}\\ {b}_{21}& {b}_{22}& \dots & {b}_{2m}\\ & ⋮\\ {b}_{n1}& {b}_{n2}& \dots & {b}_{nm}\end{array}\right)=\left(\begin{array}{cccc}{a}_{11}+{b}_{11}& {a}_{12}+{b}_{12}& \dots & {a}_{1m}+{b}_{1m}\\ {a}_{21}+{b}_{21}& {a}_{22}+{b}_{22}& \dots & {a}_{2m}+{b}_{2m}\\ & ⋮\\ {a}_{n1}+{b}_{n1}& {a}_{n2}+{b}_{n2}& \dots & {a}_{nm}+{b}_{nm}\end{array}\right)$

Calculator for the addition of two matrices:

 +
 =

A general calculator for the sum of NxM matrices is here: Sum and dif of MxN matrices

### Matrices Subtraction

The subtraction of two matrices A and B is by subtracting the elements of the matrices. C = A - B with c i, j = a i, j - b i, j

$\left(\begin{array}{cccc}{a}_{11}& {a}_{12}& \dots & {a}_{1m}\\ {a}_{21}& {a}_{22}& \dots & {a}_{2m}\\ & ⋮\\ {a}_{n1}& {a}_{n2}& \dots & {a}_{nm}\end{array}\right)-\left(\begin{array}{cccc}{b}_{11}& {b}_{12}& \dots & {b}_{1m}\\ {b}_{21}& {b}_{22}& \dots & {b}_{2m}\\ & ⋮\\ {b}_{n1}& {b}_{n2}& \dots & {b}_{nm}\end{array}\right)=\left(\begin{array}{cccc}{a}_{11}-{b}_{11}& {a}_{12}-{b}_{12}& \dots & {a}_{1m}-{b}_{1m}\\ {a}_{21}-{b}_{21}& {a}_{22}-{b}_{22}& \dots & {a}_{2m}-{b}_{2m}\\ & ⋮\\ {a}_{n1}-{b}_{n1}& {a}_{n2}-{b}_{n2}& \dots & {a}_{nm}-{b}_{nm}\end{array}\right)$

Calculator for subtraction of two matrices:

 -
 =

A general calculator for the subtraction of NxM matrices is here: Sum and dif of MxN matrices

### Matrix multiplication by a scalar

Multiplying a matrix by a scalar is by multiplying each by the scalar matrix elements. a * B = a * bi,j

$\lambda \cdot \left(\begin{array}{cccc}{a}_{11}& {a}_{12}& \dots & {a}_{1m}\\ {a}_{21}& {a}_{22}& \dots & {a}_{2m}\\ & ⋮\\ {a}_{n1}& {a}_{n2}& \dots & {a}_{nm}\end{array}\right)=\left(\begin{array}{cccc}\lambda \cdot {a}_{11}& \lambda \cdot {a}_{12}& \dots & \lambda \cdot {a}_{1m}\\ \lambda \cdot {a}_{21}& \lambda \cdot {a}_{22}& \dots & \lambda \cdot {a}_{2m}\\ & ⋮\\ \lambda \cdot {a}_{n1}& \lambda \cdot {a}_{n2}& \dots & \lambda \cdot {a}_{nm}\end{array}\right)$

Calculator for the multiplication of a matrix by a scalar:

 ⋅
 =

### Matrix Multiplication

The multiplication of two matrices A and B requires that the number of columns of the first matrix is equal to the number of rows of the second matrix. The product obtained by multiplying the row and column elements and summed. For the first element of the result matrix, the elements of the first row of the first matrix are multiplied by the elements of the first column of the second matrix and summed. For the other elements the same for the other rows and columns.

$\left(\begin{array}{cccc}{a}_{11}& {a}_{12}& \dots & {a}_{1m}\\ {a}_{21}& {a}_{22}& \dots & {a}_{2m}\\ & ⋮\\ {a}_{n1}& {a}_{n2}& \dots & {a}_{nm}\end{array}\right)\cdot \left(\begin{array}{cccc}{b}_{11}& {b}_{12}& \dots & {b}_{1j}\\ {b}_{21}& {b}_{22}& \dots & {b}_{2j}\\ & ⋮\\ {b}_{m1}& {b}_{m2}& \dots & {b}_{mj}\end{array}\right)=\left(\begin{array}{cccc}\sum _{k=1}^{m}\left({a}_{1k}\cdot {b}_{k1}\right)& \sum _{k=1}^{m}\left({a}_{1k}\cdot {b}_{k2}\right)& \dots & \sum _{k=1}^{m}\left({a}_{1k}\cdot {b}_{kj}\right)\\ \sum _{k=1}^{m}\left({a}_{2k}\cdot {b}_{k1}\right)& \sum _{k=1}^{m}\left({a}_{2k}\cdot {b}_{k2}\right)& \dots & \sum _{k=1}^{m}\left({a}_{2k}\cdot {b}_{kj}\right)\\ & ⋮\\ \sum _{k=1}^{m}\left({a}_{nk}\cdot {b}_{k1}\right)& \sum _{k=1}^{m}\left({a}_{nk}\cdot {b}_{k2}\right)& \dots & \sum _{k=1}^{m}\left({a}_{nk}\cdot {b}_{kj}\right)\end{array}\right)$

Calculator for the multiplication of two square 3x3 matrices:

 ⋅
 =

Calculator for the multiplication of a 2x4 matrix with a 4x2 matrix:

 ⋅
 =

A general calculator for the multiplication of NxM matrices is here: Multiplication of matrices

### Sarrus rule

The determinant of a square 3x3 matrix is computed according to the Sarrus rule by subtracting the sum of the products of the main diagonal of the sum of the products of the secondary diagonal. Calculator for the determinant of a 3x3 matrix:

 det
 =

A general determinant solver is here:Determinant NxN

### Calculation of the Inverse by Gauss-Jordan

Wanted is the inverse matrix A-1 to the matrix A. For this, first with the identity matrix, the matrix E (A | E) is formed. By suitable transformations we managed to form the (E | A -1 ). In the following the steps of an example can be performed.

$A=\left(\begin{array}{cccc}{a}_{11}& {a}_{12}& \dots & {a}_{1N}\\ {a}_{21}& {a}_{22}& \dots & {a}_{2N}\\ & ⋮\\ {a}_{N1}& {a}_{N2}& \dots & {a}_{NN}\end{array}\right)$

Gauss-Jordan approach

$\left(A|E\right)=\left(\begin{array}{cccc}{a}_{11}& {a}_{12}& \dots & {a}_{1N}\\ {a}_{21}& {a}_{22}& \dots & {a}_{2N}\\ & ⋮\\ {a}_{N1}& {a}_{N2}& \dots & {a}_{NN}\end{array}|\begin{array}{cccc}1& 0& \dots & 0\\ 0& 1& \dots & 0\\ & ⋮\\ 0& 0& \dots & 1\end{array}\right)$

Transformations to get the following shape.

$\left(E|{A}^{-1}\right)=$ $\left(\begin{array}{cccc}1& 0& \dots & 0\\ 0& 1& \dots & 0\\ & ⋮\\ 0& 0& \dots & 1\end{array}|\begin{array}{cccc}{b}_{11}& {b}_{12}& \dots & {b}_{1N}\\ {b}_{21}& {b}_{22}& \dots & {b}_{2N}\\ & ⋮\\ {b}_{N1}& {b}_{N2}& \dots & {b}_{NN}\end{array}\right)$

A calculator for the inverse matrix is here:Solver Inverse Matrix

### Calculation of the adjugate matrix

The adjunct of matrix A is calculated in a way that for each matrix element aij is set a sub determinant with removing the line i and the column j. The value of this determinat is multiplied by (-1)i+j that gives the element i,j of the adjungate matrix.

${a}_{ij}^{*}={\left(-1\right)}^{\left(i+j\right)}|\begin{array}{ccccccc}{a}_{11}& {a}_{12}& \dots & {a}_{1,j-1}& {a}_{1,j+1}& \dots & {a}_{1n}\\ & ⋮\\ {a}_{i-1,1}& {a}_{i-1,2}& \dots & {a}_{i-1,j-1}& {a}_{i-1,j+1}& \dots & {a}_{i-1,n}\\ {a}_{i+1,1}& {a}_{i+1,2}& \dots & {a}_{i+1,j-1}& {a}_{i+1,j+1}& \dots & {a}_{i+1,n}\\ & ⋮\\ {a}_{n1}& {a}_{n2}& \dots & {a}_{n,j-1}& {a}_{n,j+1}& \dots & {a}_{nn}\end{array}|$

The result is the adjungate matrix.

$\mathrm{adj\left(}A\right)=\left(\begin{array}{cccc}{a}_{11}^{*}& {a}_{12}^{*}& \dots & {a}_{1n}^{*}\\ {a}_{21}^{*}& {a}_{22}^{*}& \dots & {a}_{2n}^{*}\\ & ⋮\\ {a}_{n1}^{*}& {a}_{n1}^{*}& \dots & {a}_{nn}^{*}\end{array}\right)$