Matrix Calculator

Perform matrix operations including addition, subtraction, multiplication, and determinant calculation.

Matrix 1

Matrix 2

Example Calculations

Addition

Multiplication

Determinant

Matrix Operations

Addition and Subtraction

  • • Matrices must have the same dimensions
  • • Operations are performed element by element
  • • Result has the same dimensions as the original matrices
  • • Matrix addition is commutative: A + B = B + A

Multiplication

  • • For A × B, columns in A must equal rows in B
  • • Result dimensions: [rows of A] × [columns of B]
  • • Element at position (i,j) is the dot product of row i from A and column j from B
  • • Matrix multiplication is NOT commutative: A × B ≠ B × A

Determinant and Properties

Determinant Calculation

  • • 2×2 matrix: ad - bc for [[a,b],[c,d]]
  • • n×n matrix: computed using cofactor expansion
  • • Only defined for square matrices

Special Cases

  • • For identity matrix: det(I) = 1
  • • For triangular matrices: product of diagonal elements
  • • det(AB) = det(A) × det(B)
  • • det(AT) = det(A)
  • • det(kA) = kn × det(A) for n×n matrix

Applications

  • • Testing for matrix invertibility (det ≠ 0)
  • • Solving systems of linear equations
  • • Finding eigenvalues
  • • Calculating volume scaling in transformations

Modern applications of matrices include calculations in financial models, computer science (especially in machine learning), economics, and engineering, where matrices help solve complex optimization problems, data processing, and numerical analysis.

Basic Matrix Functions

1. Matrix Addition and Subtraction

Matrix addition and subtraction are possible only if the matrices have the same dimensions. The operation is performed by element-wise addition or subtraction of matrix elements.

Example:

Matrix A:

A = | 1  2 | | 3  4 |

Matrix B:

B = | 5  6 | | 7  8 |

Result of addition:

A + B = | 1+5  2+6 | | 3+7  4+8 | = | 6  8 | | 10 12 |

2. Matrix Multiplication

Matrix multiplication is possible only if the number of columns in one matrix is equal to the number of rows in the other. The multiplication is performed according to a formula, where the elements of the resulting matrix are sums of the products of rows and columns.

Example:

Matrix A:

A = | 1  2 | | 3  4 |

Matrix B:

B = | 5  6 | | 7  8 |

Result of multiplication:

A × B = | (1×5 + 2×7)  (1×6 + 2×8) | | (3×5 + 4×7)  (3×6 + 4×8) | = | 19  22 | | 43  50 |

3. Matrix Transposition

Matrix transposition involves changing rows into columns and vice versa. This operation allows you to alter the orientation of the matrix, which is useful in many mathematical and physical problems.

Example:

Matrix A:

A = | 1  2 | | 3  4 |

Result of transposition:

AT = | 1  3 | | 2  4 |

4. Matrix Determinant Calculation

The determinant is a scalar value that characterizes the properties of the matrix, such as its invertibility. For a 2x2 matrix, the determinant is calculated using the formula:

det(A) = a × d - b × c

For a 3x3 matrix, the determinant is calculated using more complex formulas, but there are standard methods and algorithms for larger sizes.

Example:

Matrix A:

A = | 1  2 | | 3  4 |

Determinant:

det(A) = (1×4) - (2×3) = 4 - 6 = -2

5. Inverse Matrix

If the determinant of the matrix is non-zero, the matrix has an inverse. The inverse matrix is calculated using a specific formula that depends on the determinant and the elements of the matrix.

Example:

Matrix A:

A = | 1  2 | | 3  4 |

Inverse matrix:

A-1 = 1 / det(A) × | d  -b | | -c  a | = 1 / -2 × | 4  -2 | | -3  1 | = | -2  1 | | 1.5 -0.5 |