**Addition of matrices**

To define the addition of two matrices and , they must be of equal dimensions. The result of addition of these two matrices is matrix which is of the same dimensions and

is valid.

*Example 1*.

Add the following matrices:

*Solution*:

For every two matrices is valid:

that is, the addition of matrices is commutative.

For every three matrices is valid:

that is, the addition of matrices is associative.

A zero matrix is a neutral element for addition of matrices.

## Multiplication a matrix by a scalar

If is a scalar and a matrix, then the multiplication a matrix by a scalar is defined as . This means that every element of a matrix is multiplied by .

*Example 2*.

For the matrix calculate and .

*Solution*:

If , then matrix is equal to zero matrix.

If ,then .

is called **the opposite matrix** of matrix .

## Multiplication of matrices

The product of two matrices is not defined for any two matrices, is not even defined for two matrices of the same dimensions.

Firstly, consider the multiplication of row vector by column vector. Let the dimensions of vector be , and of vector . Then their product is:

Their product is a scalar.

We use previously on the example:

Matrix can be multiplied by matrix if matrix has the same number of rows as matrix columns. The product then has the same number of rows as matrix and columns the same as matrix .

The proper definition follows.

If and , then their product is defined as matrix , whereby .

This means that element is the scalar product of elements that are located in -th row of matrix and in -th column of matrix .

For example,

.

*Example 3*.

Multiply the following matrices:

and .

*Solution*:

The dimensions of matrix is and of matrix is , therefore, it is possible to multiply these two matrices.

Multiplication of matrices is not commutative, as we can see from the previous example. The product is not even defined, because matrix has two columns and matrix three rows.

The following properties are valid for the multiplication of matrices (if the specified products are well defined):

- ( right distributive)
- ( left distributive)
- (quasi associative)
- (associative)
- (an identity matrix is a neutral element for multiplication)