Skip to content

Mathematics · Ch 7 — Matrices

Operations on Matrices

7.4

Operations on Matrices

3.4 Operations on Matrices

Matrices are not just static arrays of numbers; they can be combined and transformed. This section introduces the fundamental operations on matrices — addition, subtraction, scalar multiplication, and multiplication — each with rules arising from the structure of matrices themselves.


3.4.1 Addition of Matrices

Addition is defined only when the two matrices are of the same order.

Definition (Addition of Matrices)

If A=[aij]m×nA = [a_{ij}]_{m \times n} and B=[bij]m×nB = [b_{ij}]_{m \times n} are of the same order m×nm \times n, then their sum is the matrix C=[cij]m×nC = [c_{ij}]_{m \times n} with

cij=aij+bijfor all i=1,…,m, j=1,…,n.c_{ij} = a_{ij} + b_{ij} \quad \text{for all } i = 1, \dots, m,\ j = 1, \dots, n.

That is, add the entries in the same row and column.

Example

For A=[251−3]A = \begin{bmatrix} 2 & 5 \\ 1 & -3 \end{bmatrix} and B=[4−107]B = \begin{bmatrix} 4 & -1 \\ 0 & 7 \end{bmatrix} (both 2×22 \times 2),

A+B=[2+45+(−1)1+0−3+7]=[6414].A + B = \begin{bmatrix} 2+4 & 5+(-1) \\ 1+0 & -3+7 \end{bmatrix} = \begin{bmatrix} 6 & 4 \\ 1 & 4 \end{bmatrix}.

Watch out

You cannot add a 2×32 \times 3 matrix to a 2×22 \times 2 matrix. The orders must match exactly; otherwise the sum is undefined.


3.4.2 Multiplication of a Matrix by a Scalar

A scalar is a real number. Multiplying a matrix by a scalar means multiplying every entry by that scalar.

Definition (Scalar Multiplication)

If A=[aij]m×nA = [a_{ij}]_{m \times n} and kk is a scalar, then kA=[bij]m×nkA = [b_{ij}]_{m \times n} where

bij=k⋅aijfor all i,j.b_{ij} = k \cdot a_{ij} \quad \text{for all } i, j.

Example

For A=[3−205]A = \begin{bmatrix} 3 & -2 \\ 0 & 5 \end{bmatrix} and k=−2k = -2,

kA=[(−2)(3)(−2)(−2)(−2)(0)(−2)(5)]=[−640−10].kA = \begin{bmatrix} (-2)(3) & (-2)(-2) \\ (-2)(0) & (-2)(5) \end{bmatrix} = \begin{bmatrix} -6 & 4 \\ 0 & -10 \end{bmatrix}.


3.4.3 Properties of Matrix Addition and Scalar Multiplication

The following hold for any matrices AA, BB, CC of the same order m×nm \times n and any scalars kk, ll. They let us manipulate matrix equations like ordinary equations.

Property (I): Commutativity of Addition   A+B=B+AA + B = B + A

Proof. (A+B)ij=aij+bij=bij+aij=(B+A)ij(A + B)_{ij} = a_{ij} + b_{ij} = b_{ij} + a_{ij} = (B + A)_{ij} for every entry. □\square

Property (II): Associativity of Addition   (A+B)+C=A+(B+C)(A + B) + C = A + (B + C)

Proof. ((A+B)+C)ij=(aij+bij)+cij=aij+(bij+cij)=(A+(B+C))ij((A + B) + C)_{ij} = (a_{ij} + b_{ij}) + c_{ij} = a_{ij} + (b_{ij} + c_{ij}) = (A + (B + C))_{ij}, since real-number addition is associative. □\square

Property (III): Additive Identity (Zero Matrix)   There is a zero matrix OO of order m×nm \times n with A+O=A=O+AA + O = A = O + A.

Proof. (A+O)ij=aij+0=aij(A + O)_{ij} = a_{ij} + 0 = a_{ij}; the other equality follows by commutativity. □\square

Property (IV): Additive Inverse   For every A=[aij]A = [a_{ij}] there is −A=[−aij]-A = [-a_{ij}] with A+(−A)=O=(−A)+AA + (-A) = O = (-A) + A.

Proof. (A+(−A))ij=aij+(−aij)=0(A + (-A))_{ij} = a_{ij} + (-a_{ij}) = 0. □\square

Property (V): Distributivity over Matrix Addition   k(A+B)=kA+kBk(A + B) = kA + kB

Proof. (k(A+B))ij=k(aij+bij)=kaij+kbij=(kA+kB)ij(k(A + B))_{ij} = k(a_{ij} + b_{ij}) = k a_{ij} + k b_{ij} = (kA + kB)_{ij}. □\square

Property (VI): Distributivity over Scalar Addition   (k+l)A=kA+lA(k + l)A = kA + lA

Proof. ((k+l)A)ij=(k+l)aij=kaij+laij=(kA+lA)ij((k + l)A)_{ij} = (k + l)a_{ij} = k a_{ij} + l a_{ij} = (kA + lA)_{ij}. □\square

Property (VII): Associativity of Scalar Multiplication   k(lA)=(kl)Ak(lA) = (kl)A

Proof. (k(lA))ij=k(laij)=(kl)aij=((kl)A)ij(k(lA))_{ij} = k(l a_{ij}) = (kl)a_{ij} = ((kl)A)_{ij}. □\square

Property (VIII): Multiplication by 1   1⋅A=A1 \cdot A = A

Proof. (1⋅A)ij=1⋅aij=aij(1 \cdot A)_{ij} = 1 \cdot a_{ij} = a_{ij}. □\square


3.4.4 Difference of Matrices

Definition (Difference of Matrices)

If AA and BB are of the same order m×nm \times n, their difference is

A−B=A+(−B),(A−B)ij=aij−bij.A - B = A + (-B), \qquad (A - B)_{ij} = a_{ij} - b_{ij}.

Example

For A=[53−12]A = \begin{bmatrix} 5 & 3 \\ -1 & 2 \end{bmatrix} and B=[274−3]B = \begin{bmatrix} 2 & 7 \\ 4 & -3 \end{bmatrix},

A−B=[5−23−7−1−42−(−3)]=[3−4−55].A - B = \begin{bmatrix} 5-2 & 3-7 \\ -1-4 & 2-(-3) \end{bmatrix} = \begin{bmatrix} 3 & -4 \\ -5 & 5 \end{bmatrix}.


3.4.5 Multiplication of Matrices

Matrix multiplication is not defined entry-wise; it corresponds to composition of linear transformations.

Definition (Multiplication of Matrices)

Let A=[aij]A = [a_{ij}] be m×nm \times n and B=[bjk]B = [b_{jk}] be n×pn \times p. The product ABAB is the m×pm \times p matrix C=[cik]C = [c_{ik}] whose entry cikc_{ik} is the dot product of the ii-th row of AA with the kk-th column of BB:

cik=∑j=1naijbjk=ai1b1k+ai2b2k+⋯+ainbnk.c_{ik} = \sum_{j=1}^{n} a_{ij} b_{jk} = a_{i1}b_{1k} + a_{i2}b_{2k} + \dots + a_{in}b_{nk}.

Watch out

For ABAB to be defined, the number of columns of AA must equal the number of rows of BB. If AA is m×nm \times n and BB is n×pn \times p, then ABAB is m×pm \times p.

Example

Let A=[1234]A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} (2×22 \times 2) and B=[5678910]B = \begin{bmatrix} 5 & 6 & 7 \\ 8 & 9 & 10 \end{bmatrix} (2×32 \times 3). Since AA has 2 columns and BB has 2 rows, ABAB is defined and is 2×32 \times 3. Taking each row of AA against each column of BB:

c11=1(5)+2(8)=21,c12=1(6)+2(9)=24,c13=1(7)+2(10)=27,c21=3(5)+4(8)=47,c22=3(6)+4(9)=54,c23=3(7)+4(10)=61.\begin{aligned} c_{11} &= 1(5)+2(8) = 21, & c_{12} &= 1(6)+2(9) = 24, & c_{13} &= 1(7)+2(10) = 27, \\ c_{21} &= 3(5)+4(8) = 47, & c_{22} &= 3(6)+4(9) = 54, & c_{23} &= 3(7)+4(10) = 61. \end{aligned}

AB=[212427475461].AB = \begin{bmatrix} 21 & 24 & 27 \\ 47 & 54 & 61 \end{bmatrix}.

Note

Here BABA is not defined, since BB is 2×32 \times 3 and AA is 2×22 \times 2 (columns of BB = 3 ≠ 2 = rows of AA). Matrix multiplication is not commutative.


3.4.6 Properties of Matrix Multiplication

Property (IX): Associativity   If AA is m×nm \times n, BB is n×pn \times p, CC is p×qp \times q, then (AB)C=A(BC)(AB)C = A(BC).

Proof. The (i,l)(i, l) entry of (AB)C(AB)C is ∑k=1p(∑j=1naijbjk)ckl=∑k∑jaijbjkckl\sum_{k=1}^{p}\left(\sum_{j=1}^{n} a_{ij} b_{jk}\right) c_{kl} = \sum_{k}\sum_{j} a_{ij} b_{jk} c_{kl}, and that of A(BC)A(BC) is ∑j=1naij(∑k=1pbjkckl)=∑j∑kaijbjkckl\sum_{j=1}^{n} a_{ij}\left(\sum_{k=1}^{p} b_{jk} c_{kl}\right) = \sum_{j}\sum_{k} a_{ij} b_{jk} c_{kl}. The double sums agree. □\square

Property (X): Distributivity over Addition   A(B+C)=AB+ACA(B + C) = AB + AC and (A+B)C=AC+BC(A + B)C = AC + BC (for conformable orders).

Proof (first part). The (i,k)(i, k) entry of A(B+C)A(B+C) is ∑jaij(bjk+cjk)=∑jaijbjk+∑jaijcjk=(AB)ik+(AC)ik\sum_{j} a_{ij}(b_{jk} + c_{jk}) = \sum_{j} a_{ij} b_{jk} + \sum_{j} a_{ij} c_{jk} = (AB)_{ik} + (AC)_{ik}. The second part is similar. □\square …