A matrix is a rectangular array of numbers arranged in rows and columns. Matrices provide a powerful Framework for solving systems of linear equations, representing geometric transformations, modelling Markov processes, and much more. This topic is central to the IB Mathematics AA course at both SL And HL, with eigenvalues and diagonalisation appearing exclusively at HL.
1. Matrix Fundamentals
Definition and Notation
An m×n matrix A is a rectangular array of real numbers with m rows and n columns:
The entry in row i and column j is denoted aij. The set of all m×n real matrices Is written Mm×n(R).
A column vector in Rn is an n×1 matrix, and a row vector is a 1×n Matrix. When the dimensions are equal (m=n), the matrix is called square.
Matrix Addition and Scalar Multiplication
Addition. If A,B∈Mm×n(R)Then A+B is defined Entry-wise:
(A + B)_`\{ij}` = a_`\{ij}` + b_`\{ij}`
Scalar multiplication. For k∈R and A∈Mm×n(R):
(kA)_`\{ij}` = k \cdot a_`\{ij}`
These operations satisfy the following axioms (making Mm×n(R) a Vector space over R):
A+B=B+A (commutativity)
(A+B)+C=A+(B+C) (associativity)
A+O=AWhere O is the m×n zero matrix
k(A+B)=kA+kB (distributivity over matrix addition)
(k+l)A=kA+lA (distributivity over scalar addition)
k(lA)=(kl)A (associativity of scalar multiplication)
Matrix Multiplication
If A is m×p and B is p×nThen the product C=AB is an m×n matrix Whose entries are:
C_`\{ij}` = \sum_{k=1}^{p} a_`\{ik}` b_`\{kj}`
This is the dot product of the i-th row of A with the j-th column of B. The inner Dimensions must agree: an m×p matrix can multiply a p×n matrix, producing an m×n matrix.
Critical properties:
Matrix multiplication is associative: (AB)C=A(BC) when the products are defined.
Matrix multiplication is distributive over addition: A(B+C)=AB+AC.
Matrix multiplication is NOT commutative : AB=BA.
The existence of AB does not imply the existence of BA.
AB=O does NOT imply A=O or B=O (there are non-trivial zero divisors).
Examples
Expand
Solve the system:
2x+3y=8 and x−y=1
In matrix form: (213−1)(xy)=(81)
det(A)=(2)(−1)−(3)(1)=−5
A−1=−51(−1−1−32)=(0.20.20.6−0.4)
(xy)=(0.20.20.6−0.4)(81)=(2.21.2)
So x=511 and y=56.
4. 2D Geometric Transformations
Every linear transformation T:R2→R2 can be represented by a 2×2 Matrix M such that T(v)=Mv. The images of the standard basis vectors (10) and (01) form the columns Of M.
Reflections
A reflection maps every point to its mirror image across a specified line. The determinant of any Reflection matrix is −1 (orientation is reversed).
For a stretch parallel to the x-axis, det(Sx)=kSo the area scale factor is ∣k∣. If 0<k<1The figure is compressed; if k>1It is expanded.
Shears. A horizontal shear with shear factor k fixes every point on the x-axis and shifts Other points horizontally in proportion to their y-coordinate:
For any shear matrix, det=1So area is preserved. The x-axis (for Hx) or y-axis (for Hy) is point-wise invariant.
Composite Transformations
If transformation A is applied first, followed by transformation BThe composite transformation Is represented by the product BA (note the order: right to left).
v′=B(Av)=(BA)v
Example. A rotation of 90∘ anticlockwise followed by a reflection in the x-axis:
This is equivalent to a single reflection in the line y=−x.
Worked Example: Composite Transformation
Find the image of the point (2,3) under a rotation of 90∘ anticlockwise about the origin Followed by a reflection in the line y=x.
Rotation matrix:
R90=(01−10)
Reflection in y=x:
Ry=x=(0110)
Composite (reflection applied after rotation):
M=Ry=x⋅R90=(0110)(01−10)=(100−1)
This is a reflection in the x-axis! Apply to (2,3):
(100−1)(23)=(2−3)
The image is (2,−3).
Inverse of a composite. Since (BA)−1=A−1B−1To undo a composite transformation, The individual inverses are applied in reverse order.
Invariant Points and Invariant Lines
An invariant point under transformation M is a point v such that Mv=vI.e. (M−I)v=0. The set of invariant points forms The null space of M−I.
For any 2×2 transformation matrix, the origin is always invariant.
An invariant line is a line that is mapped onto itself (though individual points on the line may Move along it). A line through the origin with direction vector d is invariant if Md=λd for some scalar λWhich means d is an Eigenvector of M.
A line is point-wise invariant (every point is fixed) if and only if every point on it is an Invariant point, meaning the line lies entirely in the null space of M−I.
Not all invariant lines are point-wise invariant. For example, a stretch parallel to the x-axis (k001) leaves the x-axis point-wise invariant and Also leaves the y-axis invariant as a line (each point (0,y) maps to itself), but it leaves Every line parallel to the x-axis invariant as a line (points slide along it), not point-wise.
For a reflection, the mirror line is point-wise invariant and the line perpendicular to it through The origin is invariant as a set (points are reflected across the mirror line but remain on the Perpendicular line).
Area Scale Factor
For any 2×2 matrix M representing a linear transformation of the plane, the area scale Factor is ∣det(M)∣. This means:
If ∣det(M)∣=1The transformation preserves area (e.g. Rotations, reflections).
If ∣det(M)∣=k2The area of any region is multiplied by k2 (e.g. Enlargement by scale factor k).
If det(M)=0The transformation is singular and collapses the plane to a line or point.
This extends to 3×3 matrices where ∣det(M)∣ is the volume scale factor.
5. Eigenvalues and Eigenvectors (AHL)
Motivation
When a linear transformation acts on a vector, the vector is generally rotated and scaled. Certain Special vectors, called eigenvectors, are only scaled (stretched or compressed) by the Transformation, not rotated. The factor by which an eigenvector is scaled is the corresponding eigenvalue.
Formal Definition
Let A be an n×n matrix. A scalar λ is an eigenvalue of A if there exists a Non-zero vector v (the corresponding eigenvector) such that:
Av=λv
Equivalently: (A−λI)v=0.
For a non-trivial solution v=0 to exist, we require:
det(A−λI)=0
Characteristic Equation
The equation det(A−λI)=0 is the characteristic equation of A. For a 2×2 Matrix A=(acbd):
\det\begin`\{pmatrix}` a - \lambda & b \\ c & d - \lambda \end`\{pmatrix}` = (a - \lambda)(d - \lambda) - bc = 0
Expanding:
λ2−(a+d)λ+(ad−bc)=0
Notice that a+d=tr(A) (the trace of A) and ad−bc=det(A). Therefore:
λ2−tr(A)λ+det(A)=0
For a 3×3 matrix, the characteristic equation is a cubic:
det(A−λI)=−λ3+tr(A)λ2−Sλ+det(A)=0
Where S is the sum of the principal 2×2 minors (the sum of the determinants of the Matrices obtained by deleting each row and the corresponding column).
Fundamental properties of eigenvalues:
The sum of the eigenvalues equals the trace: λ1+λ2+⋯+λn=tr(A).
The product of the eigenvalues equals the determinant: λ1λ2⋯λn=det(A).
A matrix is invertible if and only if none of its eigenvalues is zero.
The eigenvalues of Ak are λ1k,λ2k,…,λnk.
Finding Eigenvectors
Once an eigenvalue λ is known, the corresponding eigenvectors are found by solving:
(A−λI)v=0
This is a homogeneous system. Since det(A−λI)=0The rows of A−λI are Linearly dependent, and the system has infinitely many solutions forming a one-dimensional subspace (a line through the origin) for each distinct eigenvalue.
Important: Eigenvectors are determined only up to a non-zero scalar multiple. Any non-zero Multiple of an eigenvector is also an eigenvector for the same eigenvalue.
Repeated Eigenvalues
When the characteristic equation has a repeated root (a repeated eigenvalue), the matrix may or may Not be diagonalisable.
Geometric multiplicity≤algebraic multiplicity. The algebraic multiplicity of an eigenvalue is its multiplicity as a root of the characteristic equation. The geometric multiplicity is the dimension of the corresponding eigenspace (the number of linearly independent eigenvectors for that eigenvalue).
A matrix is diagonalisable if and only if the geometric multiplicity of each eigenvalue equals its algebraic multiplicity.
If the geometric multiplicity is strictly less than the algebraic multiplicity, the matrix is defective and cannot be diagonalised.
For a 2×2 matrix with a repeated eigenvalue λ:
If A=λIThen every non-zero vector is an eigenvector (geometric multiplicity =2), and A is diagonalisable (it is already diagonal).
If A=λI but has a repeated eigenvalue, the geometric multiplicity is 1 and A is not diagonalisable.
3x3 Eigenvalue Problems
For a 3×3 matrix, the characteristic equation is a cubic polynomial in λ. The cubic Can have three distinct real roots, one repeated and one distinct real root, or one real root and Two complex conjugate roots. Since the IB course works over ROnly real eigenvalues and Eigenvectors are considered.
-v_1 = 0$$v_3 = 0$$v_2 is free. Eigenvector: 010.
Eigenvector for λ2=2:
000010010v1v2v3=000
v_2 + v_3 = 0$$v_3 = -v_2And v1 is free. Two linearly independent eigenvectors: 100 and 01−1.
Since the geometric multiplicity of λ2=2 equals its algebraic multiplicity (both =2), The matrix is diagonalisable. The total number of linearly independent eigenvectors is 3.
P=01010001−1,D=300020002
Characteristic equation:
det(A−λI)=4−λ213−λ=(4−λ)(3−λ)−2=0
λ2−7λ+10=0
(λ−5)(λ−2)=0
λ1=5,λ2=2
Eigenvector for λ1=5:
(4−5213−5)(v1v2)=(00)
(−121−2)(v1v2)=(00)
From the first row: −v1+v2=0So v1=v2. The eigenvector is (11) (up to scalar multiples).
Eigenvector for λ2=2:
(4−2213−2)(v1v2)=(00)
(2211)(v1v2)=(00)
From the first row: 2v1+v2=0So v2=−2v1. The eigenvector is (1−2).
Diagonalisation
An n×n matrix A is diagonalisable if there exists an invertible matrix P and a Diagonal matrix D such that:
A=PDP−1
The columns of P are the eigenvectors of AAnd the diagonal entries of D are the Corresponding eigenvalues.
Theorem. An n×n matrix is diagonalisable if and only if it has n linearly independent Eigenvectors. This is guaranteed when A has n distinct eigenvalues.
Procedure for diagonalising a 2×2 matrix:
Find the eigenvalues by solving det(A−λI)=0.
Find a corresponding eigenvector for each eigenvalue.
Form P=(v1v2) (eigenvectors as columns).
Form D=(λ100λ2).
Verify: A=PDP−1Or equivalently, P−1AP=D.
Matrix Powers via Diagonalisation
One of the most powerful applications of diagonalisation is computing large matrix powers. If A=PDP−1Then:
Ak=PDkP−1
Where Dk=(λ1k00λ2k) for a 2×2 Case.
This transforms the problem of computing Ak (which would require k−1 matrix multiplications) Into computing three matrix products, which is dramatically more efficient.
Examples
Expand
Find A5 whereA=(4213)
From the previous example: \lambda_1 = 5$$\lambda_2 = 2v1=(11)v2=(1−2).
Gaussian elimination is a systematic method for solving systems of linear equations by reducing the Augmented matrix to row echelon form (REF) or reduced row echelon form (RREF).
Elementary row operations:
Swap two rows (Ri↔Rj).
Multiply a row by a non-zero scalar (Ri→kRi).
Add a multiple of one row to another (Ri→Ri+kRj).
Algorithm (for an n×n system):
Form the augmented matrix [A∣b].
Use row operations to create zeros below each pivot (forward elimination).
Back-substitute to find the solution.
Existence and uniqueness:
If rank(A)=rank([A∣b])=n: unique solution.
If rank(A)=rank([A∣b])<n: infinitely many solutions.
If rank(A)<rank([A∣b]): no solution (inconsistent system).
Examples
Expand
Solve the system:
x + 2y + z = 5$$2x + 5y + 3z = 13$$x + 3y + 3z = 10
Augmented matrix:
121253133∣∣∣51310
R_2 \to R_2 - 2R_1$$R_3 \to R_3 - R_1:
100211112∣∣∣535
R3→R3−R2:
100210111∣∣∣532
Back-substitution: z = 2$$y + z = 3 \Rightarrow y = 1$$x + 2(1) + 2 = 5 \Rightarrow x = 1.
Solution: (x,y,z)=(1,1,2).
Cramer’s Rule
Cramer’s rule provides an explicit formula for the solution of a system Ax=b When A is an n×n invertible matrix.
For a 2×2 system:
X = \frac{\begin`\{vmatrix}` e & b \\ f & d \end`\{vmatrix}`}{\det(A)}, \qquad y = \frac{\begin`\{vmatrix}` a & e \\ c & f \end`\{vmatrix}`}{\det(A)}
Where the numerator for x replaces the first column of A with bAnd the numerator For y replaces the second column.
General formula (Cramer’s Rule): For each variable xi:
Xi=det(A)det(Ai)
Where Ai is the matrix A with column i replaced by the vector b.
Examples
Expand
Encrypt “HELP” using the key matrix
K=(3152)
Convert to numbers: H = 7$$E = 4$$L = 11$$P = 15.
Block 1: (74)Block 2: (1115)
Block 1: (3152)(74)=(21+207+8)=(4115)
Modulo 26: (1515)Which gives “PP”.
Block 2: (3152)(1115)=(33+7511+30)=(10841)
Modulo 26: 108 \bmod 26 = 4$$41 \bmod 26 = 15Giving (415) Which is “EP”.
Ciphertext: “PPEP”
Computer Graphics
Matrices are fundamental to 2D and 3D computer graphics. Every transformation of a geometric object (viewing, rotation, scaling, projection) is represented by matrix multiplication.
Homogeneous coordinates. To represent translations (which are not linear transformations) as Matrix multiplications, 2D points (x,y) are extended to homogeneous coordinates (x,y,1). A Translation by (tx,ty) is then:
Rotation and scaling in homogeneous coordinates use 3×3 matrices with the bottom row (0,0,1).
Transformation pipeline. A typical graphics pipeline applies a sequence of transformations: Model transform (place object in world space), view transform (position camera), projection Transform (3D to 2D), and viewport transform (map to screen coordinates). Each stage is a matrix Multiplication.
Composition advantage. Instead of applying n separate transformations to each of m vertices, The transformations are composed into a single matrix M=Tn⋯T2T1And each vertex is Transformed with a single multiplication Mv. This reduces the cost from O(nm) to O(n3+m) matrix operations.
Markov Chains
A Markov chain is a stochastic process where the probability of transitioning to any future State depends only on the current state, not on the sequence of events that preceded it (the Markov Property).
Transition matrix. A transition matrix P is a square matrix where:
pij≥0 for all i,j (entries are probabilities)
Each row sums to 1: ∑jpij=1 for all i
The entry pij represents the probability of moving from state i to state j in one step.
State evolution. If s(k) is the state probability vector at step kThen:
s(k)=s(0)Pk
Steady state. A steady-state (stationary) vector s satisfies sP=sOr equivalently, s(P−I)=0. This means s is a left eigenvector of P with eigenvalue 1.
For a regular Markov chain (one where some power of P has all positive entries), the steady-state Distribution exists, is unique, and is independent of the initial state. The eigenvalue 1 is Always the largest eigenvalue of a stochastic matrix (by the Perron-Frobenius theorem).
Examples
Expand
A weather model has two states: Sunny (S) and Rainy (R). If it is sunny today, the probability of Sun tomorrow is 0.7 and rain is 0.3. If it is rainy today, the probability of sun tomorrow is 0.4 and rain is 0.6.
Transition matrix:
P=(0.70.40.30.6)
Find the steady-state vectors=(sr):
sP=s gives 0.7s+0.4r=s and 0.3s+0.6r=r.
From the first equation: −0.3s+0.4r=0So 3s=4r.
Since s+r=1: s+43s=1Giving s=74 and r=73.
Steady state: s=(7473).
In the long run, the weather is sunny 74≈57.1% of the time.
Eigenvalue verification. The eigenvalues of P are found from:
det(P−λI)=(0.7−λ)(0.6−λ)−0.12=λ2−1.3λ+0.3=0
(λ−1)(λ−0.3)=0
\lambda_1 = 1$$\lambda_2 = 0.3. Since ∣λ2∣<1As k→∞ the term λ2k→0 and the system converges to the eigenvector for λ1=1.
:::danger Common Pitfalls
Confusing matrix multiplication order: Matrix multiplication is NOT commutative: AB is generally not equal to BA. When applying a transformation matrix to a point, the ORDER matters. For combined transformations, the matrix closest to the point is applied FIRST: if transformation B follows transformation A, the combined matrix is BA (not AB).
Forgetting that the determinant of a singular matrix is zero: A singular matrix has determinant zero and NO inverse. If asked to find the inverse of a 2x2 matrix, always check that the determinant is non-zero first. A zero determinant means the transformation collapses space (maps the plane onto a line), which is why no inverse exists.
Misidentifying the type of transformation from its matrix: A reflection in the y-axis has matrix [[-1, 0], [0, 1]] (negative in top-left). A reflection in the x-axis has matrix [[1, 0], [0, -1]] (negative in bottom-right). Students frequently confuse these two. Also, a rotation of 90 degrees anticlockwise gives [[0, -1], [1, 0]], which students often mix up with the clockwise rotation.
Arithmetic errors when calculating determinants and inverses: For a 2x2 matrix [[a, b], [c, d]], the determinant is ad - bc (not ad + bc). The inverse is (1/det) * [[d, -b], [-c, a]] (note the swap of a and d and the negative signs). A single sign error invalidates the entire calculation. Always double-check by multiplying the matrix by its inverse to get the identity.
Orthogonal Matrices
A square matrix Q is orthogonal if QTQ=QQT=IWhich means Q−1=QT.
Equivalent characterisations:
The columns of Q form an orthonormal set (each column has unit length, and distinct columns are perpendicular).
The rows of Q form an orthonormal set.
det(Q)=±1 (since det(QT)det(Q)=det(I)=1 and det(QT)=det(Q)).
Rotation matrices and reflection matrices in R2 are orthogonal:
Rotations have det=+1 and are called proper orthogonal (special orthogonal).
Reflections have det=−1.
Preservation of the inner product. If Q is orthogonal, then for any vectors u,v:
(Qu)⋅(Qv)=u⋅v
In particular, ∣Qv∣=∣v∣ and the angle between vectors is preserved.
Orthogonal diagonalisation (spectral theorem). A real symmetric matrix A can always be Orthogonally diagonalised: A=QDQT where Q is orthogonal and D is diagonal. This is a Stronger form of diagonalisation that is guaranteed for all symmetric matrices (even those with Repeated eigenvalues), since symmetric matrices always have n linearly independent eigenvectors That can be chosen orthonormal.
A reflection in the y-axis is followed by an enlargement with scale factor 3 about the origin. Find the single matrix that represents this composite transformation. What is the area scale factor?
Solution
Reflection in the y-axis: Ry=(−1001)
Enlargement with scale factor 3: E3=(3003)
Composite (enlargement applied after reflection):
M=E3⋅Ry=(3003)(−1001)=(−3003)
Area scale factor: ∣det(M)∣=∣−3×3−0∣=9.
If you get this wrong, revise: Composite Transformations and Area Scale Factor.
Solution: x = 1$$y = \frac{4}{3}$$z = \frac{2}{3}.
If you get this wrong, revise: Cramer’s Rule section.
Problem 7
Find the eigenvalues and eigenvectors of A=(31−20).
Solution
Characteristic equation:
det(A−λI)=(3−λ)(−λ)−(−2)(1)=λ2−3λ+2=0
(λ−1)(λ−2)=0
λ1=1, λ2=2.
Eigenvector for λ1=1:
(21−2−1)(v1v2)=(00)⟹v1=v2
Eigenvector: (11).
Eigenvector for λ2=2:
(11−2−2)(v1v2)=(00)⟹v1=2v2
Eigenvector: (21).
If you get this wrong, revise: Eigenvalues and Eigenvectors section.
Problem 8
A stretch parallel to the x-axis with scale factor 2 is followed by a stretch parallel to the y-axis with scale factor 3. Find the single matrix and describe its effect on the unit square.
Solution
M=(1003)(2001)=(2003)
The unit square (area = 1) is mapped to a rectangle with vertices (0,0), (2,0), (2,3), (0,3). The new area is 6.
Area scale factor: ∣det(M)∣=6.
If you get this wrong, revise: Enlargements and Stretches section.
Problem 9
Find the invariant points and invariant lines of the transformation represented by M=(2012).
Solution
Invariant points: Solve (M−I)x=0:
(1011)(xy)=(00)
From row 2: y=0. From row 1: x+0=0So x=0.
The only invariant point is the origin (0,0).
Invariant lines: For an invariant line through the origin, the direction vector must be an Eigenvector. Eigenvalues satisfy (2−λ)2=0So λ=2 (repeated).
For λ=2: (0010)(v1v2)=(00)Giving v2=0. The only eigenvector direction is (10).
The x-axis (y=0) is the only invariant line through the origin.
If you get this wrong, revise: Invariant Points and Lines section.
Problem 10
The transition matrix for a two-state Markov chain is P=(0.60.40.30.7). Find the steady-state distribution.
Solution
Solve sP=s where s=(s1s2) with s1+s2=1.
From sP=s:
0.6s1+0.4s2=s1⟹−0.4s1+0.4s2=0⟹s1=s2
With s1+s2=1: s1=0.5, s2=0.5.
Steady state: (0.50.5).
If you get this wrong, revise: Markov Chains section.
Problem 11
Encrypt the word “CAT” using the Hill cipher with key matrix K=(2111)Padding with “X” if needed.
Solution
C = 2, A = 0, T = 19. Pad to make even length: “CATX” where X = 23.
Block 1: (20)Block 2: (1923)
Block 1:
(2111)(20)=(42)≡(42)(mod26)
Giving “EC”.
Block 2:
(2111)(1923)=(6142)≡(916)(mod26)
61mod26=9 (J), 42mod26=16 (Q). Giving “JQ”.
Ciphertext: “ECJQ”.
If you get this wrong, revise: Hill Cipher section.
Problem 12
Diagonalise the matrix A=(2112) and use the diagonalisation To find A4.