Operations on matrices
Three operations turn the set of matrices into an arithmetic system: addition, scalar multiplication, and matrix multiplication. Addition and scalar multiplication are easy: combine entry by entry. Matrix multiplication is more involved , and its rules surprise students at first. This subtopic walks through each operation carefully and lists the algebraic laws they obey.
Addition
If A = ( a i j ) A = (a_{ij}) A = ( a ij ) and B = ( b i j ) B = (b_{ij}) B = ( b ij ) have the same order m × n m \times n m × n , their sum is defined entry-wise:
( A + B ) i j = a i j + b i j . (A + B)_{ij} = a_{ij} + b_{ij}. ( A + B ) ij = a ij + b ij .
So A + B A + B A + B also has order m × n m \times n m × n . Matrix addition is commutative and associative, has identity O O O (the zero matrix), and every A A A has inverse − A -A − A .
If A A A and B B B have different orders, A + B A + B A + B is undefined .
Scalar multiplication
For a scalar λ ∈ R \lambda \in \mathbb{R} λ ∈ R and matrix A = ( a i j ) A = (a_{ij}) A = ( a ij ) , the product λ A \lambda A λ A is defined by multiplying every entry by λ \lambda λ :
( λ A ) i j = λ ⋅ a i j . (\lambda A)_{ij} = \lambda \cdot a_{ij}. ( λ A ) ij = λ ⋅ a ij .
So λ A \lambda A λ A has the same order as A A A .
Properties: λ ( 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 \lambda(\mu A) = (\lambda \mu) A λ ( μ A ) = ( λ μ ) A , 1 ⋅ A = A 1 \cdot A = A 1 ⋅ A = A .
Matrix multiplication
For A A A of order m × p m \times p m × p and B B B of order p × n p \times n p × n , the product A B AB A B is the m × n m \times n m × n matrix with
( A B ) i j = ∑ k = 1 p a i k b k j . (AB)_{ij} = \sum_{k = 1}^{p} a_{ik} b_{kj}. ( A B ) ij = ∑ k = 1 p a ik b k j .
The number of columns of A A A must equal the number of rows of B B B . Otherwise A B AB A B is undefined.
In words: to compute the ( i , j ) (i, j) ( i , j ) entry of A B AB A B , take the i i i -th row of A A A , the j j j -th column of B B B , multiply corresponding entries and add.
Worked computation
Let A = ( 1 2 3 4 ) A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} A = ( 1 3 2 4 ) and B = ( 5 6 7 8 ) B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} B = ( 5 7 6 8 ) .
( A B ) 11 = 1 ⋅ 5 + 2 ⋅ 7 = 19 (AB)_{11} = 1 \cdot 5 + 2 \cdot 7 = 19 ( A B ) 11 = 1 ⋅ 5 + 2 ⋅ 7 = 19 . ( A B ) 12 = 1 ⋅ 6 + 2 ⋅ 8 = 22 (AB)_{12} = 1 \cdot 6 + 2 \cdot 8 = 22 ( A B ) 12 = 1 ⋅ 6 + 2 ⋅ 8 = 22 . ( A B ) 21 = 3 ⋅ 5 + 4 ⋅ 7 = 43 (AB)_{21} = 3 \cdot 5 + 4 \cdot 7 = 43 ( A B ) 21 = 3 ⋅ 5 + 4 ⋅ 7 = 43 . ( A B ) 22 = 3 ⋅ 6 + 4 ⋅ 8 = 50 (AB)_{22} = 3 \cdot 6 + 4 \cdot 8 = 50 ( A B ) 22 = 3 ⋅ 6 + 4 ⋅ 8 = 50 .
So A B = ( 19 22 43 50 ) AB = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix} A B = ( 19 43 22 50 ) . Compute B A BA B A the same way: B A = ( 23 34 31 46 ) BA = \begin{pmatrix} 23 & 34 \\ 31 & 46 \end{pmatrix} B A = ( 23 31 34 46 ) . Note A B ≠ B A AB \neq BA A B = B A .
Algebraic laws
Matrix addition and multiplication satisfy:
Associativity of addition: ( A + B ) + C = A + ( B + C ) (A + B) + C = A + (B + C) ( A + B ) + C = A + ( B + C ) .
Commutativity of addition: A + B = B + A A + B = B + A A + B = B + A .
Zero matrix: A + O = A A + O = A A + O = A .
Associativity of multiplication: A ( B C ) = ( A B ) C A(BC) = (AB)C A ( B C ) = ( A B ) C whenever all products are defined.
Distributivity: A ( B + C ) = A B + A C A(B + C) = AB + AC A ( B + C ) = A B + A C , ( A + B ) C = A C + B C (A + B)C = AC + BC ( A + B ) C = A C + B C .
Identity matrix: A I = I A = A AI = IA = A A I = I A = A for square A A A of the right order.
Non-commutativity: in general A B ≠ B A AB \neq BA A B = B A .
Zero divisors exist: A B AB A B can be O O O even if A , B ≠ O A, B \neq O A , B = O . Example: A = ( 1 0 0 0 ) A = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} A = ( 1 0 0 0 ) , B = ( 0 0 0 1 ) B = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix} B = ( 0 0 0 1 ) , then A B = O AB = O A B = O . This makes cancellation laws fail.
Powers of a square matrix
For a square A A A , A 2 = A A A^2 = AA A 2 = AA , A 3 = A ⋅ A 2 A^3 = A \cdot A^2 A 3 = A ⋅ A 2 , and so on. A 0 = I A^0 = I A 0 = I by convention.
A matrix A A A is called
idempotent if A 2 = A A^2 = A A 2 = A ,
involutory if A 2 = I A^2 = I A 2 = I ,
nilpotent if A k = O A^k = O A k = O for some positive integer k k k .
Worked examples
Example 1. Compute A + B A + B A + B for A = ( 1 2 3 4 ) , B = ( − 1 1 0 2 ) A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, B = \begin{pmatrix} -1 & 1 \\ 0 & 2 \end{pmatrix} A = ( 1 3 2 4 ) , B = ( − 1 0 1 2 ) .
( 0 3 3 6 ) \begin{pmatrix} 0 & 3 \\ 3 & 6 \end{pmatrix} ( 0 3 3 6 ) .
Example 2. Compute 3 A − 2 B 3A - 2B 3 A − 2 B for the same A , B A, B A , B .
3 A = ( 3 6 9 12 ) , 2 B = ( − 2 2 0 4 ) 3A = \begin{pmatrix} 3 & 6 \\ 9 & 12 \end{pmatrix}, 2B = \begin{pmatrix} -2 & 2 \\ 0 & 4 \end{pmatrix} 3 A = ( 3 9 6 12 ) , 2 B = ( − 2 0 2 4 ) . Difference: ( 5 4 9 8 ) \begin{pmatrix} 5 & 4 \\ 9 & 8 \end{pmatrix} ( 5 9 4 8 ) .
Example 3. Multiply A = ( 1 2 3 ) A = \begin{pmatrix} 1 & 2 & 3 \end{pmatrix} A = ( 1 2 3 ) and B = ( 4 5 6 ) B = \begin{pmatrix} 4 \\ 5 \\ 6 \end{pmatrix} B = 4 5 6 .
A B AB A B is 1 × 1 1 \times 1 1 × 1 : 1 ⋅ 4 + 2 ⋅ 5 + 3 ⋅ 6 = 32 1 \cdot 4 + 2 \cdot 5 + 3 \cdot 6 = 32 1 ⋅ 4 + 2 ⋅ 5 + 3 ⋅ 6 = 32 . So A B = ( 32 ) AB = (32) A B = ( 32 ) . And B A BA B A is 3 × 3 3 \times 3 3 × 3 : B A = ( 4 8 12 5 10 15 6 12 18 ) BA = \begin{pmatrix} 4 & 8 & 12 \\ 5 & 10 & 15 \\ 6 & 12 & 18 \end{pmatrix} B A = 4 5 6 8 10 12 12 15 18 .
Example 4. Show A = ( 2 − 3 1 − 2 ) A = \begin{pmatrix} 2 & -3 \\ 1 & -2 \end{pmatrix} A = ( 2 1 − 3 − 2 ) is involutory.
A 2 = ( 2 ( 2 ) + ( − 3 ) ( 1 ) 2 ( − 3 ) + ( − 3 ) ( − 2 ) 1 ( 2 ) + ( − 2 ) ( 1 ) 1 ( − 3 ) + ( − 2 ) ( − 2 ) ) = ( 1 0 0 1 ) = I A^2 = \begin{pmatrix} 2(2) + (-3)(1) & 2(-3) + (-3)(-2) \\ 1(2) + (-2)(1) & 1(-3) + (-2)(-2) \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} = I A 2 = ( 2 ( 2 ) + ( − 3 ) ( 1 ) 1 ( 2 ) + ( − 2 ) ( 1 ) 2 ( − 3 ) + ( − 3 ) ( − 2 ) 1 ( − 3 ) + ( − 2 ) ( − 2 ) ) = ( 1 0 0 1 ) = I .
Example 5. Show A = ( 0 1 0 0 ) A = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} A = ( 0 0 1 0 ) is nilpotent.
A 2 = ( 0 0 0 0 ) = O A^2 = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix} = O A 2 = ( 0 0 0 0 ) = O . So A A A is nilpotent of index 2 2 2 .
Example 6. Let A = ( 1 1 0 1 ) A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} A = ( 1 0 1 1 ) . Show A n = ( 1 n 0 1 ) A^n = \begin{pmatrix} 1 & n \\ 0 & 1 \end{pmatrix} A n = ( 1 0 n 1 ) by induction.
Base: A 1 = A A^1 = A A 1 = A has ( 1 , 2 ) (1, 2) ( 1 , 2 ) -entry equal to 1 1 1 . Step: A n + 1 = A ⋅ A n = ( 1 1 0 1 ) ( 1 n 0 1 ) = ( 1 n + 1 0 1 ) A^{n+1} = A \cdot A^n = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}\begin{pmatrix} 1 & n \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 1 & n + 1 \\ 0 & 1 \end{pmatrix} A n + 1 = A ⋅ A n = ( 1 0 1 1 ) ( 1 0 n 1 ) = ( 1 0 n + 1 1 ) . ■ \blacksquare ■
Try it yourself
Compute A + B A + B A + B for A = ( 1 2 ) , B = ( 3 4 ) A = \begin{pmatrix} 1 \\ 2 \end{pmatrix}, B = \begin{pmatrix} 3 \\ 4 \end{pmatrix} A = ( 1 2 ) , B = ( 3 4 ) .
Compute 2 A 2A 2 A for A = ( 0 1 − 1 0 ) A = \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix} A = ( 0 − 1 1 0 ) .
Multiply ( 1 2 3 4 ) ( 5 0 0 6 ) \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\begin{pmatrix} 5 & 0 \\ 0 & 6 \end{pmatrix} ( 1 3 2 4 ) ( 5 0 0 6 ) .
Multiply ( 1 2 3 4 ) ( 1 − 1 ) \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\begin{pmatrix} 1 \\ -1 \end{pmatrix} ( 1 3 2 4 ) ( 1 − 1 ) .
Find A 2 A^2 A 2 for A = ( 2 0 0 3 ) A = \begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix} A = ( 2 0 0 3 ) .
Find A 2 A^2 A 2 for A = ( 0 1 − 1 0 ) A = \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix} A = ( 0 − 1 1 0 ) .
Verify: A ( B + C ) = A B + A C A(B + C) = AB + AC A ( B + C ) = A B + A C for matrices A = ( 1 , 1 ) , B = ( 1 ) , C = ( 2 ) A = (1, 1), B = (1), C = (2) A = ( 1 , 1 ) , B = ( 1 ) , C = ( 2 ) . (Choose orders.)
Find a 2 × 2 2 \times 2 2 × 2 matrix A ≠ O A \ne O A = O with A 2 = O A^2 = O A 2 = O .
Find a 2 × 2 2 \times 2 2 × 2 matrix A ≠ I A \ne I A = I with A 2 = I A^2 = I A 2 = I .
Find A 10 A^{10} A 10 for A = ( 1 1 0 1 ) A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} A = ( 1 0 1 1 ) .
Show that the sum of two symmetric matrices is symmetric.
Find A B AB A B and B A BA B A for A = ( 1 0 0 0 ) A = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} A = ( 1 0 0 0 ) and B = ( 0 1 0 0 ) B = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} B = ( 0 0 1 0 ) .
Show A 2 = 3 A A^2 = 3A A 2 = 3 A for A = ( 3 0 0 0 ) A = \begin{pmatrix} 3 & 0 \\ 0 & 0 \end{pmatrix} A = ( 3 0 0 0 ) .
Multiply ( cos θ − sin θ sin θ cos θ ) ( cos ϕ − sin ϕ sin ϕ cos ϕ ) \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}\begin{pmatrix} \cos\phi & -\sin\phi \\ \sin\phi & \cos\phi \end{pmatrix} ( cos θ sin θ − sin θ cos θ ) ( cos ϕ sin ϕ − sin ϕ cos ϕ ) and identify the result.
Pitfalls / Tricks
Matrix multiplication is not commutative : always check the order before declaring A B = B A AB = BA A B = B A .
Always confirm dimensions before multiplying. A 2 × 3 A_{2 \times 3} A 2 × 3 times B 2 × 3 B_{2 \times 3} B 2 × 3 is undefined.
A B = O AB = O A B = O does not imply A = O A = O A = O or B = O B = O B = O . There exist zero divisors.
Powers of a matrix can be computed efficiently using induction (as in Example 6) or eigenvalues.
The rotation matrix in problem 14 satisfies R ( θ ) R ( ϕ ) = R ( θ + ϕ ) R(\theta) R(\phi) = R(\theta + \phi) R ( θ ) R ( ϕ ) = R ( θ + ϕ ) , a useful structural identity.
Next we look at the transpose and the symmetric/skew-symmetric decomposition.