Matrix Multiplication Calculator

Enter Matrix A:
Enter Matrix B:
Matrix Visualization

Matrix Multiplication

What is Matrix Multiplication?

Matrix multiplication is a fundamental operation in linear algebra. It involves multiplying two matrices to produce a new matrix. This operation is crucial in various fields, including computer graphics, physics, and data analysis.

The Matrix Multiplication Formula

For two matrices A and B to be multiplied, the number of columns in A must equal the number of rows in B. If A is an m × n matrix and B is an n × p matrix, their product AB will be an m × p matrix.

The formula for matrix multiplication is:

\[(AB)_{ij} = \sum_{k=1}^n a_{ik}b_{kj}\]

Where:

  • \((AB)_{ij}\) is the element at the i-th row and j-th column of the resulting matrix
  • \(a_{ik}\) is the element at the i-th row and k-th column of matrix A
  • \(b_{kj}\) is the element at the k-th row and j-th column of matrix B
  • n is the number of columns in A (which equals the number of rows in B)

Calculation Steps

Let's multiply two 2×2 matrices:

\[A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}, B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}\]
  1. Calculate \((AB)_{11}\): \[(AB)_{11} = (1 \times 5) + (2 \times 7) = 5 + 14 = 19\]
  2. Calculate \((AB)_{12}\): \[(AB)_{12} = (1 \times 6) + (2 \times 8) = 6 + 16 = 22\]
  3. Calculate \((AB)_{21}\): \[(AB)_{21} = (3 \times 5) + (4 \times 7) = 15 + 28 = 43\]
  4. Calculate \((AB)_{22}\): \[(AB)_{22} = (3 \times 6) + (4 \times 8) = 18 + 32 = 50\]

The result is:

\[AB = \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix}\]

Visual Representation

A B AB × =

This diagram illustrates the multiplication of matrices A and B to produce the result AB.