Skip to content

Matrices and Transformations (Extended)

Matrices and Transformations (Extended Treatment)

Section titled “Matrices and Transformations (Extended Treatment)”

This document covers matrix operations, determinants, inverses, 3x3 matrices, linear Transformations, and an introduction to eigenvalues and eigenvectors.


An m×nm \times n matrix AA is a rectangular array of numbers with mm rows and nn columns. The Entry in row iiColumn jj is written aija_{ij}.

Addition. If AA and BB are both m×nm \times nThen (A+B)ij=aij+bij(A + B)_{ij} = a_{ij} + b_{ij}.

Scalar multiplication. (cA)ij=caij(cA)_{ij} = ca_{ij}.

Matrix multiplication. If AA is m×nm \times n and BB is n×pn \times pThen C=ABC = AB is m×pm \times p with:

cij=k=1naikbkjc_{ij} = \sum_{k=1}^{n} a_{ik}\,b_{kj}

Matrix multiplication is:

  • Associative: (AB)C=A(BC)(AB)C = A(BC).
  • Distributive over addition: A(B+C)=AB+ACA(B + C) = AB + AC.
  • NOT commutative: , ABBAAB \neq BA.

Proof that matrix multiplication is not commutative. Consider:

A=(1000),B=(0100)A = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}, \quad B = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}

AB=(0100),BA=(0000)AB = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}, \quad BA = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}

ABBAAB \neq BA. \blacksquare

The n×nn \times n identity matrix InI_n has 11S on the main diagonal and 00S elsewhere. For any n×nn \times n matrix AA: AIn=InA=AAI_n = I_n A = A.

Problem. Given A=(2134)A = \begin{pmatrix} 2 & -1 \\ 3 & 4 \end{pmatrix} and B=(1520)B = \begin{pmatrix} 1 & 5 \\ -2 & 0 \end{pmatrix}Find ABAB and BABA.

AB=(2(1)+(1)(2)2(5)+(1)(0)3(1)+4(2)3(5)+4(0))=(410515)AB = \begin{pmatrix} 2(1) + (-1)(-2) & 2(5) + (-1)(0) \\ 3(1) + 4(-2) & 3(5) + 4(0) \end{pmatrix} = \begin{pmatrix} 4 & 10 \\ -5 & 15 \end{pmatrix}

BA=(1(2)+5(3)1(1)+5(4)2(2)+0(3)2(1)+0(4))=(171942)BA = \begin{pmatrix} 1(2) + 5(3) & 1(-1) + 5(4) \\ -2(2) + 0(3) & -2(-1) + 0(4) \end{pmatrix} = \begin{pmatrix} 17 & 19 \\ -4 & 2 \end{pmatrix}

ABBAAB \neq BAConfirming non-commutativity.


det(abcd)=adbc\det\begin{pmatrix} a & b \\ c & d \end{pmatrix} = ad - bc

det(abcdefghk)=aefhkbdfgk+cdegh\det\begin{pmatrix} a & b & c \\ d & e & f \\ g & h & k \end{pmatrix} = a\begin{vmatrix} e & f \\ h & k \end{vmatrix} - b\begin{vmatrix} d & f \\ g & k \end{vmatrix} + c\begin{vmatrix} d & e \\ g & h \end{vmatrix}

=a(ekfh)b(dkfg)+c(dheg)= a(ek - fh) - b(dk - fg) + c(dh - eg)

  1. det(AB)=det(A)det(B)\det(AB) = \det(A)\det(B).
  2. det(AT)=det(A)\det(A^T) = \det(A).
  3. Swapping two rows (or columns) changes the sign of the determinant.
  4. A matrix with a row (or column) of zeros has determinant zero.
  5. Adding a multiple of one row to another does not change the determinant.
  6. det(cA)=cndet(A)\det(cA) = c^n\det(A) for an n×nn \times n matrix.

For a 2×22 \times 2 matrix, det(A)|\det(A)| is the area scale factor of the transformation. If det(A)=0\det(A) = 0The transformation collapses the plane to a line or a point.

For a 3×33 \times 3 matrix, det(A)|\det(A)| is the volume scale factor.

Problem. Find the determinant of A=(213014120)A = \begin{pmatrix} 2 & 1 & 3 \\ 0 & -1 & 4 \\ 1 & 2 & 0 \end{pmatrix}.

Expanding along the first row:

detA=2142010410+30112\det A = 2\begin{vmatrix} -1 & 4 \\ 2 & 0 \end{vmatrix} - 1\begin{vmatrix} 0 & 4 \\ 1 & 0 \end{vmatrix} + 3\begin{vmatrix} 0 & -1 \\ 1 & 2 \end{vmatrix}

=2(08)1(04)+3(0+1)=16+4+3=9= 2(0 - 8) - 1(0 - 4) + 3(0 + 1) = -16 + 4 + 3 = -9


The inverse of a square matrix AA is a matrix A1A^{-1} such that:

AA1=A1A=IAA^{-1} = A^{-1}A = I

An inverse exists if and only if det(A)0\det(A) \neq 0. A matrix with no inverse is singular.

(abcd)1=1adbc(dbca)\begin{pmatrix} a & b \\ c & d \end{pmatrix}^{-1} = \frac{1}{ad - bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}

Verification:

1adbc(dbca)(abcd)=1adbc(adbc00adbc)=I\frac{1}{ad - bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}\begin{pmatrix} a & b \\ c & d \end{pmatrix} = \frac{1}{ad - bc}\begin{pmatrix} ad - bc & 0 \\ 0 & ad - bc \end{pmatrix} = I

Method 1: Adjugate matrix. A1=1detAadj(A)A^{-1} = \dfrac{1}{\det A}\,\mathrm{adj}(A)Where the Adjugate is the transpose of the cofactor matrix.

Method 2: Row reduction. Form the augmented matrix [AI][A \mid I] and apply row operations to Obtain [IA1][I \mid A^{-1}].

Problem. Find the inverse of A=(120013101)A = \begin{pmatrix} 1 & 2 & 0 \\ 0 & 1 & 3 \\ 1 & 0 & 1 \end{pmatrix}.

detA=1(10)2(03)+0=1+6=7\det A = 1(1 - 0) - 2(0 - 3) + 0 = 1 + 6 = 7.

Cofactors: C_{11} = 1$$C_{12} = 3$$C_{13} = -1$$C_{21} = -2$$C_{22} = 1$$C_{23} = 2 C_{31} = 6$$C_{32} = -3$$C_{33} = 1.

A1=17(126313121)A^{-1} = \frac{1}{7}\begin{pmatrix} 1 & -2 & 6 \\ 3 & 1 & -3 \\ -1 & 2 & 1 \end{pmatrix}

A system Ax=bA\mathbf{x} = \mathbf{b} has a unique solution x=A1b\mathbf{x} = A^{-1}\mathbf{b} if and Only if detA0\det A \neq 0.

If detA=0\det A = 0: either no solution (inconsistent) or infinitely many solutions (dependent).


A 2×22 \times 2 matrix represents a linear transformation of the plane:

(x"y)=(abcd)(xy)\begin{pmatrix} x" \\ y' \end{pmatrix} = \begin{pmatrix} a & b \\ c & d \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix}

Key property: the origin is always mapped to the origin.

TransformationMatrix
Reflection in xx-axis(1001)\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}
Reflection in yy-axis(1001)\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}
Reflection in y=xy = x(0110)\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}
Rotation θ\theta anticlockwise(cosθsinθsinθcosθ)\begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}
Enlargement scale kk(k00k)\begin{pmatrix} k & 0 \\ 0 & k \end{pmatrix}
Stretch parallel to xx (sf kk)(k001)\begin{pmatrix} k & 0 \\ 0 & 1 \end{pmatrix}

If transformation AA is followed by transformation BBThe combined transformation is BABA.

Proof. If v=Av\mathbf{v}' = A\mathbf{v} and v=Bv\mathbf{v}'' = B\mathbf{v}'Then v=B(Av)=(BA)v\mathbf{v}'' = B(A\mathbf{v}) = (BA)\mathbf{v}. \blacksquare

Problem. Find the matrix representing a rotation of 9090^\circ anticlockwise about the origin Followed by a reflection in the xx-axis.

Rotation 9090^\circ: R=(0110)R = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}.

Reflection in xx-axis: S=(1001)S = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}.

Combined: SR=(1001)(0110)=(0110)SR = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}

Check: this is equivalent to a reflection in the line y=xy = -x.

An invariant point satisfies Ax=xA\mathbf{x} = \mathbf{x}I.e. (AI)x=0(A - I)\mathbf{x} = \mathbf{0}.

An invariant line is a line that is mapped to itself (points on the line may move along the Line). If v\mathbf{v} is a direction vector of the line, then Av=λvA\mathbf{v} = \lambda\mathbf{v} for Some scalar λ\lambda.


For a square matrix AAA scalar λ\lambda and a non-zero vector v\mathbf{v} are an eigenvalue And eigenvector of AA if:

Av=λvA\mathbf{v} = \lambda\mathbf{v}

Geometrically, AA stretches or compresses the eigenvector by a factor of λ\lambda without changing Its direction.

Av=λv    (AλI)v=0A\mathbf{v} = \lambda\mathbf{v} \implies (A - \lambda I)\mathbf{v} = \mathbf{0}.

For non-trivial solutions, we need det(AλI)=0\det(A - \lambda I) = 0. This is the characteristic Equation.

For a 2×22 \times 2 matrix:

det(aλbcdλ)=(aλ)(dλ)bc=0\det\begin{pmatrix} a - \lambda & b \\ c & d - \lambda \end{pmatrix} = (a - \lambda)(d - \lambda) - bc = 0

λ2(a+d)λ+(adbc)=0\lambda^2 - (a + d)\lambda + (ad - bc) = 0

Key result: λ1+λ2=tr(A)=a+d\lambda_1 + \lambda_2 = \mathrm{tr}(A) = a + d (the trace) and λ1λ2=detA\lambda_1 \lambda_2 = \det A.

For each eigenvalue λi\lambda_iSolve (AλiI)v=0(A - \lambda_i I)\mathbf{v} = \mathbf{0}.

Problem. Find the eigenvalues and eigenvectors of A=(4123)A = \begin{pmatrix} 4 & 1 \\ 2 & 3 \end{pmatrix}.

Characteristic equation: (4λ)(3λ)2=0(4 - \lambda)(3 - \lambda) - 2 = 0

λ27λ+10=0    (λ5)(λ2)=0\lambda^2 - 7\lambda + 10 = 0 \implies (\lambda - 5)(\lambda - 2) = 0

\lambda_1 = 5$$\lambda_2 = 2.

For λ1=5\lambda_1 = 5:

(1122)(xy)=(00)\begin{pmatrix} -1 & 1 \\ 2 & -2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix}

x+y=0    y=x-x + y = 0 \implies y = x. Eigenvector: (11)\begin{pmatrix} 1 \\ 1 \end{pmatrix}.

For λ2=2\lambda_2 = 2:

(2121)(xy)=(00)\begin{pmatrix} 2 & 1 \\ 2 & 1 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix}

2x+y=0    y=2x2x + y = 0 \implies y = -2x. Eigenvector: (12)\begin{pmatrix} 1 \\ -2 \end{pmatrix}.

If an n×nn \times n matrix AA has nn linearly independent eigenvectors, it can be diagonalised:

A=PDP1A = PDP^{-1}

Where PP has the eigenvectors as columns and DD is a diagonal matrix with the eigenvalues on the Diagonal.

Worked example. For the matrix above:

P=(1112),D=(5002)P = \begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix}, \quad D = \begin{pmatrix} 5 & 0 \\ 0 & 2 \end{pmatrix}

detP=21=3,P1=13(2111)=13(2111)\det P = -2 - 1 = -3, \quad P^{-1} = -\frac{1}{3}\begin{pmatrix} -2 & -1 \\ -1 & 1 \end{pmatrix} = \frac{1}{3}\begin{pmatrix} 2 & 1 \\ 1 & -1 \end{pmatrix}

Verify: PDP1=13(1112)(5002)(2111)PDP^{-1} = \dfrac{1}{3}\begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix}\begin{pmatrix} 5 & 0 \\ 0 & 2 \end{pmatrix}\begin{pmatrix} 2 & 1 \\ 1 & -1 \end{pmatrix}

=13(5254)(2111)=13(12369)=(4123)=A= \dfrac{1}{3}\begin{pmatrix} 5 & 2 \\ 5 & -4 \end{pmatrix}\begin{pmatrix} 2 & 1 \\ 1 & -1 \end{pmatrix} = \dfrac{1}{3}\begin{pmatrix} 12 & 3 \\ 6 & 9 \end{pmatrix} = \begin{pmatrix} 4 & 1 \\ 2 & 3 \end{pmatrix} = A.

Diagonalisation allows efficient computation of AnA^n:

An=PDnP1A^n = PD^n P^{-1}

Since DnD^n is the diagonal matrix with each eigenvalue raised to the power nn.


Find the inverse of A=(3152)A = \begin{pmatrix} 3 & 1 \\ 5 & 2 \end{pmatrix} and verify that AA1=IAA^{-1} = I.

Solution

detA=65=1\det A = 6 - 5 = 1.

A1=(2153)A^{-1} = \begin{pmatrix} 2 & -1 \\ -5 & 3 \end{pmatrix}.

AA1=(3152)(2153)=(1001)AA^{-1} = \begin{pmatrix} 3 & 1 \\ 5 & 2 \end{pmatrix}\begin{pmatrix} 2 & -1 \\ -5 & 3 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}. Verified.

Find the matrix representing a rotation of 6060^\circ anticlockwise about the origin.

Solution

cos60=0.5\cos 60^\circ = 0.5, sin60=3/2\sin 60^\circ = \sqrt{3}/2.

R=(0.53/23/20.5)R = \begin{pmatrix} 0.5 & -\sqrt{3}/2 \\ \sqrt{3}/2 & 0.5 \end{pmatrix}.

Find the eigenvalues and eigenvectors of (5221)\begin{pmatrix} 5 & -2 \\ 2 & 1 \end{pmatrix}.

Solution

Characteristic equation: (5λ)(1λ)+4=0(5 - \lambda)(1 - \lambda) + 4 = 0

λ26λ+9=0    (λ3)2=0\lambda^2 - 6\lambda + 9 = 0 \implies (\lambda - 3)^2 = 0

λ=3\lambda = 3 (repeated eigenvalue).

(2222)(xy)=0    x=y\begin{pmatrix} 2 & -2 \\ 2 & -2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = \mathbf{0} \implies x = y.

Only one independent eigenvector: (11)\begin{pmatrix} 1 \\ 1 \end{pmatrix}.

This matrix is not diagonalisable (only one eigenvector for a repeated eigenvalue).

Use the matrix (1210)\begin{pmatrix} 1 & 2 \\ 1 & 0 \end{pmatrix} to find a formula for the nn-th Fibonacci number.

Solution

Eigenvalues of AA: λ2λ2=0    λ=1±32\lambda^2 - \lambda - 2 = 0 \implies \lambda = \frac{1 \pm 3}{2} So λ1=2\lambda_1 = 2, λ2=1\lambda_2 = -1.

Eigenvectors: for λ=2\lambda = 2: (1,1)(1, 1); for λ=1\lambda = -1: (2,1)(-2, 1).

An=PDnP1A^n = P D^n P^{-1} where P=(1211)P = \begin{pmatrix} 1 & -2 \\ 1 & 1 \end{pmatrix} P1=13(1211)P^{-1} = \frac{1}{3}\begin{pmatrix} 1 & 2 \\ -1 & 1 \end{pmatrix}.

(Fn+1Fn)=An(10)\begin{pmatrix} F_{n+1} \\ F_n \end{pmatrix} = A^n\begin{pmatrix} 1 \\ 0 \end{pmatrix}.

This gives Fn=2n(1)n3F_n = \frac{2^n - (-1)^n}{3} (the Lucas sequence). For the standard Fibonacci sequence With A=(1110)A = \begin{pmatrix} 1 & 1 \\ 1 & 0 \end{pmatrix}The result is Fn=ϕnψn5F_n = \frac{\phi^n - \psi^n}{\sqrt{5}} where ϕ=1+52\phi = \frac{1+\sqrt{5}}{2}.


7.1 Proof: det(AB)=det(A)det(B)\det(AB) = \det(A)\det(B) for 2×22 \times 2 matrices

Section titled “7.1 Proof: det⁡(AB)=det⁡(A)det⁡(B)\det(AB) = \det(A)\det(B)det(AB)=det(A)det(B) for 2×22 \times 22×2 matrices”

Proof. Let A=(abcd)A = \begin{pmatrix} a & b \\ c & d \end{pmatrix} and B=(efgh)B = \begin{pmatrix} e & f \\ g & h \end{pmatrix}.

AB=(ae+bgaf+bhce+dgcf+dh)AB = \begin{pmatrix} ae + bg & af + bh \\ ce + dg & cf + dh \end{pmatrix}

det(AB)=(ae+bg)(cf+dh)(af+bh)(ce+dg)\det(AB) = (ae + bg)(cf + dh) - (af + bh)(ce + dg)

=acef+adeh+bcfg+bdghacefadfgbcehbdgh= acef + adeh + bcfg + bdgh - acef - adfg - bceh - bdgh

=adeh+bcfgadfgbceh= adeh + bcfg - adfg - bceh

=ad(ehfg)bc(ehfg)=(adbc)(ehfg)=det(A)det(B)= ad(eh - fg) - bc(eh - fg) = (ad - bc)(eh - fg) = \det(A)\det(B) \quad \blacksquare

7.2 Proof: det(A)0    A\det(A) \neq 0 \iff A is invertible

Section titled “7.2 Proof: det⁡(A)≠0  ⟺  A\det(A) \neq 0 \iff Adet(A)=0⟺A is invertible”

Proof. (\Rightarrow) If det(A)0\det(A) \neq 0The adjugate formula gives A1=1detAadj(A)A^{-1} = \dfrac{1}{\det A}\mathrm{adj}(A)So AA is invertible.

(\Leftarrow) If AA is invertible with A1A^{-1}Then det(A)det(A1)=det(AA1)=det(I)=1\det(A)\det(A^{-1}) = \det(AA^{-1}) = \det(I) = 1. Since 101 \neq 0We must have det(A)0\det(A) \neq 0. \blacksquare

7.3 Proof: the trace equals the sum of eigenvalues

Section titled “7.3 Proof: the trace equals the sum of eigenvalues”

Theorem. For any 2×22 \times 2 matrix AA, tr(A)=λ1+λ2\mathrm{tr}(A) = \lambda_1 + \lambda_2.

Proof. The characteristic equation is det(AλI)=λ2(a+d)λ+(adbc)=0\det(A - \lambda I) = \lambda^2 - (a + d)\lambda + (ad - bc) = 0.

By Vieta’s formulas, the sum of the roots is the negative coefficient of λ\lambda:

λ1+λ2=a+d=tr(A)\lambda_1 + \lambda_2 = a + d = \mathrm{tr}(A) \quad \blacksquare

7.4 Proof: area scale factor via determinant

Section titled “7.4 Proof: area scale factor via determinant”

Theorem. The linear transformation represented by a 2×22 \times 2 matrix AA scales areas by det(A)|\det(A)|.

Proof. The unit square with vertices 0,e1,e2,e1+e2\mathbf{0}, \mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_1 + \mathbf{e}_2 is mapped to a parallelogram With vertices 0,Ae1,Ae2,Ae1+Ae2\mathbf{0}, A\mathbf{e}_1, A\mathbf{e}_2, A\mathbf{e}_1 + A\mathbf{e}_2.

The area of this parallelogram is the magnitude of the cross product (in 2D, the determinant):

Area=det(abcd)=detA\text{Area} = \left|\det\begin{pmatrix} a & b \\ c & d \end{pmatrix}\right| = |\det A|

Any region can be tiled by infinitesimal parallelograms, so the general scale factor is detA|\det A|. \blacksquare