Quiz 2
Registry Synced

Matrix Representation of Linear Transformations

2252 words
11 min read

Reading compass

Now · 🎯 Learning Objectives

Matrix Representation of Linear Transformations

🎯 Learning Objectives

After this topic you will be able to:
  • Find the matrix of a linear transformation relative to given ordered bases
  • Compute the image of a vector using the matrix representation
  • Understand how the matrix changes when bases change
  • Compute change-of-basis matrices
  • Determine transition matrices between bases

📋 Prerequisites

  • Linear Transformations (Week 5) — definition and properties
  • Basis & Dimension (Week 4) — coordinates relative to a basis
  • Matrix Multiplication (Week 1) — matrices as linear maps

1. Intuition: Translating Between Languages

A linear transformation T:VWT: V \to W is an abstract map. To compute with it, we need to translate it into a matrix. But matrices are defined on Rn\mathbb{R}^n, not on abstract vector spaces like P2P_2. The solution: choose bases. A basis lets us:
  • Represent any vector vV\mathbf{v} \in V by its coordinate vector [v]BRn[\mathbf{v}]_B \in \mathbb{R}^n
  • Represent TT by a matrix MM so that [T(v)]C=M[v]B[T(\mathbf{v})]_C = M [\mathbf{v}]_B (Diagram)

2. Coordinates Relative to a Basis

2.1 Definition

If B={b1,,bn}B = \{\mathbf{b}_1, \dots, \mathbf{b}_n\} is an ordered basis of VV, then every vV\mathbf{v} \in V has a unique representation:
v=c1b1+c2b2++cnbn\mathbf{v} = c_1\mathbf{b}_1 + c_2\mathbf{b}_2 + \cdots + c_n\mathbf{b}_n
The coordinate vector of v\mathbf{v} relative to BB is:
[v]B=[c1c2cn]Rn[\mathbf{v}]_B = \begin{bmatrix} c_1 \\ c_2 \\ \vdots \\ c_n \end{bmatrix} \in \mathbb{R}^n
Example 1: Coordinates
B={1x,1+x,x2}B = \{1-x, 1+x, x^2\} is a basis for P2P_2.
For p(x)=3+x+2x2p(x) = 3 + x + 2x^2, find [p]B[p]_B.
Solve c1(1x)+c2(1+x)+c3x2=3+x+2x2c_1(1-x) + c_2(1+x) + c_3 x^2 = 3 + x + 2x^2. Group: (c1+c2)+(c1+c2)x+c3x2=3+x+2x2(c_1 + c_2) + (-c_1 + c_2)x + c_3 x^2 = 3 + x + 2x^2.
>{c1+c2=3c1+c2=1c3=2c1=1,c2=2,c3=2>> \begin{cases} c_1 + c_2 = 3 \\ -c_1 + c_2 = 1 \\ c_3 = 2 \end{cases} \Rightarrow c_1 = 1, c_2 = 2, c_3 = 2 >
>[p]B=[122]>> [p]_B = \begin{bmatrix} 1 \\ 2 \\ 2 \end{bmatrix} >
.

3. Matrix of a Linear Transformation

Definition (Matrix of TT). Let T:VWT: V \to W be linear, B={b1,,bn}B = \{\mathbf{b}_1, \dots, \mathbf{b}_n\} an ordered basis of VV, and C={c1,,cm}C = \{\mathbf{c}_1, \dots, \mathbf{c}_m\} an ordered basis of WW. The matrix of TT relative to BB and CC is:
>[T]CB=[[T(b1)]C[T(b2)]C[T(bn)]C]>> [T]_{C \leftarrow B} = \begin{bmatrix} | & | & & | \\ [T(\mathbf{b}_1)]_C & [T(\mathbf{b}_2)]_C & \dots & [T(\mathbf{b}_n)]_C \\ | & | & & | \end{bmatrix} >
It satisfies: [T(v)]C=[T]CB[v]B[T(\mathbf{v})]_C = [T]_{C \leftarrow B} [\mathbf{v}]_B.

3.1 Algorithm

  1. Compute T(bj)T(\mathbf{b}_j) for each basis vector bj\mathbf{b}_j of VV
  2. Express T(bj)T(\mathbf{b}_j) in the basis CC of WW to get [T(bj)]C[T(\mathbf{b}_j)]_C
  3. These coordinate vectors become the columns of [T]CB[T]_{C \leftarrow B}
Example 2: Matrix of a transformation
T:P2P1T: P_2 \to P_1, T(p)=pT(p) = p' (derivative). B={1,x,x2}B = \{1, x, x^2\} (basis for P2P_2) C={1,x}C = \{1, x\} (basis for P1P_1)
>T(1)=0=01+0x[T(1)]C=[00]>> T(1) = 0 = 0\cdot1 + 0\cdot x \Rightarrow [T(1)]_C = \begin{bmatrix}0\\0\end{bmatrix} >
>T(x)=1=11+0x[T(x)]C=[10]>> T(x) = 1 = 1\cdot1 + 0\cdot x \Rightarrow [T(x)]_C = \begin{bmatrix}1\\0\end{bmatrix} >
>T(x2)=2x=01+2x[T(x2)]C=[02]>> T(x^2) = 2x = 0\cdot1 + 2\cdot x \Rightarrow [T(x^2)]_C = \begin{bmatrix}0\\2\end{bmatrix} >
>[T]CB=[010002]>> [T]_{C \leftarrow B} = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 2 \end{bmatrix} >
Check: For p(x)=a+bx+cx2p(x) = a + bx + cx^2, p(x)=b+2cxp'(x) = b + 2cx. [p]B=(a,b,c)T[p]_B = (a,b,c)^T.
>[T][p]B=[b2c]>> [T] [p]_B = \begin{bmatrix} b \\ 2c \end{bmatrix} >
= [p]C[p']_CExample 3: Standard matrix = matrix relative to standard bases
T:R3R2T: \mathbb{R}^3 \to \mathbb{R}^2, T(x,y,z)=(2xy,x+3y+z)T(x,y,z) = (2x-y, x+3y+z). Using standard bases B={e1,e2,e3}B = \{\mathbf{e}_1,\mathbf{e}_2,\mathbf{e}_3\}, C={e1,e2}C = \{\mathbf{e}_1,\mathbf{e}_2\}:
>[T]CB=[210131]>> [T]_{C \leftarrow B} = \begin{bmatrix} 2 & -1 & 0 \\ 1 & 3 & 1 \end{bmatrix} >
(the standard matrix we found in Week 5).

4. Change of Basis

4.1 Change-of-Basis Matrix

If we have two bases BB and BB' of the same space VV, how are coordinates related?
Definition (Change-of-Basis Matrix). The change-of-basis matrix from BB to BB' is:
>PBB=[[b1]B[b2]B[bn]B]>> P_{B' \leftarrow B} = \begin{bmatrix} | & | & & | \\ [\mathbf{b}_1]_{B'} & [\mathbf{b}_2]_{B'} & \dots & [\mathbf{b}_n]_{B'} \\ | & | & & | \end{bmatrix} >
It satisfies: [v]B=PBB[v]B[\mathbf{v}]_{B'} = P_{B' \leftarrow B} [\mathbf{v}]_B. Key fact: PBB=(PBB)1P_{B' \leftarrow B} = (P_{B \leftarrow B'})^{-1}. Example 4: Change of basis in ℝ²
Standard basis S={e1,e2}S = \{\mathbf{e}_1, \mathbf{e}_2\}, new basis B={(1,2),(3,4)}B = \{(1,2), (3,4)\}. Find PBSP_{B \leftarrow S} (from standard to BB).
e1=(1,0)\mathbf{e}_1 = (1,0) in BB: solve c1(1,2)+c2(3,4)=(1,0)c_1(1,2) + c_2(3,4) = (1,0).
>{c1+3c2=12c1+4c2=0c1=2,c2=1>> \begin{cases} c_1 + 3c_2 = 1 \\ 2c_1 + 4c_2 = 0 \end{cases} \Rightarrow c_1 = -2, c_2 = 1 >
So
>[e1]B=[21]>> [\mathbf{e}_1]_B = \begin{bmatrix} -2 \\ 1 \end{bmatrix} >
.
Similarly, e2=(0,1)\mathbf{e}_2 = (0,1) in BB: solve c1(1,2)+c2(3,4)=(0,1)c_1(1,2) + c_2(3,4) = (0,1). c1=32,c2=12c_1 = \frac{3}{2}, c_2 = -\frac{1}{2}.
>[e2]B=[3/21/2]>> [\mathbf{e}_2]_B = \begin{bmatrix} 3/2 \\ -1/2 \end{bmatrix} >
.
>PBS=[23/211/2]>> P_{B \leftarrow S} = \begin{bmatrix} -2 & 3/2 \\ 1 & -1/2 \end{bmatrix} >
.

4.2 Effect on the Matrix of a Transformation

If T:VWT: V \to W has matrix [T]CB[T]_{C \leftarrow B} relative to bases B,CB, C, and we change to bases B,CB', C', then:
[T]CB=PCC  [T]CB  PBB[T]_{C' \leftarrow B'} = P_{C' \leftarrow C} \; [T]_{C \leftarrow B} \; P_{B \leftarrow B'}
where PCCP_{C' \leftarrow C} is the change-of-basis in WW and PBBP_{B \leftarrow B'} is the change-of-basis in VV. Special case: T:VVT: V \to V (operator) with B=BB = B' and C=C=BC = C' = B':
[T]B=P1[T]BP[T]_{B'} = P^{-1} [T]_B P
where P=PBBP = P_{B' \leftarrow B}. This is called a similarity transformation (Week 7).

5. Edge Cases & Gotchas

SituationWhat Happens
Same basis for domain and codomain[T]B=[T]BB[T]_B = [T]_{B \leftarrow B} is a square matrix
Standard basisMakes everything simpler — coordinates are just the vector itself
** V=WV = W but different bases**[T]BB[T]_{B' \leftarrow B} is possible

6. Common Pitfalls

❌ Pitfall 1: Wrong order in [T]CB[T]_{C \leftarrow B}

The notation means "from BB to CC". [T(v)]C=[T]CB[v]B[T(\mathbf{v})]_C = [T]_{C \leftarrow B} [\mathbf{v}]_B.

❌ Pitfall 2: Confusing change-of-basis direction

PBBP_{B' \leftarrow B} converts from BB to BB'. It's PBB[v]B=[v]BP_{B' \leftarrow B} [\mathbf{v}]_B = [\mathbf{v}]_{B'}.

❌ Pitfall 3: Forgetting to convert the output basis

After computing [T][v]B[T] [\mathbf{v}]_B, the result is [T(v)]C[T(\mathbf{v})]_C, not T(v)T(\mathbf{v}) directly. Convert back using basis CC.

7. Formula Summary Table

ConceptFormula
**Matrix of TT **[T]CB=[[T(b1)]C    [T(bn)]C][T]_{C \leftarrow B} = [[T(\mathbf{b}_1)]_C \; \dots \; [T(\mathbf{b}_n)]_C]
Coordinate transformation[T(v)]C=[T]CB[v]B[T(\mathbf{v})]_C = [T]_{C \leftarrow B} [\mathbf{v}]_B
Change-of-basisPBB=[[b1]B    [bn]B]P_{B' \leftarrow B} = [[\mathbf{b}_1]_{B'} \; \dots \; [\mathbf{b}_n]_{B'}]
Inverse relationshipPBB=(PBB)1P_{B \leftarrow B'} = (P_{B' \leftarrow B})^{-1}
**Change of bases for TT **[T]CB=PCC[T]CBPBB[T]_{C' \leftarrow B'} = P_{C' \leftarrow C} [T]_{C \leftarrow B} P_{B \leftarrow B'}

8. 📝 Practice Questions

Q1: Matrix relative to non-standard bases
T:R2R2T: \mathbb{R}^2 \to \mathbb{R}^2, T(x,y)=(x+2y,3x+4y)T(x,y) = (x+2y, 3x+4y). B={(1,1),(1,1)}B = \{(1,1), (1,-1)\}, C={(1,0),(0,1)}C = \{(1,0), (0,1)\}. Find [T]CB[T]_{C \leftarrow B}.
Solution: T(1,1)=(3,7)T(1,1) = (3,7), [T(1,1)]C=(3,7)[T(1,1)]_C = (3,7) (standard basis). T(1,1)=(1,1)T(1,-1) = (-1,-1), [T(1,1)]C=(1,1)[T(1,-1)]_C = (-1,-1).
>[T]CB=[3171]>> [T]_{C \leftarrow B} = \begin{bmatrix} 3 & -1 \\ 7 & -1 \end{bmatrix} >
. Q2: Matrix of a derivative operator with different bases
T:P2P1T: P_2 \to P_1, T(p)=pT(p) = p'. B={1,1+x,x+x2}B = \{1, 1+x, x+x^2\}, C={1,x}C = \{1, x\}. Find [T]CB[T]_{C \leftarrow B}.
Solution: T(1)=0T(1) = 0, [T(1)]C=(0,0)[T(1)]_C = (0,0). T(1+x)=1T(1+x) = 1, [T(1+x)]C=(1,0)[T(1+x)]_C = (1,0). T(x+x2)=1+2xT(x+x^2) = 1+2x, [T(x+x2)]C=(1,2)[T(x+x^2)]_C = (1,2).
>[T]CB=[011002]>> [T]_{C \leftarrow B} = \begin{bmatrix} 0 & 1 & 1 \\ 0 & 0 & 2 \end{bmatrix} >
. Q3: Change of basis
Find PBSP_{B \leftarrow S} where B={(1,0,0),(1,1,0),(1,1,1)}B = \{(1,0,0), (1,1,0), (1,1,1)\}, SS = standard basis.
Solution: e1=1(1,0,0)\mathbf{e}_1 = 1\cdot(1,0,0), so [e1]B=(1,0,0)[\mathbf{e}_1]_B = (1,0,0). e2=(1,0,0)+1(1,1,0)\mathbf{e}_2 = -(1,0,0) + 1\cdot(1,1,0), so [e2]B=(1,1,0)[\mathbf{e}_2]_B = (-1,1,0). e3=0(1,0,0)+(1)(1,1,0)+1(1,1,1)\mathbf{e}_3 = 0\cdot(1,0,0) + (-1)(1,1,0) + 1\cdot(1,1,1), so [e3]B=(0,1,1)[\mathbf{e}_3]_B = (0,-1,1).
>PBS=[110011001]>> P_{B \leftarrow S} = \begin{bmatrix} 1 & -1 & 0 \\ 0 & 1 & -1 \\ 0 & 0 & 1 \end{bmatrix} >
. Q4: Using the matrix to compute
Using [T]CB[T]_{C \leftarrow B} from Q1, find T(2,3)T(2,3).
Solution: Find [(2,3)]B[(2,3)]_B: solve c1(1,1)+c2(1,1)=(2,3)c_1(1,1)+c_2(1,-1) = (2,3)c1+c2=2c_1+c_2=2, c1c2=3c_1-c_2=3c1=2.5c_1=2.5, c2=0.5c_2=-0.5.
>[(2,3)]B=[2.50.5]>> [(2,3)]_B = \begin{bmatrix}2.5 \\ -0.5\end{bmatrix} >
.
>[T(2,3)]C=[T]CB[(2,3)]B=[3171][2.50.5]=[7.5+0.517.5+0.5]=[818]>> [T(2,3)]_C = [T]_{C \leftarrow B} [(2,3)]_B = \begin{bmatrix} 3 & -1 \\ 7 & -1 \end{bmatrix} \begin{bmatrix}2.5 \\ -0.5\end{bmatrix} = \begin{bmatrix} 7.5+0.5 \\ 17.5+0.5 \end{bmatrix} = \begin{bmatrix} 8 \\ 18 \end{bmatrix} >
.
T(2,3)=(8,18)T(2,3) = (8,18) (in standard coordinates). Check directly: T(2,3)=(2+6,6+12)=(8,18)T(2,3) = (2+6, 6+12) = (8,18)Q5: Similarity transformation
T:R2R2T: \mathbb{R}^2 \to \mathbb{R}^2 has matrix
>A=[1234]>> A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} >
in standard basis. Find [T]B[T]_B for B={(1,1),(1,1)}B = \{(1,1), (1,-1)\}.
Solution: [T]B=P1AP[T]_B = P^{-1} A P where P=PBSP = P_{B \leftarrow S}.
>P=[1111]>> P = \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} >
(columns are basis vectors).
>P1=12[1111]=[1/21/21/21/2]>> P^{-1} = \frac{1}{-2} \begin{bmatrix} -1 & -1 \\ -1 & 1 \end{bmatrix} = \begin{bmatrix} 1/2 & 1/2 \\ 1/2 & -1/2 \end{bmatrix} >
.
>[T]B=P1AP=[1/21/21/21/2][1234][1111]>> [T]_B = P^{-1}AP = \begin{bmatrix} 1/2 & 1/2 \\ 1/2 & -1/2 \end{bmatrix} \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} >
>=[2311][1111]=[5120]>> = \begin{bmatrix} 2 & 3 \\ -1 & -1 \end{bmatrix} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} = \begin{bmatrix} 5 & -1 \\ -2 & 0 \end{bmatrix} >
. Q6: Finding transition matrix
B={(1,0),(1,1)}B = \{(1,0), (1,1)\}, B={(2,1),(1,2)}B' = \{(2,1), (1,2)\}. Find PBBP_{B' \leftarrow B}.
Solution: For each vector in BB, find coordinates in BB'.
(1,0)=c1(2,1)+c2(1,2)(1,0) = c_1(2,1) + c_2(1,2): 2c1+c2=12c_1 + c_2 = 1, c1+2c2=0c_1 + 2c_2 = 0c2=13c_2 = -\frac{1}{3}, c1=23c_1 = \frac{2}{3}.
>[(1,0)]B=[2/31/3]>> [(1,0)]_{B'} = \begin{bmatrix} 2/3 \\ -1/3 \end{bmatrix} >
.
(1,1)=c1(2,1)+c2(1,2)(1,1) = c_1(2,1) + c_2(1,2): 2c1+c2=12c_1 + c_2 = 1, c1+2c2=1c_1 + 2c_2 = 1c1=13c_1 = \frac{1}{3}, c2=13c_2 = \frac{1}{3}.
>[(1,1)]B=[1/31/3]>> [(1,1)]_{B'} = \begin{bmatrix} 1/3 \\ 1/3 \end{bmatrix} >
.
>PBB=[2/31/31/31/3]>> P_{B' \leftarrow B} = \begin{bmatrix} 2/3 & 1/3 \\ -1/3 & 1/3 \end{bmatrix} >
. Q7: Matrix of identity
What is [I]CB[I]_{C \leftarrow B} where I:VVI: V \to V is the identity map?
Solution: I(bj)=bjI(\mathbf{b}_j) = \mathbf{b}_j. So [I]CB[I]_{C \leftarrow B} has columns [bj]C[\mathbf{b}_j]_C. This is exactly the change-of-basis matrix PCBP_{C \leftarrow B}! Q8: Composition
T:VWT: V \to W, S:WUS: W \to U are linear. Prove [ST]DB=[S]DC[T]CB[S \circ T]_{D \leftarrow B} = [S]_{D \leftarrow C} [T]_{C \leftarrow B}.
Proof: For any vV\mathbf{v} \in V: [(ST)(v)]D=[S(T(v))]D=[S]DC[T(v)]C=[S]DC[T]CB[v]B[(S \circ T)(\mathbf{v})]_D = [S(T(\mathbf{v}))]_D = [S]_{D \leftarrow C} [T(\mathbf{v})]_C = [S]_{D \leftarrow C} [T]_{C \leftarrow B} [\mathbf{v}]_B.
So [ST]DB=[S]DC[T]CB[S \circ T]_{D \leftarrow B} = [S]_{D \leftarrow C} [T]_{C \leftarrow B}. ✓ Q9: Matrix of a projection
T:R3R3T: \mathbb{R}^3 \to \mathbb{R}^3, T(x,y,z)=(x,y,0)T(x,y,z) = (x,y,0). Find [T]B[T]_B where B={(1,0,0),(1,1,0),(1,1,1)}B = \{(1,0,0), (1,1,0), (1,1,1)\}.
Solution: T(1,0,0)=(1,0,0)T(1,0,0) = (1,0,0). In BB: solve (1,0,0)=c1(1,0,0)+c2(1,1,0)+c3(1,1,1)(1,0,0) = c_1(1,0,0)+c_2(1,1,0)+c_3(1,1,1)c1=1c_1=1, c2=0c_2=0, c3=0c_3=0. [T(1,0,0)]B=(1,0,0)[T(1,0,0)]_B = (1,0,0).
T(1,1,0)=(1,1,0)T(1,1,0) = (1,1,0) = 0(1,0,0)+1(1,1,0)+0(1,1,1)0(1,0,0)+1(1,1,0)+0(1,1,1). [(1,1,0)]B=(0,1,0)[(1,1,0)]_B = (0,1,0).
T(1,1,1)=(1,1,0)T(1,1,1) = (1,1,0) = 0(1,0,0)+1(1,1,0)+0(1,1,1)0(1,0,0)+1(1,1,0)+0(1,1,1). [(1,1,1)]B=(0,1,0)[(1,1,1)]_B = (0,1,0).
>[T]B=[100011000]>> [T]_B = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{bmatrix} >
. Q10: Going back and forth
If
>[T]CB=[1234]>> [T]_{C \leftarrow B} = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} >
and
>[v]B=[56]>> [\mathbf{v}]_B = \begin{bmatrix} 5 \\ 6 \end{bmatrix} >
, find [T(v)]C[T(\mathbf{v})]_C.
Solution:
>[T(v)]C=[T]CB[v]B=[1234][56]=[1739]>> [T(\mathbf{v})]_C = [T]_{C \leftarrow B} [\mathbf{v}]_B = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 5 \\ 6 \end{bmatrix} = \begin{bmatrix} 17 \\ 39 \end{bmatrix} >
.

🔗 Cross-References

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.