What this lesson covers
This lesson covers the first operations on matrices: the trace of a square matrix, when two matrices are equal, how to add and subtract matrices, and how to multiply a matrix by a number. Each operation comes with a list of properties.
Trace of a matrix
The sum of the diagonal elements of a square matrix A A A is called the trace of A A A , written tr ( A ) \operatorname{tr}(A) tr ( A ) . The trace is also called the spur.
tr ( A ) = ∑ i = 1 n a i i = a 11 + a 22 + ⋯ + a n n . \displaystyle \operatorname{tr}(A) = \sum_{i=1}^{n} a_{ii} = a_{11} + a_{22} + \dots + a_{nn}. tr ( A ) = i = 1 ∑ n a ii = a 11 + a 22 + ⋯ + a nn .
Properties of trace
Let A = [ a i j ] n × n A = [a_{ij}]_{n \times n} A = [ a ij ] n × n , B = [ b i j ] n × n B = [b_{ij}]_{n \times n} B = [ b ij ] n × n and let λ \lambda λ be a scalar.
tr ( λ A ) = λ tr ( A ) \operatorname{tr}(\lambda A) = \lambda \operatorname{tr}(A) tr ( λ A ) = λ tr ( A ) .
tr ( A ± B ) = tr ( A ) ± tr ( B ) \operatorname{tr}(A \pm B) = \operatorname{tr}(A) \pm \operatorname{tr}(B) tr ( A ± B ) = tr ( A ) ± tr ( B ) .
tr ( A B ) = tr ( B A ) \operatorname{tr}(AB) = \operatorname{tr}(BA) tr ( A B ) = tr ( B A ) .
tr ( I n ) = n \operatorname{tr}(I_n) = n tr ( I n ) = n .
In general tr ( A B ) ≠ tr ( A ) ⋅ tr ( B ) \operatorname{tr}(AB) \neq \operatorname{tr}(A) \cdot \operatorname{tr}(B) tr ( A B ) = tr ( A ) ⋅ tr ( B ) .
If A , B , C A, B, C A , B , C are square matrices of order n n n , then tr ( A B C ) = tr ( B C A ) = tr ( C A B ) \operatorname{tr}(ABC) = \operatorname{tr}(BCA) = \operatorname{tr}(CAB) tr ( A B C ) = tr ( B C A ) = tr ( C A B ) .
Equality of matrices
Two matrices A A A and B B B are equal if
they are of the same type (order), and
their corresponding elements are equal.
For example, [ a b c d e f ] = [ 2 0 1 − 1 − 3 5 ] \begin{bmatrix} a & b & c \\ d & e & f \end{bmatrix} = \begin{bmatrix} 2 & 0 & 1 \\ -1 & -3 & 5 \end{bmatrix} [ a d b e c f ] = [ 2 − 1 0 − 3 1 5 ] if and only if a = 2 a = 2 a = 2 , b = 0 b = 0 b = 0 , c = 1 c = 1 c = 1 , d = − 1 d = -1 d = − 1 , e = − 3 e = -3 e = − 3 , f = 5 f = 5 f = 5 .
Note that there is no ordering of matrices: statements like A > B A > B A > B or A < B A < B A < B are meaningless.
Addition of matrices
If A A A and B B B are of the same type, their sum A + B A + B A + B is the matrix of the same type obtained by adding corresponding elements:
A = [ a i j ] m × n , B = [ b i j ] m × n ⇒ A + B = [ c i j ] m × n , c i j = a i j + b i j . 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}. A = [ a ij ] m × n , B = [ b ij ] m × n ⇒ A + B = [ c ij ] m × n , c ij = a ij + b ij .
Properties of addition
A + B = B + A A + B = B + A A + B = B + A (commutative law).
( A + B ) + C = A + ( B + C ) (A + B) + C = A + (B + C) ( A + B ) + C = A + ( B + C ) (associative law).
A + O = O + A = A A + O = O + A = A A + O = O + A = A , where the zero matrix O O O is the additive identity.
A + ( − A ) = O = ( − A ) + A A + (-A) = O = (-A) + A A + ( − A ) = O = ( − A ) + A , where − A -A − A is obtained by changing the sign of every element of A A A ; it is the additive inverse of A A A .
If A + B = O A + B = O A + B = O , then B = − A B = -A B = − A (or A = − B A = -B A = − B ).
If A + B = A + C A + B = A + C A + B = A + C , then B = C B = C B = C (cancellation law).
If A + B = C A + B = C A + B = C , then A = C − B A = C - B A = C − B .
Difference of two matrices
If A A A and B B B are of the same type, A − B A - B A − B is defined as A + ( − B ) A + (-B) A + ( − B ) . If A A A and B B B are of different orders, neither A + B A + B A + B nor A − B A - B A − B is defined.
Multiplication of a matrix by a scalar
If A = [ a i j ] m × n A = [a_{ij}]_{m \times n} A = [ a ij ] m × n and k k k is a number, the matrix obtained by multiplying every element of A A A by k k k is the scalar multiple k A kA k A :
k A = A k = [ k a i j ] m × n . kA = Ak = [k\,a_{ij}]_{m \times n}. k A = A k = [ k a ij ] m × n .
Properties of scalar multiplication
If A , B A, B A , B are matrices of the same order and λ , μ \lambda, \mu λ , μ are scalars:
λ ( A + B ) = λ A + λ B \lambda(A + B) = \lambda A + \lambda B λ ( A + B ) = λ A + λ B .
( λ + μ ) A = λ A + μ A (\lambda + \mu)A = \lambda A + \mu A ( λ + μ ) A = λ A + μ A .
λ ( μ A ) = ( λ μ ) A = μ ( λ A ) \lambda(\mu A) = (\lambda\mu)A = \mu(\lambda A) λ ( μ A ) = ( λ μ ) A = μ ( λ A ) .
( − λ A ) = − ( λ A ) = λ ( − A ) (-\lambda A) = -(\lambda A) = \lambda(-A) ( − λ A ) = − ( λ A ) = λ ( − A ) .
0 A = O 0A = O 0 A = O (the number 0 0 0 times any matrix is the null matrix).
α O = O \alpha O = O α O = O .
( − 1 ) A = − A (-1)A = -A ( − 1 ) A = − A , the negative of A A A ; also − ( − A ) = A -(-A) = A − ( − A ) = A .
Example 1
Let A = [ 1 2 3 4 ] A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} A = [ 1 3 2 4 ] and B = [ 2 0 1 3 ] B = \begin{bmatrix} 2 & 0 \\ 1 & 3 \end{bmatrix} B = [ 2 1 0 3 ] . Find A + B A + B A + B , 2 A − 3 B 2A - 3B 2 A − 3 B and tr ( A + B ) \operatorname{tr}(A + B) tr ( A + B ) .
A + B = [ 3 2 4 7 ] , 2 A − 3 B = [ 2 − 6 4 − 0 6 − 3 8 − 9 ] = [ − 4 4 3 − 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}. A + B = [ 3 4 2 7 ] , 2 A − 3 B = [ 2 − 6 6 − 3 4 − 0 8 − 9 ] = [ − 4 3 4 − 1 ] .
tr ( A + B ) = 3 + 7 = 10 \operatorname{tr}(A + B) = 3 + 7 = 10 tr ( A + B ) = 3 + 7 = 10 , which equals tr ( A ) + tr ( B ) = 5 + 5 \operatorname{tr}(A) + \operatorname{tr}(B) = 5 + 5 tr ( A ) + tr ( B ) = 5 + 5 .
Example 2
Find x x x and y y y if [ x + y 2 5 x − y ] = [ 6 2 5 2 ] \begin{bmatrix} x + y & 2 \\ 5 & x - y \end{bmatrix} = \begin{bmatrix} 6 & 2 \\ 5 & 2 \end{bmatrix} [ x + y 5 2 x − y ] = [ 6 5 2 2 ] .
x + y = 6 x + y = 6 x + y = 6 and x − y = 2 x - y = 2 x − y = 2 , so x = 4 x = 4 x = 4 , y = 2 y = 2 y = 2 .
Practice
Find the trace of [ 4 1 0 2 − 3 5 7 8 9 ] \begin{bmatrix} 4 & 1 & 0 \\ 2 & -3 & 5 \\ 7 & 8 & 9 \end{bmatrix} 4 2 7 1 − 3 8 0 5 9 .
If A = [ 1 − 2 0 3 ] A = \begin{bmatrix} 1 & -2 \\ 0 & 3 \end{bmatrix} A = [ 1 0 − 2 3 ] , find 3 A 3A 3 A and − A -A − A .
Find X X X if X + [ 1 2 3 4 ] = [ 5 5 5 5 ] X + \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} = \begin{bmatrix} 5 & 5 \\ 5 & 5 \end{bmatrix} X + [ 1 3 2 4 ] = [ 5 5 5 5 ] .
Find a , b a, b a , b if [ 2 a 3 1 b + 1 ] = [ 8 3 1 − 4 ] \begin{bmatrix} 2a & 3 \\ 1 & b + 1 \end{bmatrix} = \begin{bmatrix} 8 & 3 \\ 1 & -4 \end{bmatrix} [ 2 a 1 3 b + 1 ] = [ 8 1 3 − 4 ] .
If tr ( A ) = 7 \operatorname{tr}(A) = 7 tr ( A ) = 7 and tr ( B ) = − 2 \operatorname{tr}(B) = -2 tr ( B ) = − 2 , find tr ( 3 A − 2 B ) \operatorname{tr}(3A - 2B) tr ( 3 A − 2 B ) .
Can [ 1 2 ] \begin{bmatrix} 1 & 2 \end{bmatrix} [ 1 2 ] and [ 1 2 ] \begin{bmatrix} 1 \\ 2 \end{bmatrix} [ 1 2 ] be added? Why?
Answers
Show answers
4 − 3 + 9 = 10 4 - 3 + 9 = 10 4 − 3 + 9 = 10 .
3 A = [ 3 − 6 0 9 ] 3A = \begin{bmatrix} 3 & -6 \\ 0 & 9 \end{bmatrix} 3 A = [ 3 0 − 6 9 ] , − A = [ − 1 2 0 − 3 ] -A = \begin{bmatrix} -1 & 2 \\ 0 & -3 \end{bmatrix} − A = [ − 1 0 2 − 3 ] .
X = [ 4 3 2 1 ] X = \begin{bmatrix} 4 & 3 \\ 2 & 1 \end{bmatrix} X = [ 4 2 3 1 ] .
a = 4 a = 4 a = 4 , b = − 5 b = -5 b = − 5 .
21 + 4 = 25 21 + 4 = 25 21 + 4 = 25 .
No: their orders (1 × 2 1 \times 2 1 × 2 and 2 × 1 2 \times 1 2 × 1 ) are different.