What this les­son cov­ers

This les­son cov­ers the first oper­a­tions on matri­ces: the trace of a square matrix, when two matri­ces are equal, how to add and sub­tract matri­ces, and how to mul­ti­ply a matrix by a num­ber. Each oper­a­tion comes with a list of prop­er­ties.

Trace of a matrix

The sum of the diag­o­nal ele­ments of a square matrix AA is called the trace of AA, writ­ten tr⁡(A)\operatorname{tr}(A). The trace is also called the spur.

tr⁡(A)=∑i=1naii=a11+a22+⋯+ann.\displaystyle \operatorname{tr}(A) = \sum_{i=1}^{n} a_{ii} = a_{11} + a_{22} + \dots + a_{nn}.

Prop­er­ties of trace

Let A=[aij]n×nA = [a_{ij}]_{n \times n}, B=[bij]n×nB = [b_{ij}]_{n \times n} and let λ\lambda be a scalar.

  1. tr⁡(λA)=λtr⁡(A)\operatorname{tr}(\lambda A) = \lambda \operatorname{tr}(A).
  2. tr⁡(A±B)=tr⁡(A)±tr⁡(B)\operatorname{tr}(A \pm B) = \operatorname{tr}(A) \pm \operatorname{tr}(B).
  3. tr⁡(AB)=tr⁡(BA)\operatorname{tr}(AB) = \operatorname{tr}(BA).
  4. tr⁡(In)=n\operatorname{tr}(I_n) = n.
  5. In gen­eral tr⁡(AB)≠tr⁡(A)⋅tr⁡(B)\operatorname{tr}(AB) \neq \operatorname{tr}(A) \cdot \operatorname{tr}(B).
  6. If A,B,CA, B, C are square matri­ces of order nn, then tr⁡(ABC)=tr⁡(BCA)=tr⁡(CAB)\operatorname{tr}(ABC) = \operatorname{tr}(BCA) = \operatorname{tr}(CAB).

Equal­ity of matri­ces

Two matri­ces AA and BB are equal if

  1. they are of the same type (order), and
  2. their cor­re­spond­ing ele­ments are equal.

For exam­ple, [abcdef]=[201−1−35]\begin{bmatrix} a & b & c \\ d & e & f \end{bmatrix} = \begin{bmatrix} 2 & 0 & 1 \\ -1 & -3 & 5 \end{bmatrix} if and only if a=2a = 2, b=0b = 0, c=1c = 1, d=−1d = -1, e=−3e = -3, f=5f = 5.

Note that there is no order­ing of matri­ces: state­ments like A>BA > B or A<BA < B are mean­ing­less.

Addi­tion of matri­ces

If AA and BB are of the same type, their sum A+BA + B is the matrix of the same type obtained by adding cor­re­spond­ing ele­ments:

A=[aij]m×n, B=[bij]m×n⇒A+B=[cij]m×n,cij=aij+bij.A = [a_{ij}]_{m \times n},\ B = [b_{ij}]_{m \times n} \Rightarrow A + B = [c_{ij}]_{m \times n}, \quad c_{ij} = a_{ij} + b_{ij}.

Prop­er­ties of addi­tion

  1. A+B=B+AA + B = B + A (com­mu­ta­tive law).
  2. (A+B)+C=A+(B+C)(A + B) + C = A + (B + C) (asso­cia­tive law).
  3. A+O=O+A=AA + O = O + A = A, where the zero matrix OO is the addi­tive iden­tity.
  4. A+(−A)=O=(−A)+AA + (-A) = O = (-A) + A, where −A-A is obtained by chang­ing the sign of every ele­ment of AA; it is the addi­tive inverse of AA.
  5. If A+B=OA + B = O, then B=−AB = -A (or A=−BA = -B).
  6. If A+B=A+CA + B = A + C, then B=CB = C (can­cel­la­tion law).
  7. If A+B=CA + B = C, then A=C−BA = C - B.

Dif­fer­ence of two matri­ces

If AA and BB are of the same type, A−BA - B is defined as A+(−B)A + (-B). If AA and BB are of dif­fer­ent orders, nei­ther A+BA + B nor A−BA - B is defined.

Mul­ti­pli­ca­tion of a matrix by a scalar

If A=[aij]m×nA = [a_{ij}]_{m \times n} and kk is a num­ber, the matrix obtained by mul­ti­ply­ing every ele­ment of AA by kk is the scalar mul­ti­ple kAkA:

kA=Ak=[k aij]m×n.kA = Ak = [k\,a_{ij}]_{m \times n}.

Prop­er­ties of scalar mul­ti­pli­ca­tion

If A,BA, B are matri­ces of the same order and λ,μ\lambda, \mu are scalars:

  1. λ(A+B)=λA+λB\lambda(A + B) = \lambda A + \lambda B.
  2. (λ+μ)A=λA+μA(\lambda + \mu)A = \lambda A + \mu A.
  3. λ(μA)=(λμ)A=μ(λA)\lambda(\mu A) = (\lambda\mu)A = \mu(\lambda A).
  4. (−λA)=−(λA)=λ(−A)(-\lambda A) = -(\lambda A) = \lambda(-A).
  5. 0A=O0A = O (the num­ber 00 times any matrix is the null matrix).
  6. αO=O\alpha O = O.
  7. (−1)A=−A(-1)A = -A, the neg­a­tive of AA; also −(−A)=A-(-A) = A.

Exam­ple 1

Let A=[1234]A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} and B=[2013]B = \begin{bmatrix} 2 & 0 \\ 1 & 3 \end{bmatrix}. Find A+BA + B, 2A−3B2A - 3B and tr⁡(A+B)\operatorname{tr}(A + B).

A+B=[3247],2A−3B=[2−64−06−38−9]=[−443−1].A + B = \begin{bmatrix} 3 & 2 \\ 4 & 7 \end{bmatrix}, \qquad 2A - 3B = \begin{bmatrix} 2 - 6 & 4 - 0 \\ 6 - 3 & 8 - 9 \end{bmatrix} = \begin{bmatrix} -4 & 4 \\ 3 & -1 \end{bmatrix}.

tr⁡(A+B)=3+7=10\operatorname{tr}(A + B) = 3 + 7 = 10, which equals tr⁡(A)+tr⁡(B)=5+5\operatorname{tr}(A) + \operatorname{tr}(B) = 5 + 5.

Exam­ple 2

Find xx and yy if [x+y25x−y]=[6252]\begin{bmatrix} x + y & 2 \\ 5 & x - y \end{bmatrix} = \begin{bmatrix} 6 & 2 \\ 5 & 2 \end{bmatrix}.

x+y=6x + y = 6 and x−y=2x - y = 2, so x=4x = 4, y=2y = 2.

Prac­tice

  1. Find the trace of [4102−35789]\begin{bmatrix} 4 & 1 & 0 \\ 2 & -3 & 5 \\ 7 & 8 & 9 \end{bmatrix}.
  2. If A=[1−203]A = \begin{bmatrix} 1 & -2 \\ 0 & 3 \end{bmatrix}, find 3A3A and −A-A.
  3. Find XX if X+[1234]=[5555]X + \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} = \begin{bmatrix} 5 & 5 \\ 5 & 5 \end{bmatrix}.
  4. Find a,ba, b if [2a31b+1]=[831−4]\begin{bmatrix} 2a & 3 \\ 1 & b + 1 \end{bmatrix} = \begin{bmatrix} 8 & 3 \\ 1 & -4 \end{bmatrix}.
  5. If tr⁡(A)=7\operatorname{tr}(A) = 7 and tr⁡(B)=−2\operatorname{tr}(B) = -2, find tr⁡(3A−2B)\operatorname{tr}(3A - 2B).
  6. Can [12]\begin{bmatrix} 1 & 2 \end{bmatrix} and [12]\begin{bmatrix} 1 \\ 2 \end{bmatrix} be added? Why?

Answers

Show answers
  1. 4−3+9=104 - 3 + 9 = 10.
  2. 3A=[3−609]3A = \begin{bmatrix} 3 & -6 \\ 0 & 9 \end{bmatrix}, −A=[−120−3]-A = \begin{bmatrix} -1 & 2 \\ 0 & -3 \end{bmatrix}.
  3. X=[4321]X = \begin{bmatrix} 4 & 3 \\ 2 & 1 \end{bmatrix}.
  4. a=4a = 4, b=−5b = -5.
  5. 21+4=2521 + 4 = 25.
  6. No: their orders (1×21 \times 2 and 2×12 \times 1) are dif­fer­ent.