 # Matrix Operations

Matrix operations mainly involve three algebraic operations which are addition of matrices, subtraction of matrices, and multiplication of matrices. Matrix is a rectangular array of numbers or expressions arranged in rows and columns. Important applications of matrices can be found in mathematics.

All these operations on matrices are covered in this article along with their properties and solved examples. Before starting with the operation, it is important to know about the elementary operation of a matrix in detail which is given in the linked articles below.

## Operations on Matrices

Addition, subtraction and multiplication are the basic operations on the matrix. To add or subtract matrices, these must be of identical order and for multiplication, the number of columns in the first matrix equals the number of rows in the second matrix.

• Subtraction of Matrices
• Scalar Multiplication of Matrices
• Multiplication of Matrices

If A[aij]mxn and B[bij]mxn are two matrices of the same order then their sum A + B is a matrix, and each element of that matrix is the sum of the corresponding elements. i.e. A + B = [aij + bij]mxn

Consider the two matrices A & B of order 2 x 2. Then the sum is given by:

$\begin{bmatrix} a1 &b1 \\ c1 &d1 \end{bmatrix} + \begin{bmatrix} a2&b2 \\ c2& d2 \end{bmatrix} = \begin{bmatrix} a1+a2 &\ b1+b2 \\ c1+c2 &\ d1+d2 \end{bmatrix}$

Properties of Matrix Addition: If a, B and C are matrices of same order, then

(a) Commutative Law: A + B = B + A

(b) Associative Law:  (A + B) + C = A + (B + C)

(c) Identity of the Matrix: A + O =  O + A = A, where O is zero matrix which is additive identity of the matrix,

(d) Additive Inverse: A + (-A) = 0 = (-A) + A, where (-A) is obtained by changing the sign of every element of A which is additive inverse of the matrix,

(e) $\left. \begin{matrix} A+B=A+C \\ B+A=C+A \\ \end{matrix} \right\}\Rightarrow B=C$

(f) $tr\left( A\pm B \right)=tr\left( A \right)\pm tr\left( B \right)$

(g) If A + B = 0 = B + A, then B is called additive inverse of A and also A is called the additive inverse of A.

## Subtraction of Matrices

If A and B are two matrices of the same order, then we define $A-B=A+\left( -B \right).$

Consider the two matrices A & B of order 2 x 2. Then the difference is given by:

$\begin{bmatrix} a1 &b1 \\ c1 &d1 \end{bmatrix} – \begin{bmatrix} a2&b2 \\ c2& d2 \end{bmatrix} = \begin{bmatrix} a1-a2 &\ b1-b2 \\ c1-c2 &\ d1-d2 \end{bmatrix}$

We can subtract the matrices by subtracting each element of one matrix from the corresponding element of the second matrix. i.e. A – B = [aij – bij]mxn

## Scalar Multiplication of Matrices

If $A={{\left[ {{a}_{ij}} \right]}_{m\times n}}$ is a matrix and k any number, then the matrix which is obtained by multiplying the elements of A by k is called the scalar multiplication of A by k and it is denoted by k A thus if $A={{\left[ {{a}_{ij}} \right]}_{m\times n}}$

Then $k{{A}_{m\,\times n}}={{A}_{m\,\times \,n}}k=\left[ k{{a}_{i\times j}} \right]$

Properties of Scalar Multiplication: If A, B are matrices of the same order and are any two scalars then;

(a) $\lambda \left( A+B \right)=\lambda A+\lambda B$

(b) $\left( \lambda +\mu \right)A=\lambda A+\mu A$

(c) $\lambda \left( \mu A \right)=\left( \lambda \,\mu A \right)=\mu \left( \lambda A \right)$

(d) $\left( -\lambda A \right)=-\left( \lambda A \right)=\lambda \left( -A \right)$

(e) $tr\left( kA \right)=k\,\,tr\,\,\left( A \right)$

## Multiplication of Matrices

If A and B be any two matrices, then their product AB will be defined only when the number of columns in A is equal to the number of rows in B.

If $A{{\left[ {{a}_{ij}} \right]}_{m\,\times n}}. and B{{\left[ {{b}_{ij}} \right]}_{n\,\times p}} then\; their\; product\ AB=C{{\left[ {{c}_{ij}} \right]}_{m\,\times p}}$ will be a matrix of order mxp where ${{\left( AB \right)}_{ij}}={{C}_{ij}}=\sum\limits_{r=1}^{n}{{{a}_{ir}}{{b}_{rj}}}$

### Properties of matrix multiplication

(a) Matrix multiplication is not commutative in general, i.e. in general $AB\ne BA.$

(b) Matrix multiplication is associative, i.e. (AB)C = A(BC).

(c) Matrix multiplication is distributive over matrix addition, i.e. A.(B + C) = A.B + A.C and (A + B)C = AC + BC.

(d) If A is an m × n matrix, then ${{I}_{m}}A=A=A{{I}_{n}}.$

(e) The product of two matrices can be a null matrix while neither of them is null, i.e. if AB = 0, it is not necessary that either A = 0 or B = 0.

(f) If A is an m × n matrix and O is a null matrix then ${{A}_{m\,\times n}}.{{O}_{n\,\times p}}={{O}_{m\,\times p}}.$ i.e. the product of the matrix with a null matrix is always a null matrix.

(g) If AB = 0 (It does not mean that A = 0 or B = 0, again the product of two non-zero matrices may be a zero matrix).

(h) If AB = AC B C (Cancellation Law is not applicable).

(i) $tr\left( AB \right)=tr\left( BA \right).$

j) There exist a multiplicative identity for every square matrix such AI = IA = A

## Matrix Operations Examples

Illustration 1: If $A=\left[ \begin{matrix} 2 & 1 & 3 \\ 3 & -2 & 1 \\ -1 & 0 & 1 \\ \end{matrix} \right] and B=\left[ \begin{matrix} 1 \\ 2 \\ 4 \\ \end{matrix}\,\,\,\,\begin{matrix} -2 \\ 1 \\ -2 \\ \end{matrix} \right]$

find AB and BA if possible.

Solution:

Using matrix multiplication. Here, A is a 3 × 3 matrix and B is a 3 × 2 matrix, therefore, A and B are conformable for the product AB and it is of the order 3 × 2 such that

(First row of A) (First column of B) $=\left[ 2\,1\,3 \right]\left[ \begin{matrix} 1 \\ 2 \\ 4 \\ \end{matrix} \right]=2\times 1+1\times 2+3\times 4=16$.

(First row of A) (Second column of B) $=\left[ 2\,\,1\,\,3 \right]\left[ \begin{matrix} -2 \\ 1 \\ -3 \\ \end{matrix} \right]=2\times \left( -2 \right)+1\times 1+3\times \left( -3 \right)=-12$

(Second row of A) (First column of B) $=\left[ 3\,\,-2\,\,1 \right]\left[ \begin{matrix} 1 \\ 2 \\ 4 \\ \end{matrix} \right]=3\times 1+\left( -2 \right)\times 2+1\times 4=3$

Similarly ${{\left( AB \right)}_{22}}=-11,{{\left( AB \right)}_{31}}=3 \;and \;{{\left( AB \right)}_{32}}=-1$

∴ AB = $\left[ \begin{matrix} 16 \\ 3 \\ 3 \\ \end{matrix}\,\,\,\begin{matrix} -12 \\ -11 \\ -1 \\ \end{matrix} \right]$

BA is not possible since number of columns of $B\ne$ number of rows of A.

Illustration 2: Find the value of x and y if $2\left[ \begin{matrix} 1 & 3 \\ 0 & x \\ \end{matrix} \right]+\left[ \begin{matrix} y & 0 \\ 1 & 2 \\ \end{matrix} \right]=\left[ \begin{matrix} 5 & 6 \\ 1 & 8 \\ \end{matrix} \right]$

Solution:

Using the method of multiplication and addition of matrices, then equating the corresponding elements of L.H.S. and R.H.S., we can easily get the required values of x and y.

We have, $2\left[ \begin{matrix} 1 & 3 \\ 0 & x \\ \end{matrix} \right]+\left[ \begin{matrix} y & 0 \\ 1 & 2 \\ \end{matrix} \right]=\left[ \begin{matrix} 5 & 6 \\ 1 & 8 \\ \end{matrix} \right]\Rightarrow \left[ \begin{matrix} 2 & 6 \\ 0 & 2x \\ \end{matrix} \right]+\left[ \begin{matrix} y & 0 \\ 1 & 2 \\ \end{matrix} \right]=\left[ \begin{matrix} 5 & 6 \\ 1 & 8 \\ \end{matrix} \right]\Rightarrow \left[ \begin{matrix} 2+y & 6+0 \\ 0+1 & 2x+2 \\ \end{matrix} \right]=\left[ \begin{matrix} 5 & 6 \\ 1 & 8 \\ \end{matrix} \right]$

Equating the corresponding elements, a11 and a22 we get

$2+y=5\Rightarrow \,\,\,y=3;\,\,\,2x+2=8\,\,\,\Rightarrow 2x=6\,\,\,\Rightarrow x=3;$

Hence x = 3 and y = 3 .

Illustration 3: Find the value of a, b, c and d, if $\left[ \begin{matrix} a-b & 2a+c \\ 2a-b & 3c+d \\ \end{matrix} \right]=\left[ \begin{matrix} -1 & 5 \\ 0 & 13 \\ \end{matrix} \right]$

Solution:

As the two matrices are equal, their corresponding elements are equal. Therefore, by equating the corresponding elements of given matrices we will obtain the value of a, b, c and d.

$\left[ \begin{matrix} a-b & 2a+c \\ 2a-b & 3c+d \\ \end{matrix} \right]=\left[ \begin{matrix} -1 & 5 \\ 0 & 13 \\ \end{matrix} \right]$

(given)

a – b = 1 … (i)

2a + c = 5 … (ii)

2a-b=0 … (iii)

3c + d = 13 … (iv)

Subtracting equation (i) from (iii), we have a = 1;

Putting the value of a in equation (i), we have$1-b=-1 \Rightarrow b = 2$;

Putting the value of a in equation (ii), we have $2+c=5\Rightarrow c=3;$

Putting the value of c in equation (iv), we find $9+x=13\Rightarrow d=$

Hence a=1,b=2,c=3,d=4.

Illustration 4: find x and y, if $2x+3y=\left[ \begin{matrix} 2 & 3 \\ 4 & 0 \\ \end{matrix} \right] and 3x+2y=\left[ \begin{matrix} 2 & -2 \\ -1 & 5 \\ \end{matrix} \right]$

Solution:

Solving the given equations simultaneously, we will obtain the values of x and y.

We have $2x+3y=\left[ \begin{matrix} 2 & 3 \\ 4 & 0 \\ \end{matrix} \right]$ … (i)

$3x+2y=\left[ \begin{matrix} 2 & -2 \\ -1 & 5 \\ \end{matrix} \right]$ … (ii)

Multiplying (i) by 3 and (ii) by 2, we get$6x+9y=\left[ \begin{matrix} 6 & 9 \\ 12 & 0 \\ \end{matrix} \right]$ … (iii)

$6x+9y=\left[ \begin{matrix} 6 & 9 \\ 12 & 0 \\ \end{matrix} \right]$ … (iv)

Subtracting (iv) from (iii), we get $5y=\left[ \begin{matrix} 6-4 & 9+4 \\ 12+2 & 0-10 \\ \end{matrix} \right]=\left[ \begin{matrix} 2 & 13 \\ 14 & -10 \\ \end{matrix} \right]$ $\Rightarrow y=\left[ \begin{matrix} \frac{2}{5} & \frac{13}{5} \\ \frac{14}{5} & \frac{-10}{5} \\ \end{matrix} \right]\Rightarrow y=\left[ \begin{matrix} \frac{2}{5} & \frac{13}{5} \\ \frac{14}{5} & -2 \\ \end{matrix} \right]$

Putting the value of y in (iii), we get $2x+3\left[ \begin{matrix} \frac{2}{5} & \frac{13}{5} \\ \frac{14}{5} & -2 \\ \end{matrix} \right]=\left[ \begin{matrix} 2 & 3 \\ 4 & 0 \\ \end{matrix} \right]$ $\Rightarrow 2x=\left[ \begin{matrix} 2 & 3 \\ 4 & 0 \\ \end{matrix} \right]-\left[ \begin{matrix} \frac{6}{5} & \frac{39}{5} \\ \frac{42}{5} & -6 \\ \end{matrix} \right]=\left[ \begin{matrix} 2-\frac{6}{5} & 3-\frac{39}{5} \\ 4-\frac{42}{5} & 0+6 \\ \end{matrix} \right]=\left[ \begin{matrix} \frac{4}{5} & -\frac{24}{5} \\ -\frac{22}{5} & 6 \\ \end{matrix} \right]\Rightarrow x=\left[ \begin{matrix} \frac{2}{5} & -\frac{12}{5} \\ -\frac{11}{5} & 3 \\ \end{matrix} \right]$

Hence $x=\left[ \begin{matrix} \frac{2}{5} & -\frac{12}{5} \\ -\frac{11}{5} & 3 \\ \end{matrix} \right] \;and\; y=\left[ \begin{matrix} \frac{2}{5} & \frac{13}{5} \\ \frac{14}{5} & -2 \\ \end{matrix} \right]$