Skip to content

Chapter 34. Matrix Representation of Linear Maps

A linear map can be studied abstractly as a function between vector spaces. It can also be studied concretely as a matrix. The connection between these two descriptions is one of the main bridges in linear algebra.

If VV and WW are finite-dimensional vector spaces over the same field FF, and

T:VW T:V\to W

is linear, then TT can be represented by a matrix after bases are chosen for VV and WW. The matrix stores the coordinates of the images of the basis vectors of VV. In the standard coordinate spaces, a linear transformation T:RnRmT:\mathbb{R}^n\to\mathbb{R}^m has an m×nm\times n matrix AA such that T(x)=AxT(x)=Ax. The columns of AA are the images of the standard basis vectors.

34.1 The Basic Idea

A linear map is determined by what it does to a basis.

Let

B=(v1,v2,,vn) B=(v_1,v_2,\ldots,v_n)

be a basis of VV. Every vector vVv\in V can be written uniquely as

v=c1v1+c2v2++cnvn. v=c_1v_1+c_2v_2+\cdots+c_nv_n.

If T:VWT:V\to W is linear, then

T(v)=c1T(v1)+c2T(v2)++cnT(vn). T(v)=c_1T(v_1)+c_2T(v_2)+\cdots+c_nT(v_n).

Thus, to know T(v)T(v) for every vv, it is enough to know

T(v1),T(v2),,T(vn). T(v_1),T(v_2),\ldots,T(v_n).

A matrix representation is a compact way to store these output vectors.

34.2 Standard Matrix Representation

Consider a linear transformation

T:RnRm. T:\mathbb{R}^n\to\mathbb{R}^m.

Let

e1,e2,,en e_1,e_2,\ldots,e_n

be the standard basis of Rn\mathbb{R}^n. The standard matrix of TT is the m×nm\times n matrix

A=[T(e1)T(e2)T(en)]. A= \begin{bmatrix} | & | & & |\\ T(e_1) & T(e_2) & \cdots & T(e_n)\\ | & | & & | \end{bmatrix}.

That is, the first column of AA is T(e1)T(e_1), the second column is T(e2)T(e_2), and so on.

Then, for every

x=[x1x2xn], x= \begin{bmatrix} x_1\\ x_2\\ \vdots\\ x_n \end{bmatrix},

we have

x=x1e1+x2e2++xnen. x=x_1e_1+x_2e_2+\cdots+x_ne_n.

By linearity,

T(x)=x1T(e1)+x2T(e2)++xnT(en). T(x)=x_1T(e_1)+x_2T(e_2)+\cdots+x_nT(e_n).

But this is exactly matrix multiplication:

T(x)=Ax. T(x)=Ax.

So a linear transformation on coordinate space is the same data as a matrix.

34.3 Example in R2\mathbb{R}^2

Define

T:R2R2 T:\mathbb{R}^2\to\mathbb{R}^2

by

T[xy]=[2x+y3xy]. T \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 2x+y\\ 3x-y \end{bmatrix}.

The standard basis vectors are

e1=[10],e2=[01]. e_1= \begin{bmatrix} 1\\ 0 \end{bmatrix}, \qquad e_2= \begin{bmatrix} 0\\ 1 \end{bmatrix}.

Compute their images:

T(e1)=T[10]=[23], T(e_1) = T \begin{bmatrix} 1\\ 0 \end{bmatrix} = \begin{bmatrix} 2\\ 3 \end{bmatrix},

and

T(e2)=T[01]=[11]. T(e_2) = T \begin{bmatrix} 0\\ 1 \end{bmatrix} = \begin{bmatrix} 1\\ -1 \end{bmatrix}.

Therefore the standard matrix of TT is

A=[2131]. A= \begin{bmatrix} 2 & 1\\ 3 & -1 \end{bmatrix}.

Indeed,

A[xy]=[2131][xy]=[2x+y3xy]. A \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 2 & 1\\ 3 & -1 \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} 2x+y\\ 3x-y \end{bmatrix}.

This agrees with the original definition of TT.

34.4 Matrix Size

The size of the representing matrix is determined by the dimensions of the domain and codomain.

If

T:RnRm, T:\mathbb{R}^n\to\mathbb{R}^m,

then the matrix of TT has mm rows and nn columns.

The number of columns equals the number of input coordinates. The number of rows equals the number of output coordinates.

Thus:

Linear mapMatrix size
T:R2R2T:\mathbb{R}^2\to\mathbb{R}^22×22\times 2
T:R3R2T:\mathbb{R}^3\to\mathbb{R}^22×32\times 3
T:R2R4T:\mathbb{R}^2\to\mathbb{R}^44×24\times 2
T:RnRmT:\mathbb{R}^n\to\mathbb{R}^mm×nm\times n

This convention matches matrix-vector multiplication:

(m×n)(n×1)=(m×1). (m\times n)(n\times 1)=(m\times 1).

The input vector has nn entries, and the output vector has mm entries.

34.5 From Matrix to Linear Map

Every m×nm\times n matrix defines a linear map.

Let

AFm×n. A\in F^{m\times n}.

Define

TA:FnFm T_A:F^n\to F^m

by

TA(x)=Ax. T_A(x)=Ax.

Then TAT_A is linear. For vectors u,vFnu,v\in F^n and scalar cFc\in F,

TA(u+v)=A(u+v)=Au+Av=TA(u)+TA(v), T_A(u+v)=A(u+v)=Au+Av=T_A(u)+T_A(v),

and

TA(cu)=A(cu)=cAu=cTA(u). T_A(cu)=A(cu)=cAu=cT_A(u).

Thus matrices and linear maps between coordinate spaces are equivalent descriptions.

The matrix is the data. The linear map is the action.

34.6 From Linear Map to Matrix

Every linear map between finite-dimensional coordinate spaces gives a matrix.

Let

T:FnFm T:F^n\to F^m

be linear. Let e1,,ene_1,\ldots,e_n be the standard basis of FnF^n. Define

A=[T(e1)T(e2)T(en)]. A= \begin{bmatrix} | & | & & |\\ T(e_1) & T(e_2) & \cdots & T(e_n)\\ | & | & & | \end{bmatrix}.

Then

T(x)=Ax T(x)=Ax

for every xFnx\in F^n.

This construction is unique. If another matrix BB satisfies

T(x)=Bx T(x)=Bx

for every xx, then in particular

T(ej)=Bej T(e_j)=Be_j

for each jj. But BejBe_j is the jj-th column of BB. Hence every column of BB equals the corresponding column of AA. Therefore

B=A. B=A.

So a linear transformation between coordinate spaces has one and only one standard matrix.

34.7 Coordinates Relative to a Basis

The previous sections used the standard basis. For abstract vector spaces, or for nonstandard coordinate systems, we must use coordinates relative to chosen bases.

Let

B=(v1,v2,,vn) B=(v_1,v_2,\ldots,v_n)

be an ordered basis of VV. If

v=c1v1+c2v2++cnvn, v=c_1v_1+c_2v_2+\cdots+c_nv_n,

then the coordinate vector of vv relative to BB is

[v]B=[c1c2cn]. [v]_B= \begin{bmatrix} c_1\\ c_2\\ \vdots\\ c_n \end{bmatrix}.

The order of the basis matters. Changing the order changes the coordinate vector.

For example, in R2\mathbb{R}^2, let

B=([11],[11]). B=\left( \begin{bmatrix} 1\\ 1 \end{bmatrix}, \begin{bmatrix} 1\\ -1 \end{bmatrix} \right).

If

v=[31], v= \begin{bmatrix} 3\\ 1 \end{bmatrix},

then we solve

[31]=c1[11]+c2[11]. \begin{bmatrix} 3\\ 1 \end{bmatrix} = c_1 \begin{bmatrix} 1\\ 1 \end{bmatrix} + c_2 \begin{bmatrix} 1\\ -1 \end{bmatrix}.

This gives

c1+c2=3,c1c2=1. c_1+c_2=3, \qquad c_1-c_2=1.

Solving,

c1=2,c2=1. c_1=2, \qquad c_2=1.

Therefore

[v]B=[21]. [v]_B= \begin{bmatrix} 2\\ 1 \end{bmatrix}.

34.8 Matrix of a Linear Map Relative to Bases

Let

T:VW T:V\to W

be linear. Let

B=(v1,,vn) B=(v_1,\ldots,v_n)

be an ordered basis of VV, and let

C=(w1,,wm) C=(w_1,\ldots,w_m)

be an ordered basis of WW.

The matrix of TT relative to BB and CC is the m×nm\times n matrix whose jj-th column is the coordinate vector of T(vj)T(v_j) in the basis CC:

[T]CB=[[T(v1)]C[T(v2)]C[T(vn)]C]. [T]_{C\leftarrow B} = \begin{bmatrix} | & | & & |\\ [T(v_1)]_C & [T(v_2)]_C & \cdots & [T(v_n)]_C\\ | & | & & | \end{bmatrix}.

The notation CBC\leftarrow B means that inputs are written in basis BB, and outputs are written in basis CC.

The defining relation is

[T(v)]C=[T]CB[v]B. [T(v)]_C=[T]_{C\leftarrow B}[v]_B.

This equation is the coordinate form of the linear map.

34.9 Example with Nonstandard Bases

Let

T:R2R2 T:\mathbb{R}^2\to\mathbb{R}^2

be defined by

T[xy]=[x+yxy]. T \begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} x+y\\ x-y \end{bmatrix}.

Let the domain basis be

B=([11],[11]), B= \left( \begin{bmatrix} 1\\ 1 \end{bmatrix}, \begin{bmatrix} 1\\ -1 \end{bmatrix} \right),

and let the codomain basis be the standard basis

E=(e1,e2). E=(e_1,e_2).

Compute the images of the basis vectors:

T[11]=[20], T \begin{bmatrix} 1\\ 1 \end{bmatrix} = \begin{bmatrix} 2\\ 0 \end{bmatrix},

and

T[11]=[02]. T \begin{bmatrix} 1\\ -1 \end{bmatrix} = \begin{bmatrix} 0\\ 2 \end{bmatrix}.

Since EE is the standard basis, these are already their coordinate vectors in EE. Therefore

[T]EB=[2002]. [T]_{E\leftarrow B} = \begin{bmatrix} 2 & 0\\ 0 & 2 \end{bmatrix}.

With respect to this input basis, the transformation looks like simple scaling by 22.

This illustrates an important point: the same linear map can have different matrices under different choices of bases.

34.10 The Same Map, Different Matrices

The matrix is not the transformation itself. It is the coordinate description of the transformation.

A linear map T:VWT:V\to W exists independently of coordinates. To write it as a matrix, we choose a basis for VV and a basis for WW. Different choices may produce different matrices.

For example, a rotation or reflection in the plane has a familiar standard matrix. But if we describe the plane using a different basis, the entries of the matrix change.

The transformation remains the same. Only its coordinate representation changes.

This distinction prevents a common error: two different matrices may represent the same linear map in different bases, and the same matrix may represent different maps when different bases are being used.

34.11 Change-of-Coordinates Matrices

Let

B=(v1,,vn) B=(v_1,\ldots,v_n)

be a basis of FnF^n. The change-of-coordinates matrix from BB-coordinates to standard coordinates is

PB=[v1v2vn]. P_B= \begin{bmatrix} | & | & & |\\ v_1 & v_2 & \cdots & v_n\\ | & | & & | \end{bmatrix}.

If xx is a vector in FnF^n, then

x=PB[x]B. x=P_B[x]_B.

Thus PBP_B converts coordinates in basis BB into standard coordinates.

Since BB is a basis, PBP_B is invertible. Therefore

[x]B=PB1x. [x]_B=P_B^{-1}x.

The inverse matrix converts standard coordinates into BB-coordinates.

34.12 Matrix Relative to Domain and Codomain Bases

Suppose T:FnFmT:F^n\to F^m has standard matrix AA. Let BB be a basis of FnF^n, and let CC be a basis of FmF^m.

Let PBP_B be the matrix with columns equal to the basis vectors in BB, and let PCP_C be the matrix with columns equal to the basis vectors in CC.

We want a matrix MM such that

[T(x)]C=M[x]B. [T(x)]_C=M[x]_B.

Since

x=PB[x]B, x=P_B[x]_B,

we have

T(x)=Ax=APB[x]B. T(x)=A x=A P_B[x]_B.

Now convert the output to CC-coordinates:

[T(x)]C=PC1T(x)=PC1APB[x]B. [T(x)]_C=P_C^{-1}T(x)=P_C^{-1}A P_B[x]_B.

Therefore

M=PC1APB. M=P_C^{-1}AP_B.

So

[T]CB=PC1APB. [T]_{C\leftarrow B}=P_C^{-1}AP_B.

This formula is the main computational rule for changing matrix representations.

34.13 Operators and Similarity

A linear operator is a linear map from a vector space to itself:

T:VV. T:V\to V.

When the same basis BB is used for both the domain and codomain, the matrix is written

[T]B. [T]_B.

If AA is the standard matrix of a linear operator on FnF^n, and BB is a basis with change-of-coordinates matrix PBP_B, then

[T]B=PB1APB. [T]_B=P_B^{-1}AP_B.

Matrices related by

B=P1AP B=P^{-1}AP

are called similar matrices.

Similar matrices represent the same linear operator in different bases. They have many shared properties, including determinant, trace, rank, characteristic polynomial, and eigenvalues.

This is why choosing a good basis matters. A complicated matrix may become simpler after a change of basis.

34.14 Diagonal Representation

A particularly useful case occurs when a linear operator has a basis of eigenvectors.

Let

T:VV T:V\to V

have basis

B=(v1,,vn) B=(v_1,\ldots,v_n)

such that

T(vj)=λjvj T(v_j)=\lambda_j v_j

for each jj. Then the matrix of TT in basis BB is diagonal:

[T]B=[λ1000λ2000λn]. [T]_B= \begin{bmatrix} \lambda_1 & 0 & \cdots & 0\\ 0 & \lambda_2 & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & \cdots & \lambda_n \end{bmatrix}.

The reason is simple. The jj-th column of [T]B[T]_B is the coordinate vector of T(vj)T(v_j) in basis BB. Since

T(vj)=λjvj, T(v_j)=\lambda_jv_j,

that coordinate vector has λj\lambda_j in position jj and zeros elsewhere.

Diagonalization is the process of finding such a basis when it exists.

34.15 Composition of Linear Maps

Matrix representation converts composition of linear maps into multiplication of matrices.

Let

T:UV T:U\to V

and

S:VW S:V\to W

be linear maps. Choose bases AA for UU, BB for VV, and CC for WW.

Then

[T]BA [T]_{B\leftarrow A}

represents TT, and

[S]CB [S]_{C\leftarrow B}

represents SS.

The composition

ST:UW S\circ T:U\to W

has matrix

[ST]CA=[S]CB[T]BA. [S\circ T]_{C\leftarrow A} = [S]_{C\leftarrow B}[T]_{B\leftarrow A}.

The order of multiplication follows the order of application: first TT, then SS. With column vectors, the first transformation appears on the right. Matrix multiplication represents composition of linear transformations.

34.16 Inverses

If T:VWT:V\to W is an isomorphism, then T1:WVT^{-1}:W\to V exists and is linear.

Choose bases BB for VV and CC for WW. If

M=[T]CB, M=[T]_{C\leftarrow B},

then the matrix of the inverse map is

[T1]BC=M1. [T^{-1}]_{B\leftarrow C}=M^{-1}.

Indeed,

[T1(T(v))]B=[v]B. [T^{-1}(T(v))]_B=[v]_B.

In coordinates,

[T1]BC[T]CB[v]B=[v]B. [T^{-1}]_{B\leftarrow C}[T]_{C\leftarrow B}[v]_B=[v]_B.

Therefore

[T1]BCM=I. [T^{-1}]_{B\leftarrow C}M=I.

So

[T1]BC=M1. [T^{-1}]_{B\leftarrow C}=M^{-1}.

A linear map is invertible exactly when its representing matrix is invertible.

34.17 Kernel and Image in Matrix Form

Let

M=[T]CB. M=[T]_{C\leftarrow B}.

Then the kernel of TT corresponds to the null space of MM in coordinates:

vker(T)M[v]B=0. v\in\ker(T) \quad\Longleftrightarrow\quad M[v]_B=0.

Thus

[ker(T)]B=ker(M). [\ker(T)]_B=\ker(M).

Similarly, the image of TT corresponds to the column space of MM in codomain coordinates:

[im(T)]C=col(M). [\operatorname{im}(T)]_C=\operatorname{col}(M).

This means that row reduction and matrix methods can be used to compute bases for kernels and images of abstract linear maps, once bases have been chosen.

34.18 Example: A Polynomial Map

Let P2P_2 be the vector space of polynomials of degree at most 22, and let P1P_1 be the vector space of polynomials of degree at most 11.

Define

D:P2P1 D:P_2\to P_1

by differentiation:

D(p)=p. D(p)=p'.

Choose the ordered basis

B=(1,x,x2) B=(1,x,x^2)

for P2P_2, and

C=(1,x) C=(1,x)

for P1P_1.

Compute the images of the basis vectors:

D(1)=0, D(1)=0, D(x)=1, D(x)=1, D(x2)=2x. D(x^2)=2x.

Now write each image in the basis CC:

[D(1)]C=[00],[D(x)]C=[10],[D(x2)]C=[02]. [D(1)]_C= \begin{bmatrix} 0\\ 0 \end{bmatrix}, \qquad [D(x)]_C= \begin{bmatrix} 1\\ 0 \end{bmatrix}, \qquad [D(x^2)]_C= \begin{bmatrix} 0\\ 2 \end{bmatrix}.

Therefore

[D]CB=[010002]. [D]_{C\leftarrow B} = \begin{bmatrix} 0 & 1 & 0\\ 0 & 0 & 2 \end{bmatrix}.

If

p=a+bx+cx2, p=a+bx+cx^2,

then

[p]B=[abc]. [p]_B= \begin{bmatrix} a\\ b\\ c \end{bmatrix}.

Multiplying,

[D]CB[p]B=[010002][abc]=[b2c]. [D]_{C\leftarrow B}[p]_B = \begin{bmatrix} 0 & 1 & 0\\ 0 & 0 & 2 \end{bmatrix} \begin{bmatrix} a\\ b\\ c \end{bmatrix} = \begin{bmatrix} b\\ 2c \end{bmatrix}.

This is the coordinate vector of

p=b+2cx p'=b+2cx

in the basis C=(1,x)C=(1,x).

34.19 Example: Integration as a Linear Map

Let P1P_1 be the vector space of polynomials of degree at most 11, and let P2P_2 be the vector space of polynomials of degree at most 22.

Define

I:P1P2 I:P_1\to P_2

by

I(p)(x)=0xp(t)dt. I(p)(x)=\int_0^x p(t)\,dt.

Use bases

B=(1,x) B=(1,x)

for P1P_1, and

C=(1,x,x2) C=(1,x,x^2)

for P2P_2.

Compute:

I(1)=x, I(1)=x,

and

I(x)=x22. I(x)=\frac{x^2}{2}.

Therefore

[I(1)]C=[010],[I(x)]C=[0012]. [I(1)]_C= \begin{bmatrix} 0\\ 1\\ 0 \end{bmatrix}, \qquad [I(x)]_C= \begin{bmatrix} 0\\ 0\\ \frac12 \end{bmatrix}.

So

[I]CB=[0010012]. [I]_{C\leftarrow B} = \begin{bmatrix} 0 & 0\\ 1 & 0\\ 0 & \frac12 \end{bmatrix}.

If

p=a+bx, p=a+bx,

then

[p]B=[ab]. [p]_B= \begin{bmatrix} a\\ b \end{bmatrix}.

Multiplying gives

[I]CB[p]B=[0ab/2], [I]_{C\leftarrow B}[p]_B = \begin{bmatrix} 0\\ a\\ b/2 \end{bmatrix},

which represents

ax+b2x2. ax+\frac{b}{2}x^2.

34.20 Reading a Matrix as a Linear Map

A matrix can be read column by column.

If

A=[142035], A= \begin{bmatrix} 1 & 4 & -2\\ 0 & 3 & 5 \end{bmatrix},

then AA represents a map

TA:F3F2. T_A:F^3\to F^2.

The columns are

a1=[10],a2=[43],a3=[25]. a_1= \begin{bmatrix} 1\\ 0 \end{bmatrix}, \qquad a_2= \begin{bmatrix} 4\\ 3 \end{bmatrix}, \qquad a_3= \begin{bmatrix} -2\\ 5 \end{bmatrix}.

For

x=[x1x2x3], x= \begin{bmatrix} x_1\\ x_2\\ x_3 \end{bmatrix},

we have

Ax=x1a1+x2a2+x3a3. Ax=x_1a_1+x_2a_2+x_3a_3.

Thus a matrix does not merely multiply numbers. It forms a linear combination of its columns using the input coordinates as coefficients.

This column view explains why the image of AA is the span of its columns.

34.21 Row View

The row view is also useful.

If AA is an m×nm\times n matrix, then each row defines a linear functional on FnF^n. The output vector AxAx contains the dot products of the rows of AA with xx.

For

A=[r1r2rm], A= \begin{bmatrix} r_1\\ r_2\\ \vdots\\ r_m \end{bmatrix},

where each rir_i is a row vector,

Ax=[r1xr2xrmx]. Ax= \begin{bmatrix} r_1x\\ r_2x\\ \vdots\\ r_mx \end{bmatrix}.

The row view is useful for systems of equations. The equation

Ax=b Ax=b

means that each row imposes one linear equation on xx.

The column view emphasizes the image. The row view emphasizes constraints.

34.22 Standard Geometric Matrices

Many geometric transformations in the plane are represented by simple matrices.

A scaling transformation is

[a00b]. \begin{bmatrix} a & 0\\ 0 & b \end{bmatrix}.

A reflection across the xx-axis is

[1001]. \begin{bmatrix} 1 & 0\\ 0 & -1 \end{bmatrix}.

A projection onto the xx-axis is

[1000]. \begin{bmatrix} 1 & 0\\ 0 & 0 \end{bmatrix}.

A shear parallel to the xx-axis is

[1k01]. \begin{bmatrix} 1 & k\\ 0 & 1 \end{bmatrix}.

A rotation through angle θ\theta is

[cosθsinθsinθcosθ]. \begin{bmatrix} \cos\theta & -\sin\theta\\ \sin\theta & \cos\theta \end{bmatrix}.

These matrices act on column vectors in R2\mathbb{R}^2. They are linear because they keep the origin fixed and preserve linear combinations.

34.23 Common Mistakes

The first common mistake is reversing the matrix size. A map

T:FnFm T:F^n\to F^m

has an m×nm\times n matrix, not an n×mn\times m matrix.

The second common mistake is putting images of basis vectors in rows instead of columns. With column vectors, the image of the jj-th basis vector goes in the jj-th column.

The third common mistake is forgetting the codomain basis. To form [T]CB[T]_{C\leftarrow B}, compute T(vj)T(v_j), then express it in the basis CC.

The fourth common mistake is treating a matrix as basis-independent. A matrix represents a linear map only after the relevant bases are known.

The fifth common mistake is using changed columns from a row-reduced matrix as a basis for the original image. Row reduction helps identify pivot columns, but the corresponding basis vectors for the image must be taken from the original matrix.

34.24 Summary

A matrix representation gives coordinates for a linear map.

For a linear map

T:VW, T:V\to W,

with ordered basis B=(v1,,vn)B=(v_1,\ldots,v_n) of VV and ordered basis C=(w1,,wm)C=(w_1,\ldots,w_m) of WW, the matrix of TT is

[T]CB=[[T(v1)]C[T(v2)]C[T(vn)]C]. [T]_{C\leftarrow B} = \begin{bmatrix} | & | & & |\\ [T(v_1)]_C & [T(v_2)]_C & \cdots & [T(v_n)]_C\\ | & | & & | \end{bmatrix}.

It satisfies

[T(v)]C=[T]CB[v]B. [T(v)]_C=[T]_{C\leftarrow B}[v]_B.

In standard coordinate spaces, the matrix of T:RnRmT:\mathbb{R}^n\to\mathbb{R}^m has columns T(e1),,T(en)T(e_1),\ldots,T(e_n), and

T(x)=Ax. T(x)=Ax.

Composition of linear maps becomes matrix multiplication. Inverses of linear maps become inverse matrices. A change of basis changes the matrix representation by multiplication with change-of-coordinates matrices.

The linear map is the coordinate-free object. The matrix is its coordinate description.