Matrix Representation of Linear Transformations
2252 words
11 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# 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 - Comput...

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:VโW is an abstract map. To compute with it, we need to translate it into a matrix. But matrices are defined on Rn, not on abstract vector spaces like P2โ.
The solution: choose bases. A basis lets us:
- Represent any vector vโV by its coordinate vector [v]BโโRn
- Represent T by a matrix M so that [T(v)]Cโ=M[v]Bโ (Diagram)
2. Coordinates Relative to a Basis
2.1 Definition
If B={b1โ,โฆ,bnโ} is an ordered basis of V, then every vโV has a unique representation:
The coordinate vector of v relative to B is:
>โฉโจโงโc1โ+c2โ=3โc1โ+c2โ=1c3โ=2โโc1โ=1,c2โ=2,c3โ=2>Example 1: CoordinatesB={1โx,1+x,x2} is a basis for P2โ.For p(x)=3+x+2x2, find [p]Bโ.Solve c1โ(1โx)+c2โ(1+x)+c3โx2=3+x+2x2. Group: (c1โ+c2โ)+(โc1โ+c2โ)x+c3โx2=3+x+2x2.
>[p]Bโ=โ122โโ>
.
3. Matrix of a Linear Transformation
>[T]CโBโ=โโฃ[T(b1โ)]Cโโฃโโฃ[T(b2โ)]Cโโฃโโฆโโฃ[T(bnโ)]Cโโฃโโ>Definition (Matrix of T). Let T:VโW be linear, B={b1โ,โฆ,bnโ} an ordered basis of V, and C={c1โ,โฆ,cmโ} an ordered basis of W. The matrix of T relative to B and C is:
It satisfies: [T(v)]Cโ=[T]CโBโ[v]Bโ.
3.1 Algorithm
- Compute T(bjโ) for each basis vector bjโ of V
- Express T(bjโ) in the basis C of W to get [T(bjโ)]Cโ
- These coordinate vectors become the columns of [T]CโBโ
>T(1)=0=0โ 1+0โ xโ[T(1)]Cโ=[00โ]>Example 2: Matrix of a transformationT:P2โโP1โ, T(p)=pโฒ (derivative). B={1,x,x2} (basis for P2โ) C={1,x} (basis for P1โ)
>T(x)=1=1โ 1+0โ xโ[T(x)]Cโ=[10โ]>
>T(x2)=2x=0โ 1+2โ xโ[T(x2)]Cโ=[02โ]>
>[T]CโBโ=[00โ10โ02โ]>
>[T][p]Bโ=[b2cโ]>Check: For p(x)=a+bx+cx2, pโฒ(x)=b+2cx. [p]Bโ=(a,b,c)T.
>[T]CโBโ=[21โโ13โ01โ]>= [pโฒ]Cโ โ Example 3: Standard matrix = matrix relative to standard basesT:R3โR2, T(x,y,z)=(2xโy,x+3y+z). Using standard bases B={e1โ,e2โ,e3โ}, C={e1โ,e2โ}:
(the standard matrix we found in Week 5).
4. Change of Basis
4.1 Change-of-Basis Matrix
If we have two bases B and Bโฒ of the same space V, how are coordinates related?
>PBโฒโBโ=โโฃ[b1โ]Bโฒโโฃโโฃ[b2โ]Bโฒโโฃโโฆโโฃ[bnโ]Bโฒโโฃโโ>Definition (Change-of-Basis Matrix). The change-of-basis matrix from B to Bโฒ is:
>{c1โ+3c2โ=12c1โ+4c2โ=0โโc1โ=โ2,c2โ=1>It satisfies: [v]Bโฒโ=PBโฒโBโ[v]Bโ. Key fact: PBโฒโBโ=(PBโBโฒโ)โ1. Example 4: Change of basis in โยฒStandard basis S={e1โ,e2โ}, new basis B={(1,2),(3,4)}. Find PBโSโ (from standard to B).e1โ=(1,0) in B: solve c1โ(1,2)+c2โ(3,4)=(1,0).
>[e1โ]Bโ=[โ21โ]>So
>[e2โ]Bโ=[3/2โ1/2โ]>.Similarly, e2โ=(0,1) in B: solve c1โ(1,2)+c2โ(3,4)=(0,1). c1โ=23โ,c2โ=โ21โ.
>PBโSโ=[โ21โ3/2โ1/2โ]>.
.
4.2 Effect on the Matrix of a Transformation
If T:VโW has matrix [T]CโBโ relative to bases B,C, and we change to bases Bโฒ,Cโฒ, then:
where PCโฒโCโ is the change-of-basis in W and PBโBโฒโ is the change-of-basis in V.
Special case: T:VโV (operator) with B=Bโฒ and C=Cโฒ=Bโฒ:
where P=PBโฒโBโ. This is called a similarity transformation (Week 7).
5. Edge Cases & Gotchas
| Situation | What Happens |
|---|---|
| Same basis for domain and codomain | [T]Bโ=[T]BโBโ is a square matrix |
| Standard basis | Makes everything simpler โ coordinates are just the vector itself |
| ** V=W but different bases** | [T]BโฒโBโ is possible |
6. Common Pitfalls
โ Pitfall 1: Wrong order in [T]CโBโ
The notation means "from B to C". [T(v)]Cโ=[T]CโBโ[v]Bโ.
โ Pitfall 2: Confusing change-of-basis direction
PBโฒโBโ converts from B to Bโฒ. It's PBโฒโBโ[v]Bโ=[v]Bโฒโ.
โ Pitfall 3: Forgetting to convert the output basis
After computing [T][v]Bโ, the result is [T(v)]Cโ, not T(v) directly. Convert back using basis C.
7. Formula Summary Table
| Concept | Formula |
|---|---|
| **Matrix of T ** | [T]CโBโ=[[T(b1โ)]Cโโฆ[T(bnโ)]Cโ] |
| Coordinate transformation | [T(v)]Cโ=[T]CโBโ[v]Bโ |
| Change-of-basis | PBโฒโBโ=[[b1โ]Bโฒโโฆ[bnโ]Bโฒโ] |
| Inverse relationship | PBโBโฒโ=(PBโฒโBโ)โ1 |
| **Change of bases for T ** | [T]CโฒโBโฒโ=PCโฒโCโ[T]CโBโPBโBโฒโ |
8. ๐ Practice Questions
>[T]CโBโ=[37โโ1โ1โ]>Q1: Matrix relative to non-standard basesT:R2โR2, T(x,y)=(x+2y,3x+4y). B={(1,1),(1,โ1)}, C={(1,0),(0,1)}. Find [T]CโBโ.Solution: T(1,1)=(3,7), [T(1,1)]Cโ=(3,7) (standard basis). T(1,โ1)=(โ1,โ1), [T(1,โ1)]Cโ=(โ1,โ1).
>[T]CโBโ=[00โ10โ12โ]>. Q2: Matrix of a derivative operator with different basesT:P2โโP1โ, T(p)=pโฒ. B={1,1+x,x+x2}, C={1,x}. Find [T]CโBโ.Solution: T(1)=0, [T(1)]Cโ=(0,0). T(1+x)=1, [T(1+x)]Cโ=(1,0). T(x+x2)=1+2x, [T(x+x2)]Cโ=(1,2).
>PBโSโ=โ100โโ110โ0โ11โโ>. Q3: Change of basisFind PBโSโ where B={(1,0,0),(1,1,0),(1,1,1)}, S = standard basis.Solution: e1โ=1โ (1,0,0), so [e1โ]Bโ=(1,0,0). e2โ=โ(1,0,0)+1โ (1,1,0), so [e2โ]Bโ=(โ1,1,0). e3โ=0โ (1,0,0)+(โ1)(1,1,0)+1โ (1,1,1), so [e3โ]Bโ=(0,โ1,1).
>[(2,3)]Bโ=[2.5โ0.5โ]>. Q4: Using the matrix to computeUsing [T]CโBโ from Q1, find T(2,3).Solution: Find [(2,3)]Bโ: solve c1โ(1,1)+c2โ(1,โ1)=(2,3) โ c1โ+c2โ=2, c1โโc2โ=3 โ c1โ=2.5, c2โ=โ0.5.
>[T(2,3)]Cโ=[T]CโBโ[(2,3)]Bโ=[37โโ1โ1โ][2.5โ0.5โ]=[7.5+0.517.5+0.5โ]=[818โ]>.
>A=[13โ24โ]>.T(2,3)=(8,18) (in standard coordinates). Check directly: T(2,3)=(2+6,6+12)=(8,18) โ Q5: Similarity transformationT:R2โR2 has matrix
>P=[11โ1โ1โ]>in standard basis. Find [T]Bโ for B={(1,1),(1,โ1)}.Solution: [T]Bโ=Pโ1AP where P=PBโSโ.
>Pโ1=โ21โ[โ1โ1โโ11โ]=[1/21/2โ1/2โ1/2โ]>(columns are basis vectors).
>[T]Bโ=Pโ1AP=[1/21/2โ1/2โ1/2โ][13โ24โ][11โ1โ1โ]>.
>=[2โ1โ3โ1โ][11โ1โ1โ]=[5โ2โโ10โ]>
>[(1,0)]Bโฒโ=[2/3โ1/3โ]>. Q6: Finding transition matrixB={(1,0),(1,1)}, Bโฒ={(2,1),(1,2)}. Find PBโฒโBโ.Solution: For each vector in B, find coordinates in Bโฒ.(1,0)=c1โ(2,1)+c2โ(1,2): 2c1โ+c2โ=1, c1โ+2c2โ=0 โ c2โ=โ31โ, c1โ=32โ.
>[(1,1)]Bโฒโ=[1/31/3โ]>.(1,1)=c1โ(2,1)+c2โ(1,2): 2c1โ+c2โ=1, c1โ+2c2โ=1 โ c1โ=31โ, c2โ=31โ.
>PBโฒโBโ=[2/3โ1/3โ1/31/3โ]>.
>[T]Bโ=โ100โ010โ010โโ>. Q7: Matrix of identityWhat is [I]CโBโ where I:VโV is the identity map?Solution: I(bjโ)=bjโ. So [I]CโBโ has columns [bjโ]Cโ. This is exactly the change-of-basis matrix PCโBโ! Q8: CompositionT:VโW, S:WโU are linear. Prove [SโT]DโBโ=[S]DโCโ[T]CโBโ.Proof: For any vโV: [(SโT)(v)]Dโ=[S(T(v))]Dโ=[S]DโCโ[T(v)]Cโ=[S]DโCโ[T]CโBโ[v]Bโ.So [SโT]DโBโ=[S]DโCโ[T]CโBโ. โ Q9: Matrix of a projectionT:R3โR3, T(x,y,z)=(x,y,0). Find [T]Bโ where B={(1,0,0),(1,1,0),(1,1,1)}.Solution: T(1,0,0)=(1,0,0). In B: solve (1,0,0)=c1โ(1,0,0)+c2โ(1,1,0)+c3โ(1,1,1) โ c1โ=1, c2โ=0, c3โ=0. [T(1,0,0)]Bโ=(1,0,0).T(1,1,0)=(1,1,0) = 0(1,0,0)+1(1,1,0)+0(1,1,1). [(1,1,0)]Bโ=(0,1,0).T(1,1,1)=(1,1,0) = 0(1,0,0)+1(1,1,0)+0(1,1,1). [(1,1,1)]Bโ=(0,1,0).
>[T]CโBโ=[13โ24โ]>. Q10: Going back and forthIf
>[v]Bโ=[56โ]>and
>[T(v)]Cโ=[T]CโBโ[v]Bโ=[13โ24โ][56โ]=[1739โ]>, find [T(v)]Cโ.Solution:
.
๐ Cross-References
- Next topic: Equivalent & Similar Matrices
- Week 7 (Similarity): A and Pโ1AP represent the same operator in different bases
- Week 8 (Orthogonal Transformations): Orthogonal matrices represent rotations/reflections
- BSCS3004 (Deep Learning): Weight matrices in neural networks are linear transformations between feature spaces Join Discord Previous6.1 Kernel & ImageNext7.1 Equivalent & Similar Matrices