Matrix Operations

The numbers arranged in the form of rows and columns surrounded by square brackets is termed as a matrix. Important applications of matrices can be found in mathematics. Matrix operations mainly involve three algebraic operations which are addition of matrices, subtraction of matrices, and multiplication of matrices. All these operations on matrices are covered in this lesson 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.

Read More:

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.

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

Addition 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:

[a1b1c1d1]+[a2b2c2d2]=[a1+a2 b1+b2c1+c2 d1+d2]\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) A+B=A+CB+A=C+A}B=C\left. \begin{matrix} A+B=A+C \\ B+A=C+A \\ \end{matrix} \right\}\Rightarrow B=C

(f) tr(A±B)=tr(A)±tr(B)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 AB=A+(B).A-B=A+\left( -B \right).

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

[a1b1c1d1][a2b2c2d2]=[a1a2 b1b2c1c2 d1d2]\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=[aij]m×nA={{\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=[aij]m×nA={{\left[ {{a}_{ij}} \right]}_{m\times n}}

 

Then kAm×n=Am×nk=[kai×j]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) λ(A+B)=λA+λB\lambda \left( A+B \right)=\lambda A+\lambda B

(b) (λ+μ)A=λA+μA\left( \lambda +\mu \right)A=\lambda A+\mu A

(c) λ(μA)=(λμA)=μ(λA)\lambda \left( \mu A \right)=\left( \lambda \,\mu A \right)=\mu \left( \lambda A \right)

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

(e) tr(kA)=ktr(A)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[aij]m×n.andB[bij]n×pthen  their  product AB=C[cij]m×pA{{\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 (AB)ij=Cij=r=1nairbrj{{\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 ABBA.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 ImA=A=AIn.{{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 Am×n.On×p=Om×p.{{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(AB)=tr(BA).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=[213321101]andB=[124212]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) =[213][124]=2×1+1×2+3×4=16=\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) =[213][213]=2×(2)+1×1+3×(3)=12=\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) =[321][124]=3×1+(2)×2+1×4=3=\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 (AB)22=11,(AB)31=3  and  (AB)32=1{{\left( AB \right)}_{22}}=-11,{{\left( AB \right)}_{31}}=3 \;and \;{{\left( AB \right)}_{32}}=-1

∴ AB = [163312111]\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 BB\ne number of rows of A.

 

Illustration 2: Find the value of x and y if 2[130x]+[y012]=[5618]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[130x]+[y012]=[5618][2602x]+[y012]=[5618][2+y6+00+12x+2]=[5618]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=5y=3;2x+2=82x=6x=3;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 [ab2a+c2ab3c+d]=[15013]\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.

[ab2a+c2ab3c+d]=[15013]\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 have1b=1b=21-b=-1 \Rightarrow b = 2;

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

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

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

 

Illustration 4: find x and y, if 2x+3y=[2340]and3x+2y=[2215]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=[2340]2x+3y=\left[ \begin{matrix} 2 & 3 \\ 4 & 0 \\ \end{matrix} \right] … (i)

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

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

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

Subtracting (iv) from (iii), we get 5y=[649+412+2010]=[2131410]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] y=[25135145105]y=[251351452]\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[251351452]=[2340]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] 2x=[2340][653954256]=[265339544250+6]=[452452256]x=[251251153]\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=[251251153]  and  y=[251351452]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]