# Matrix Multiplication:

#### How to Multiply Matrices?

The multiplication of two matrices, A and B is possible if the number of columns in matrix A is equal to the number of rows in matrix B. To find the multiplication of two matrices, the elements of the columns of the first matrix are multiplied with the elements of the rows of the second matrix. Let's understand the multiplication of matrices by taking some examples.

#### Matrix Multiplication Examples:

Example(1): Find the multiplication of two matrices, A and B if $$A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ \end{bmatrix}$$, and $$B = \begin{bmatrix} 5 & 6 & 7 \\ 8 & 9 & 10 \\ \end{bmatrix}$$?

Solution: Here the matrix A has 2 columns, and matrix B has 2 rows hence the multiplication of these matrices A and B is possible. $$A \times B = \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ \end{bmatrix} \ \begin{bmatrix} 5 & 6 & 7 \\ 8 & 9 & 10 \\ \end{bmatrix}$$ $$= \begin{bmatrix} 5 + 16 & 6 + 18 & 7 + 20 \\ 15 + 32 & 18 + 36 & 21 + 40 \\ \end{bmatrix}$$ $$A \times B = \begin{bmatrix} 21 & 24 & 27 \\ 47 & 54 & 61 \\ \end{bmatrix}$$

Example(2): Find the multiplication of two matrices, A and B if $$A = \begin{bmatrix} 3 & 4 & 5 \\ 0 & 1 & 2 \\ \end{bmatrix}$$, and $$B = \begin{bmatrix} 2 & 6 \\ 4 & 8 \\ \end{bmatrix}$$?

Solution: Here the matrix A has 3 columns and matrix B has 2 rows, Hence the multiplication of matrices A and B $$(A \times B)$$ is not possible, However the multiplication of matrix B and matrix A $$(B \times A)$$ is possible because matrix B has 2 columns and matrix A has 2 rows.

Example(3): If $$A = \begin{bmatrix} 0 & i \\ i & 0 \\ \end{bmatrix}$$ then find $$A^2$$, where $$i^2 = -1$$?

Solution: $$A^2 = A \times A$$ $$A^2 = \begin{bmatrix} 0 & i \\ i & 0 \\ \end{bmatrix} \ \begin{bmatrix} 0 & i \\ i & 0 \\ \end{bmatrix}$$ $$A^2 = \begin{bmatrix} 0 + i^2 & 0 + 0 \\ 0 + 0 & i^2 + 0 \\ \end{bmatrix}$$ $$A^2 = \begin{bmatrix} i^2 & 0 \\ 0 & i^2 \\ \end{bmatrix}$$ By putting $$i^2 = -1$$ $$A^2 = \begin{bmatrix} -1 & 0 \\ 0 & -1 \\ \end{bmatrix}$$

#### Multiplication of Matrix by a Scalar:

The multiplication of a scalar k with a matrix A can be obtained by multiplying each element of matrix A with scalar k. The multiplication of a scalar k with matrix A is denoted as kA.

Example(1): Find the multiplication of a scalar 5 with a matrix A if $$A = \begin{bmatrix} 2 & 3 \\ 4 & 5 \\ \end{bmatrix}$$?

Solution: $$5A = 5 \ \begin{bmatrix} 2 & 3 \\ 4 & 5 \\ \end{bmatrix}$$ $$5A = \begin{bmatrix} 2 \times 5 & 3 \times 5 \\ 4 \times 5 & 5 \times 5 \\ \end{bmatrix}$$ $$5A = \begin{bmatrix} 10 & 15 \\ 20 & 25 \\ \end{bmatrix}$$

#### Matrix multiplication Rules:

(1). It is not necessary that $$A \times B = B \times A$$.

(2). If k is a scalar and, A and B are the two matrices then, $$k (A + B) = kA + kB$$.