Chapter 6 ยท Linear Transformations

6.3 Matrices of Linear Transformations

Every linear map between finite-dimensional spaces is a matrix once bases are chosen: $[T(\mathbf{x})]_{\mathcal C}=[T]_{\mathcal C\leftarrow\mathcal B}[\mathbf{x}]_{\mathcal B}$. Changing the basis changes the matrix to a similar one, $P^{-1}AP$ โ€” and a clever basis can make it diagonal.

In Section 6.1 we saw that every linear transformation $T:\mathbb{R}^n\to\mathbb{R}^m$ is multiplication by its standard matrix $A=\begin{bmatrix}T(\mathbf{e}_1)&\cdots&T(\mathbf{e}_n)\end{bmatrix}$. That is wonderful for computation โ€” a computer stores a few numbers and multiplies โ€” but two questions remain. What about maps on other vector spaces, such as "shift a polynomial", "differentiate", or "transpose a matrix", where there are no columns to speak of? And is the standard basis always the best point of view?

The answer to both questions is coordinates (Section 5.5). Once we fix a basis $\mathcal B$ for the domain and a basis $\mathcal C$ for the codomain, every vector becomes a column of numbers and every linear map becomes a matrix. Different bases give different matrices for the same map, and choosing the basis well can turn a messy matrix into a diagonal one โ€” a reflection becomes $\begin{bmatrix}1&0\\0&-1\end{bmatrix}$, a projection becomes $\begin{bmatrix}1&0\\0&0\end{bmatrix}$. Engineers call such a basis the "natural axes" of a problem; finding it systematically is the subject of Chapter 7.

The Matrix of $T$ Relative to Bases $\mathcal B$ and $\mathcal C$

Let $V$ have basis $\mathcal B=\{\mathbf{b}_1,\dots,\mathbf{b}_n\}$ and $W$ have basis $\mathcal C=\{\mathbf{c}_1,\dots,\mathbf{c}_m\}$. Any $\mathbf{x}\in V$ can be written uniquely as $\mathbf{x}=x_1\mathbf{b}_1+\cdots+x_n\mathbf{b}_n$, so $[\mathbf{x}]_{\mathcal B}=(x_1,\dots,x_n)$. Because $T$ is linear, $$T(\mathbf{x})=x_1T(\mathbf{b}_1)+\cdots+x_nT(\mathbf{b}_n),$$ and since taking $\mathcal C$-coordinates is itself linear, $$[T(\mathbf{x})]_{\mathcal C}=x_1[T(\mathbf{b}_1)]_{\mathcal C}+\cdots+x_n[T(\mathbf{b}_n)]_{\mathcal C}.$$ The right-hand side is a linear combination of $n$ fixed columns with weights $x_1,\dots,x_n$ โ€” in other words, a matrix times $[\mathbf{x}]_{\mathcal B}$.

๐Ÿ“˜ Definition 6.6 โ€” The matrix of $T$ relative to $\mathcal B$ and $\mathcal C$
Let $V$ and $W$ be finite-dimensional vector spaces with bases $\mathcal B=\{\mathbf{b}_1,\dots,\mathbf{b}_n\}$ and $\mathcal C=\{\mathbf{c}_1,\dots,\mathbf{c}_m\}$, and let $T:V\to W$ be linear. The matrix of $T$ relative to $\mathcal B$ and $\mathcal C$ is the $m\times n$ matrix whose $j$-th column is the $\mathcal C$-coordinate vector of $T(\mathbf{b}_j)$: $$[T]_{\mathcal C\leftarrow\mathcal B}=\begin{bmatrix}[T(\mathbf{b}_1)]_{\mathcal C}&[T(\mathbf{b}_2)]_{\mathcal C}&\cdots&[T(\mathbf{b}_n)]_{\mathcal C}\end{bmatrix}.$$ Its size is $(\dim W)\times(\dim V)$: one row per vector of $\mathcal C$, one column per vector of $\mathcal B$.
๐Ÿ“ Theorem 6.11 โ€” Coordinates of the image

With $V$, $W$, $\mathcal B$, $\mathcal C$ and the linear map $T:V\to W$ as in Definition 6.6, for every $\mathbf{x}\in V$ $$[T(\mathbf{x})]_{\mathcal C}=[T]_{\mathcal C\leftarrow\mathcal B}\,[\mathbf{x}]_{\mathcal B}.$$ Moreover, $[T]_{\mathcal C\leftarrow\mathcal B}$ is the only $m\times n$ matrix with this property.

When $V=\mathbb{R}^n$, $W=\mathbb{R}^m$ and $\mathcal B$, $\mathcal C$ are the standard bases, $[T]_{\mathcal C\leftarrow\mathcal B}$ is exactly the standard matrix of Section 6.1.

The arrow in the subscript reads right to left, like the matrix product itself: feed in $\mathcal B$-coordinates on the right, get $\mathcal C$-coordinates out on the left. Uniqueness holds because multiplying any matrix with this property by $[\mathbf{b}_j]_{\mathcal B}=\mathbf{e}_j$ must return the $j$-th column $[T(\mathbf{b}_j)]_{\mathcal C}$.

๐Ÿงญ Problem-solving strategy โ€” building $[T]_{\mathcal C\leftarrow\mathcal B}$
  1. Apply $T$ to each basis vector $\mathbf{b}_1,\dots,\mathbf{b}_n$ of the domain.
  2. Write each image $T(\mathbf{b}_j)$ as a combination of the codomain basis $\mathcal C$; the weights form $[T(\mathbf{b}_j)]_{\mathcal C}$. (For $\mathcal C$ in $\mathbb{R}^m$ this means solving a system with coefficient matrix $\begin{bmatrix}\mathbf{c}_1&\cdots&\mathbf{c}_m\end{bmatrix}$; for the standard basis of $P_n$, just read off the coefficients.)
  3. Place these coordinate vectors side by side as columns, in the order of $\mathcal B$.
  4. Check with one vector $\mathbf{x}$: compute $[T(\mathbf{x})]_{\mathcal C}$ directly and compare with $[T]_{\mathcal C\leftarrow\mathcal B}[\mathbf{x}]_{\mathcal B}$.
โœ๏ธ Example 1 โ€” A map from $\mathbb{R}^3$ to $\mathbb{R}^2$ with non-standard bases
Let $T:\mathbb{R}^3\to\mathbb{R}^2$, $T(x_1,x_2,x_3)=(x_1+2x_2,\ x_2-x_3)$. Use the bases $$\mathcal B=\left\{\begin{bmatrix}1\\0\\0\end{bmatrix},\begin{bmatrix}1\\1\\0\end{bmatrix},\begin{bmatrix}1\\1\\1\end{bmatrix}\right\}\text{ of }\mathbb{R}^3,\qquad \mathcal C=\left\{\begin{bmatrix}1\\0\end{bmatrix},\begin{bmatrix}1\\1\end{bmatrix}\right\}\text{ of }\mathbb{R}^2.$$ Find $[T]_{\mathcal C\leftarrow\mathcal B}$ and check Theorem 6.11 for $\mathbf{x}=(2,-1,3)$.
Images $T(\mathbf{b}_1)=(1,0)$, $T(\mathbf{b}_2)=(1+2,\,1-0)=(3,1)$, $T(\mathbf{b}_3)=(1+2,\,1-1)=(3,0)$.
$\mathcal C$-coordinates $(a,b)=\alpha(1,0)+\beta(1,1)$ gives $\beta=b$, $\alpha=a-b$. So $[(1,0)]_{\mathcal C}=(1,0)$, $[(3,1)]_{\mathcal C}=(2,1)$, $[(3,0)]_{\mathcal C}=(3,0)$, and $$[T]_{\mathcal C\leftarrow\mathcal B}=\begin{bmatrix}1&2&3\\0&1&0\end{bmatrix}\quad(2\times3,\text{ as expected}).$$
Coordinates of $\mathbf{x}$ $c_1\mathbf{b}_1+c_2\mathbf{b}_2+c_3\mathbf{b}_3=(c_1+c_2+c_3,\ c_2+c_3,\ c_3)=(2,-1,3)$ gives $c_3=3$, $c_2=-4$, $c_1=3$: $[\mathbf{x}]_{\mathcal B}=(3,-4,3)$.
Check $[T]_{\mathcal C\leftarrow\mathcal B}[\mathbf{x}]_{\mathcal B}=\begin{bmatrix}3-8+9\\-4\end{bmatrix}=\begin{bmatrix}4\\-4\end{bmatrix}$. Directly, $T(\mathbf{x})=(2-2,\,-1-3)=(0,-4)$, and $[(0,-4)]_{\mathcal C}=(0-(-4),\,-4)=(4,-4)$. โœ“

The real power of Definition 6.6 is that $V$ and $W$ need not be $\mathbb{R}^n$ at all. In $P_n$ the standard basis $\{1,x,\dots,x^n\}$ makes coordinates trivial to read: $[a_0+a_1x+\cdots+a_nx^n]=(a_0,a_1,\dots,a_n)$.

โœ๏ธ Example 2 โ€” Shifting a polynomial
Let $T:P_2\to P_2$ be $T(p)(x)=p(x+1)$ (shift the graph one unit to the left). Find the matrix of $T$ relative to $\mathcal B=\{1,x,x^2\}$ (used for both domain and codomain) and use it to compute $T\left(3-2x+5x^2\right)$.
Linear? $T(p+q)(x)=p(x+1)+q(x+1)$ and $T(cp)(x)=cp(x+1)$, so $T$ is linear, and a polynomial of degree at most $2$ stays of degree at most $2$.
Columns $T(1)=1$, $T(x)=x+1=1+x$, $T(x^2)=(x+1)^2=1+2x+x^2$. Their coordinate vectors $(1,0,0)$, $(1,1,0)$, $(1,2,1)$ are the columns: $$[T]_{\mathcal B}=\begin{bmatrix}1&1&1\\0&1&2\\0&0&1\end{bmatrix}.$$
Apply $[3-2x+5x^2]_{\mathcal B}=(3,-2,5)$, so $[T]_{\mathcal B}\begin{bmatrix}3\\-2\\5\end{bmatrix}=\begin{bmatrix}3-2+5\\-2+10\\5\end{bmatrix}=\begin{bmatrix}6\\8\\5\end{bmatrix}$, i.e. $T\left(3-2x+5x^2\right)=6+8x+5x^2$.
Check $3-2(x+1)+5(x+1)^2=3-2x-2+5x^2+10x+5=6+8x+5x^2$. โœ“ Notice the columns of $[T]_{\mathcal B}$ are rows of Pascal's triangle โ€” the binomial coefficients of $(x+1)^k$.
โœ๏ธ Example 3 โ€” Differentiation as a matrix (uses calculus)
(uses calculus) Let $D:P_3\to P_2$, $D(p)=p'$. Find $[D]_{\mathcal C\leftarrow\mathcal B}$ for $\mathcal B=\{1,x,x^2,x^3\}$ and $\mathcal C=\{1,x,x^2\}$, and use it to differentiate $4-x+2x^2-x^3$. What do the rank and null space of the matrix tell you?
Columns $D(1)=0$, $D(x)=1$, $D(x^2)=2x$, $D(x^3)=3x^2$, so $$[D]_{\mathcal C\leftarrow\mathcal B}=\begin{bmatrix}0&1&0&0\\0&0&2&0\\0&0&0&3\end{bmatrix}\quad(3\times4\text{, since }\dim P_2=3,\ \dim P_3=4).$$
Apply $[D]_{\mathcal C\leftarrow\mathcal B}\begin{bmatrix}4\\-1\\2\\-1\end{bmatrix}=\begin{bmatrix}-1\\4\\-3\end{bmatrix}$, so the derivative is $-1+4x-3x^2$ โ€” exactly what the power rule gives.
Kernel and range The matrix has rank $3$ and its null space is spanned by $(1,0,0,0)$, the coordinate vector of the constant polynomial $1$. So $\ker D$ is the constants and $\operatorname{range}D=P_2$ โ€” every quadratic is the derivative of some cubic. Rank $+$ nullity $=3+1=4=\dim P_3$, as Section 6.2 predicts.

Linear Operators and Change of Basis: Similarity

A linear map $T:V\to V$ from a space to itself is called a linear operator. For operators it is natural to use the same basis on both sides.

๐Ÿ“˜ Definition 6.7 โ€” The matrix of an operator relative to $\mathcal B$
If $T:V\to V$ is linear and $\mathcal B$ is a basis of the finite-dimensional space $V$, the matrix of $T$ relative to $\mathcal B$ (or the $\mathcal B$-matrix of $T$) is $$[T]_{\mathcal B}=[T]_{\mathcal B\leftarrow\mathcal B}=\begin{bmatrix}[T(\mathbf{b}_1)]_{\mathcal B}&\cdots&[T(\mathbf{b}_n)]_{\mathcal B}\end{bmatrix},\qquad\text{so}\qquad[T(\mathbf{x})]_{\mathcal B}=[T]_{\mathcal B}[\mathbf{x}]_{\mathcal B}.$$

How are the matrices of one operator in two different bases related? Recall from Section 5.5 that the change-of-basis matrix $P_{\mathcal B\leftarrow\mathcal C}$ converts $\mathcal C$-coordinates into $\mathcal B$-coordinates, and $P_{\mathcal C\leftarrow\mathcal B}=\left(P_{\mathcal B\leftarrow\mathcal C}\right)^{-1}$. Follow a vector round the diagram: start with $[\mathbf{x}]_{\mathcal C}$, convert to $\mathcal B$-coordinates, apply $T$ in the $\mathcal B$-world, convert back.

๐Ÿ“ Theorem 6.12 โ€” Change of basis for an operator

Let $T:V\to V$ be linear and let $\mathcal B$ and $\mathcal C$ be bases of the finite-dimensional space $V$. With $P=P_{\mathcal B\leftarrow\mathcal C}$, $$[T]_{\mathcal C}=P^{-1}\,[T]_{\mathcal B}\,P .$$ Most common case. If $T:\mathbb{R}^n\to\mathbb{R}^n$ has standard matrix $A$ and $\mathcal B=\{\mathbf{b}_1,\dots,\mathbf{b}_n\}$ is any basis of $\mathbb{R}^n$, then with $P=\begin{bmatrix}\mathbf{b}_1&\cdots&\mathbf{b}_n\end{bmatrix}$ (the basis vectors as columns), $$[T]_{\mathcal B}=P^{-1}AP\qquad\text{equivalently}\qquad A=P\,[T]_{\mathcal B}\,P^{-1}.$$

Why it is true. For any $\mathbf{x}$, $$\begin{aligned}[T(\mathbf{x})]_{\mathcal C}&=P^{-1}[T(\mathbf{x})]_{\mathcal B}=P^{-1}[T]_{\mathcal B}[\mathbf{x}]_{\mathcal B}\\&=P^{-1}[T]_{\mathcal B}P\,[\mathbf{x}]_{\mathcal C}.\end{aligned}$$ By the uniqueness in Theorem 6.11 the matrix in front of $[\mathbf{x}]_{\mathcal C}$ must be $[T]_{\mathcal C}$. Read $P^{-1}AP$ from right to left: $P$ turns $\mathcal B$-coordinates into ordinary coordinates, $A$ does the map, $P^{-1}$ turns the answer back into $\mathcal B$-coordinates.

๐Ÿ“˜ Definition 6.8 โ€” Similar matrices
Two $n\times n$ matrices $A$ and $B$ are similar if there is an invertible $n\times n$ matrix $P$ with $B=P^{-1}AP$. Changing $A$ into $P^{-1}AP$ is called a similarity transformation.

So Theorem 6.12 says: the matrices of one linear operator relative to different bases are similar. Conversely, similar matrices can always be read as the same operator seen in two bases (take the columns of $P$ as the new basis). Properties that belong to the operator itself โ€” not to the coordinates โ€” must therefore be shared by similar matrices.

๐Ÿ“ Theorem 6.13 โ€” What similar matrices share
If $A$ and $B$ are $n\times n$ matrices with $B=P^{-1}AP$ for some invertible $P$, then
  • $\det B=\det A$ (since $\det B=\det P^{-1}\det A\det P=\det A$);
  • $\operatorname{tr}B=\operatorname{tr}A$ (since $\operatorname{tr}(XY)=\sum_i\sum_k x_{ik}y_{ki}=\sum_k\sum_i y_{ki}x_{ik}=\operatorname{tr}(YX)$ for $n\times n$ matrices $X$, $Y$, so $\operatorname{tr}\big(P^{-1}(AP)\big)=\operatorname{tr}\big((AP)P^{-1}\big)=\operatorname{tr}A$);
  • $\operatorname{rank}B=\operatorname{rank}A$, and $B$ is invertible if and only if $A$ is;
  • $B^k=P^{-1}A^kP$ for every positive integer $k$.
The converse is false: equal determinant, trace and rank do not guarantee similarity (Exercise III.4).
โœ๏ธ Example 4 โ€” A basis that makes the matrix diagonal
Let $T(\mathbf{x})=A\mathbf{x}$ with $A=\begin{bmatrix}4&-2\\1&1\end{bmatrix}$, and let $\mathcal B=\left\{\mathbf{b}_1,\mathbf{b}_2\right\}=\left\{\begin{bmatrix}1\\1\end{bmatrix},\begin{bmatrix}2\\1\end{bmatrix}\right\}$. Find $[T]_{\mathcal B}$ and describe what $T$ does.
Images $A\mathbf{b}_1=\begin{bmatrix}4-2\\1+1\end{bmatrix}=\begin{bmatrix}2\\2\end{bmatrix}=2\mathbf{b}_1$ and $A\mathbf{b}_2=\begin{bmatrix}8-2\\2+1\end{bmatrix}=\begin{bmatrix}6\\3\end{bmatrix}=3\mathbf{b}_2$.
Matrix So $[T(\mathbf{b}_1)]_{\mathcal B}=(2,0)$, $[T(\mathbf{b}_2)]_{\mathcal B}=(0,3)$ and $$[T]_{\mathcal B}=\begin{bmatrix}2&0\\0&3\end{bmatrix}.$$
Check with $P^{-1}AP$ $P=\begin{bmatrix}1&2\\1&1\end{bmatrix}$, $\det P=-1$, $P^{-1}=\begin{bmatrix}-1&2\\1&-1\end{bmatrix}$, $AP=\begin{bmatrix}2&6\\2&3\end{bmatrix}$ and $P^{-1}(AP)=\begin{bmatrix}-2+4&-6+6\\2-2&6-3\end{bmatrix}=\begin{bmatrix}2&0\\0&3\end{bmatrix}$. โœ“ Also $\operatorname{tr}A=5=2+3$ and $\det A=6=2\cdot3$.
Meaning In $\mathcal B$-coordinates $T$ simply doubles the first coordinate and triples the second: $T$ stretches by $2$ along the line through $(1,1)$ and by $3$ along the line through $(2,1)$. The standard matrix hides this; the right basis reveals it. Vectors such as $\mathbf{b}_1$, $\mathbf{b}_2$ that are only stretched are the eigenvectors of Chapter 7, and writing $A=PDP^{-1}$ is diagonalisation (Section 7.2).
Interactive 1 โ€” One Map, Two Points of View

Left: the plane in ordinary coordinates, with the $\mathcal B$-grid drawn through $\mathbf{b}_1$, $\mathbf{b}_2$. Right: the same picture in $\mathcal B$-coordinates, where the $\mathcal B$-grid becomes square. The vector $\mathbf{x}$ (red) travels round a circle in $\mathcal B$-coordinates and $T(\mathbf{x})$ (blue) follows; the faint curve is the image of the whole circle. Pick the eigen-basis and watch the right-hand map become a pure stretch along the axes.

ordinary coordinates: $\mathbf{x}\mapsto A\mathbf{x}$
$\mathcal B$-coordinates: $[\mathbf{x}]_{\mathcal B}\mapsto[T]_{\mathcal B}[\mathbf{x}]_{\mathcal B}$
standard matrix $A$โ€”
$P=[\mathbf{b}_1\ \mathbf{b}_2]$โ€”
$[T]_{\mathcal B}=P^{-1}AP$โ€”
$[\mathbf{x}]_{\mathcal B}$โ€”
$[T(\mathbf{x})]_{\mathcal B}$โ€”
โœ๏ธ Example 5 โ€” From a simple $\mathcal B$-matrix to the standard matrix
Find the standard matrix of the reflection $F$ of $\mathbb{R}^2$ in the line $y=2x$.
Choose a basis Take $\mathbf{b}_1=(1,2)$ along the mirror line and $\mathbf{b}_2=(-2,1)$ perpendicular to it ($\mathbf{b}_1\cdot\mathbf{b}_2=0$). The reflection fixes $\mathbf{b}_1$ and reverses $\mathbf{b}_2$: $F(\mathbf{b}_1)=\mathbf{b}_1$, $F(\mathbf{b}_2)=-\mathbf{b}_2$. So $[F]_{\mathcal B}=\begin{bmatrix}1&0\\0&-1\end{bmatrix}$ โ€” no calculation needed.
Convert $P=\begin{bmatrix}1&-2\\2&1\end{bmatrix}$, $\det P=5$, $P^{-1}=\dfrac15\begin{bmatrix}1&2\\-2&1\end{bmatrix}$. Then $$A=P[F]_{\mathcal B}P^{-1}=\begin{bmatrix}1&2\\2&-1\end{bmatrix}\cdot\frac15\begin{bmatrix}1&2\\-2&1\end{bmatrix}=\frac15\begin{bmatrix}-3&4\\4&3\end{bmatrix}.$$
Check $A\begin{bmatrix}1\\2\end{bmatrix}=\tfrac15\begin{bmatrix}5\\10\end{bmatrix}=\begin{bmatrix}1\\2\end{bmatrix}$ โœ“, $A\begin{bmatrix}-2\\1\end{bmatrix}=\tfrac15\begin{bmatrix}10\\-5\end{bmatrix}=\begin{bmatrix}2\\-1\end{bmatrix}$ โœ“, and $\det A=\tfrac{-9-16}{25}=-1$, as for every reflection (Section 6.4).
โœ๏ธ Example 6 โ€” When no basis gives a diagonal matrix
Let $A=\begin{bmatrix}3&1\\-1&1\end{bmatrix}$ and $\mathcal B=\left\{\begin{bmatrix}1\\-1\end{bmatrix},\begin{bmatrix}1\\0\end{bmatrix}\right\}$. Find $[T]_{\mathcal B}$ for $T(\mathbf{x})=A\mathbf{x}$ and interpret it.
First column $A\mathbf{b}_1=\begin{bmatrix}3-1\\-1-1\end{bmatrix}=\begin{bmatrix}2\\-2\end{bmatrix}=2\mathbf{b}_1$, so $[T(\mathbf{b}_1)]_{\mathcal B}=(2,0)$.
Second column $A\mathbf{b}_2=\begin{bmatrix}3\\-1\end{bmatrix}$. Solve $\alpha(1,-1)+\beta(1,0)=(3,-1)$: $\alpha=1$, $\beta=2$. So $[T(\mathbf{b}_2)]_{\mathcal B}=(1,2)$ and $$[T]_{\mathcal B}=\begin{bmatrix}2&1\\0&2\end{bmatrix}.$$
Interpret $[T]_{\mathcal B}=2\begin{bmatrix}1&\tfrac12\\0&1\end{bmatrix}$: in $\mathcal B$-coordinates $T$ is a shear followed by doubling. Upper triangular is as simple as this map gets โ€” if some basis made it diagonal, $\operatorname{diag}(\lambda_1,\lambda_2)$ would need $\lambda_1+\lambda_2=\operatorname{tr}A=4$ and $\lambda_1\lambda_2=\det A=4$, forcing $\lambda_1=\lambda_2=2$ and $[T]_{\mathcal B}=2I$; but then $A=P(2I)P^{-1}=2I$, which it is not. Choose this map in Interactive 1 and see that the circle's image stays slanted in every basis.
Check $\operatorname{tr}[T]_{\mathcal B}=4=\operatorname{tr}A$ and $\det[T]_{\mathcal B}=4=3\cdot1-(1)(-1)=\det A$. โœ“
โš ๏ธ Common mistakes with matrices of maps

1. Columns, not rows. The coordinate vector of $T(\mathbf{b}_j)$ is the $j$-th column. Writing it as a row gives the transpose โ€” a different map.

2. Coordinates, not the vectors themselves. In Example 1, $T(\mathbf{b}_2)=(3,1)$ but the column is $[T(\mathbf{b}_2)]_{\mathcal C}=(2,1)$. Only for the standard basis are they the same.

3. $P^{-1}AP$, not $PAP^{-1}$. With $P=\begin{bmatrix}\mathbf{b}_1&\cdots&\mathbf{b}_n\end{bmatrix}$ the $\mathcal B$-matrix is $P^{-1}AP$. A quick test: $P^{-1}AP\,\mathbf{e}_1$ must equal $[A\mathbf{b}_1]_{\mathcal B}$.

4. Order of the basis matters. Swapping $\mathbf{b}_1$ and $\mathbf{b}_2$ swaps both the columns and the rows of $[T]_{\mathcal B}$.

Choosing a Good Basis

Examples 4โ€“6 show a pattern. The standard matrix depends on how the map sits relative to the coordinate axes, which usually has nothing to do with the map itself. If we instead build the basis from directions that the map treats simply โ€” a mirror line and its perpendicular, the line onto which we project, directions that are only stretched โ€” the matrix becomes diagonal or nearly so. Simple matrices make everything easier:

๐Ÿงญ Problem-solving strategy โ€” finding the matrix of a geometric map
  1. Find directions the map treats simply: vectors $\mathbf{b}$ with $T(\mathbf{b})$ a multiple of $\mathbf{b}$ (on a mirror line, perpendicular to it, along the projection line, in its kernelโ€ฆ).
  2. If you can find $n$ independent ones, use them as the basis $\mathcal B$; then $[T]_{\mathcal B}$ is diagonal, with the multiples on the diagonal.
  3. Recover the standard matrix as $A=P[T]_{\mathcal B}P^{-1}$, and check $A\mathbf{b}_j$ for each $j$.
  4. Not every map has enough such directions (Example 6, rotations); Chapter 7 tells you exactly when they exist.
Interactive 2 โ€” A Linear Map on Polynomials as a Matrix

Choose a map $T:P_2\to P_2$ and a polynomial $p(x)=a_0+a_1x+a_2x^2$ (or press Play to let $p$ wander). The graph shows $p$ (red) and $T(p)$ (blue). Below, $T(p)$ is computed only by multiplying the coordinate vector $[p]_{\mathcal B}$ by $[T]_{\mathcal B}$, with $\mathcal B=\{1,x,x^2\}$ โ€” and the blue graph agrees with the definition of $T$ every time.

$[p]_{\mathcal B}$โ€”
$[T]_{\mathcal B}$โ€”
$[T(p)]_{\mathcal B}=[T]_{\mathcal B}[p]_{\mathcal B}$โ€”
check at $x=1$: matrix / definitionโ€”

Exercises

I
Matrices relative to bases. Throughout, $T_1:\mathbb{R}^2\to\mathbb{R}^2$ is $T_1(x_1,x_2)=(2x_1-x_2,\ x_1+3x_2)$ and $\mathcal B=\{(1,1),(1,2)\}$.
  • 1 Find the standard matrix of $T_1$.
  • 2 Find $[T_1]_{\mathcal E\leftarrow\mathcal B}$, where $\mathcal E$ is the standard basis of $\mathbb{R}^2$.
  • 3 Find $[T_1]_{\mathcal B}$ and check that it has the same trace and determinant as the standard matrix.
  • 4 $T:\mathbb{R}^3\to\mathbb{R}^2$, $T(x,y,z)=(x-y+2z,\ 3y+z)$. Find $[T]_{\mathcal C\leftarrow\mathcal E}$ for the standard basis $\mathcal E$ of $\mathbb{R}^3$ and $\mathcal C=\{(1,1),(0,1)\}$.
  • 5 $T:\mathbb{R}^2\to\mathbb{R}^3$, $T(x,y)=(x,\ x+y,\ 2y)$. Find $[T]_{\mathcal E\leftarrow\mathcal B'}$ for $\mathcal B'=\{(1,-1),(2,1)\}$ and the standard basis $\mathcal E$ of $\mathbb{R}^3$.
  • 6 $V$ has basis $\{\mathbf{b}_1,\mathbf{b}_2\}$, $W$ has basis $\{\mathbf{c}_1,\mathbf{c}_2,\mathbf{c}_3\}$, and $[T]_{\mathcal C\leftarrow\mathcal B}=\begin{bmatrix}1&2\\0&-1\\3&1\end{bmatrix}$. Express $T(3\mathbf{b}_1-\mathbf{b}_2)$ in terms of $\mathbf{c}_1,\mathbf{c}_2,\mathbf{c}_3$.
  • 7 An operator on $\mathbb{R}^2$ has $[T]_{\mathcal B}=\begin{bmatrix}1&0\\2&-1\end{bmatrix}$ relative to $\mathcal B=\{(1,2),(3,5)\}$. Find its standard matrix.
1 $T_1(\mathbf{e}_1)=(2,1)$, $T_1(\mathbf{e}_2)=(-1,3)$: $\ A=\begin{bmatrix}2&-1\\1&3\end{bmatrix}$.
2 $T_1(1,1)=(1,4)$ and $T_1(1,2)=(0,7)$; in the standard basis these are their own coordinates: $\ [T_1]_{\mathcal E\leftarrow\mathcal B}=\begin{bmatrix}1&0\\4&7\end{bmatrix}=AP$.
3 $P=\begin{bmatrix}1&1\\1&2\end{bmatrix}$, $P^{-1}=\begin{bmatrix}2&-1\\-1&1\end{bmatrix}$, so $[T_1]_{\mathcal B}=P^{-1}(AP)=\begin{bmatrix}2&-1\\-1&1\end{bmatrix}\begin{bmatrix}1&0\\4&7\end{bmatrix}=\begin{bmatrix}-2&-7\\3&7\end{bmatrix}$. Trace $5=2+3$ and determinant $-14+21=7=6+1$. โœ“
4 $(a,b)=a(1,1)+(b-a)(0,1)$, so $[(a,b)]_{\mathcal C}=(a,\,b-a)$. Images $T(\mathbf{e}_1)=(1,0)$, $T(\mathbf{e}_2)=(-1,3)$, $T(\mathbf{e}_3)=(2,1)$ give $\ [T]_{\mathcal C\leftarrow\mathcal E}=\begin{bmatrix}1&-1&2\\-1&4&-1\end{bmatrix}$.
5 $T(1,-1)=(1,0,-2)$, $T(2,1)=(2,3,2)$: $\ [T]_{\mathcal E\leftarrow\mathcal B'}=\begin{bmatrix}1&2\\0&3\\-2&2\end{bmatrix}$.
6 $[3\mathbf{b}_1-\mathbf{b}_2]_{\mathcal B}=(3,-1)$ and $\begin{bmatrix}1&2\\0&-1\\3&1\end{bmatrix}\begin{bmatrix}3\\-1\end{bmatrix}=\begin{bmatrix}1\\1\\8\end{bmatrix}$, so $T(3\mathbf{b}_1-\mathbf{b}_2)=\mathbf{c}_1+\mathbf{c}_2+8\mathbf{c}_3$.
7 $P=\begin{bmatrix}1&3\\2&5\end{bmatrix}$, $\det P=-1$, $P^{-1}=\begin{bmatrix}-5&3\\2&-1\end{bmatrix}$. $A=P[T]_{\mathcal B}P^{-1}=\begin{bmatrix}7&-3\\12&-5\end{bmatrix}\begin{bmatrix}-5&3\\2&-1\end{bmatrix}=\begin{bmatrix}-41&24\\-70&41\end{bmatrix}$. Check: $\operatorname{tr}A=0$, $\det A=-1681+1680=-1$, matching $[T]_{\mathcal B}$.
II
Maps on polynomials and matrices. Use the standard bases $\{1,x\}$ of $P_1$, $\{1,x,x^2\}$ of $P_2$, $\{1,x,x^2,x^3\}$ of $P_3$ unless told otherwise.
  • 1 $T:P_1\to P_1$, $T(p)(x)=p(x+2)$. Find $[T]$.
  • 2 $T:P_2\to P_2$, $T(p)(x)=p(2x)$. Find $[T]$ and use it to compute $T\left(1-3x+x^2\right)$.
  • 3 $S:P_2\to P_2$, $S(p)(x)=p(x-1)$. Find $[S]$ and show that it is the inverse of the matrix in Example 2. Why is that to be expected?
  • 4 $T:P_2\to\mathbb{R}^3$, $T(p)=\left(p(0),\,p(1),\,p(2)\right)$. Find the matrix of $T$ (standard basis of $\mathbb{R}^3$) and show that $T$ is invertible. What does this say about fitting a quadratic through three points?
  • 5 $T:P_2\to P_3$, $T(p)(x)=x\,p(x)$. Find the $4\times3$ matrix of $T$.
  • 6 (uses calculus) $D:P_2\to P_2$, $D(p)=p'$. Find $[D]$, $[D]^2$ and $[D]^3$. Explain $[D]^3=O$ in words.
  • 7 (uses calculus) $T:P_2\to P_2$, $T(p)=p+p'$. Find $[T]_{\mathcal B}$ for the basis $\mathcal B=\{1,\ 1+x,\ 1+x+x^2\}$.
  • 8 $T:M_{2\times2}\to M_{2\times2}$, $T(X)=X^{T}$. Find the matrix of $T$ relative to $\{E_{11},E_{12},E_{21},E_{22}\}$, where $E_{ij}$ has a $1$ in position $(i,j)$ and zeros elsewhere.
1 $T(1)=1$, $T(x)=2+x$: $\ [T]=\begin{bmatrix}1&2\\0&1\end{bmatrix}$.
2 $T(1)=1$, $T(x)=2x$, $T(x^2)=4x^2$: $[T]=\begin{bmatrix}1&0&0\\0&2&0\\0&0&4\end{bmatrix}$. Then $[T](1,-3,1)=(1,-6,4)$, so $T\left(1-3x+x^2\right)=1-6x+4x^2$ (check: $1-3(2x)+(2x)^2$ โœ“).
3 $S(1)=1$, $S(x)=-1+x$, $S(x^2)=1-2x+x^2$: $[S]=\begin{bmatrix}1&-1&1\\0&1&-2\\0&0&1\end{bmatrix}$. Multiplying by $\begin{bmatrix}1&1&1\\0&1&2\\0&0&1\end{bmatrix}$ gives $I_3$. Expected: shifting left by $1$ and then right by $1$ returns every polynomial to itself, so $S=T^{-1}$ and the matrices are inverse.
4 Columns are $T(1)=(1,1,1)$, $T(x)=(0,1,2)$, $T(x^2)=(0,1,4)$: $\ \begin{bmatrix}1&0&0\\1&1&1\\1&2&4\end{bmatrix}$, determinant $1\cdot(4-2)=2\ne0$, so $T$ is invertible. Hence for any values $y_0,y_1,y_2$ there is exactly one $p\in P_2$ with $p(0)=y_0$, $p(1)=y_1$, $p(2)=y_2$: a unique interpolating quadratic.
5 $T(1)=x$, $T(x)=x^2$, $T(x^2)=x^3$: $\ \begin{bmatrix}0&0&0\\1&0&0\\0&1&0\\0&0&1\end{bmatrix}$.
6 $[D]=\begin{bmatrix}0&1&0\\0&0&2\\0&0&0\end{bmatrix}$, $[D]^2=\begin{bmatrix}0&0&2\\0&0&0\\0&0&0\end{bmatrix}$ (the second derivative sends $x^2\mapsto2$), $[D]^3=O$: differentiating a polynomial of degree at most $2$ three times always gives $0$.
7 $T(1)=1=\mathbf{b}_1$; $T(1+x)=2+x=\mathbf{b}_1+\mathbf{b}_2$; $T(1+x+x^2)=2+3x+x^2=-\mathbf{b}_1+2\mathbf{b}_2+\mathbf{b}_3$ (match $x^2$, then $x$, then constants). So $[T]_{\mathcal B}=\begin{bmatrix}1&1&-1\\0&1&2\\0&0&1\end{bmatrix}$.
8 $T(E_{11})=E_{11}$, $T(E_{12})=E_{21}$, $T(E_{21})=E_{12}$, $T(E_{22})=E_{22}$: $\ \begin{bmatrix}1&0&0&0\\0&0&1&0\\0&1&0&0\\0&0&0&1\end{bmatrix}$ โ€” a permutation matrix that swaps the two off-diagonal coordinates.
III
Similarity and good bases.
  • 1 $A=\begin{bmatrix}1&2\\2&4\end{bmatrix}$, $\mathcal B=\{(1,2),(2,-1)\}$. Find $[T]_{\mathcal B}$ for $T(\mathbf{x})=A\mathbf{x}$ and describe $T$ geometrically.
  • 2 $A=\begin{bmatrix}5&-3\\2&0\end{bmatrix}$, $\mathcal B=\{(1,1),(3,2)\}$. Find $[T]_{\mathcal B}$.
  • 3 Same $A$ as part 2, with $\mathcal B'=\{(1,0),(1,1)\}$. Find $[T]_{\mathcal B'}$, and check its trace and determinant.
  • 4 Show that $\begin{bmatrix}1&1\\0&1\end{bmatrix}$ and $I_2$ have the same determinant, trace and rank but are not similar.
  • 5 Are $\begin{bmatrix}2&1\\0&3\end{bmatrix}$ and $\begin{bmatrix}3&0\\1&2\end{bmatrix}$ similar? (Hint: find a basis making each one diagonal.)
  • 6 Can $\begin{bmatrix}1&2\\3&4\end{bmatrix}$ and $\begin{bmatrix}1&0\\0&-2\end{bmatrix}$ be similar?
  • 7 Prove that $B=P^{-1}AP$ implies $B^k=P^{-1}A^kP$. Use part 2 to compute $A^5$ for $A=\begin{bmatrix}5&-3\\2&0\end{bmatrix}$.
  • 8 Challenge. Let $R$ be rotation of $\mathbb{R}^2$ by $90^\circ$. Show that no basis $\mathcal B$ of $\mathbb{R}^2$ makes $[R]_{\mathcal B}$ diagonal.
Check: compute $[T]_{\mathcal B}=P^{-1}AP$ exactly
$A$ (row by row)โ€”
$P^{-1}$โ€”
$[T]_{\mathcal B}=P^{-1}AP$โ€”
trace / det (both)โ€”
1 $A(1,2)=(5,10)=5\mathbf{b}_1$ and $A(2,-1)=(0,0)$, so $[T]_{\mathcal B}=\begin{bmatrix}5&0\\0&0\end{bmatrix}$. $T$ kills the direction $(2,-1)$ and multiplies the perpendicular direction $(1,2)$ by $5$: it is $5$ times the orthogonal projection onto the line $y=2x$.
2 $A(1,1)=(2,2)=2\mathbf{b}_1$, $A(3,2)=(9,6)=3\mathbf{b}_2$: $\ [T]_{\mathcal B}=\begin{bmatrix}2&0\\0&3\end{bmatrix}$.
3 $P=\begin{bmatrix}1&1\\0&1\end{bmatrix}$, $P^{-1}=\begin{bmatrix}1&-1\\0&1\end{bmatrix}$, $AP=\begin{bmatrix}5&2\\2&2\end{bmatrix}$, so $[T]_{\mathcal B'}=\begin{bmatrix}3&0\\2&2\end{bmatrix}$. Trace $5$ and determinant $6$, the same as $A$ and as $\operatorname{diag}(2,3)$. โœ“
4 Both have determinant $1$, trace $2$, rank $2$. But for every invertible $P$, $P^{-1}I_2P=I_2$, so the only matrix similar to $I_2$ is $I_2$ itself; $\begin{bmatrix}1&1\\0&1\end{bmatrix}\ne I_2$.
5 Yes. For the first, $(1,0)\mapsto2(1,0)$ and $(1,1)\mapsto(3,3)=3(1,1)$; for the second, $(0,1)\mapsto2(0,1)$ and $(1,1)\mapsto(3,3)=3(1,1)$. So both are similar to $D=\operatorname{diag}(2,3)$: $D=P^{-1}AP$ and $D=Q^{-1}BQ$ give $B=QDQ^{-1}=(PQ^{-1})^{-1}A(PQ^{-1})$.
6 No: the traces are $5$ and $-1$. (The determinants, $-2$ and $-2$, agree โ€” one shared number is not enough, but one different number rules similarity out.)
7 $B^2=P^{-1}AP\,P^{-1}AP=P^{-1}A(PP^{-1})AP=P^{-1}A^2P$, and induction gives $B^k=P^{-1}A^kP$. With $P=\begin{bmatrix}1&3\\1&2\end{bmatrix}$, $P^{-1}=\begin{bmatrix}-2&3\\1&-1\end{bmatrix}$: $$A^5=P\begin{bmatrix}32&0\\0&243\end{bmatrix}P^{-1}=\begin{bmatrix}32&729\\32&486\end{bmatrix}\begin{bmatrix}-2&3\\1&-1\end{bmatrix}=\begin{bmatrix}665&-633\\422&-390\end{bmatrix}.$$
8 If $[R]_{\mathcal B}=\operatorname{diag}(d_1,d_2)$ then $R(\mathbf{b}_1)=d_1\mathbf{b}_1$ with $\mathbf{b}_1\ne\mathbf{0}$: the rotation would send a non-zero vector onto its own line. But a $90^\circ$ rotation turns every non-zero vector to a perpendicular direction, and a perpendicular vector is never a multiple of $\mathbf{b}_1$ unless it is $\mathbf{0}$ โ€” impossible since rotations preserve length. (Algebraically: trace $0$ and determinant $1$ would need $d_1+d_2=0$, $d_1d_2=1$, i.e. $d_1^2=-1$.)
IV
Applications and theory.
  • 1 Graphics. A game engine needs the reflection in the line $y=3x$. Use the basis $\{(1,3),(-3,1)\}$ to find its standard matrix.
  • 2 Design. A "shear along the diagonal" $T$ has $[T]_{\mathcal B}=\begin{bmatrix}1&1\\0&1\end{bmatrix}$ relative to $\mathcal B=\{(1,1),(-1,1)\}$. Find its standard matrix and show that it preserves area.
  • 3 Population modelling. Each year $10\%$ of a city's residents move to the suburbs and $20\%$ of suburban residents move to the city; the total stays constant. With $\mathbf{x}_k=$ (city, suburbs) in thousands, $\mathbf{x}_{k+1}=M\mathbf{x}_k$, $M=\begin{bmatrix}0.9&0.2\\0.1&0.8\end{bmatrix}$. Find $[M]_{\mathcal B}$ for $\mathcal B=\{(2,1),(1,-1)\}$, then find $\mathbf{x}_{10}$ when $\mathbf{x}_0=(300,600)$, and the long-run populations.
  • 4 Let $T:V\to V$ be linear with $[T]_{\mathcal B}$ invertible. Show that $T$ is invertible and $[T^{-1}]_{\mathcal B}=\left([T]_{\mathcal B}\right)^{-1}$.
  • 5 $T:P_2\to\mathbb{R}^2$, $T(p)=\left(p(1),\,p(-1)\right)$. Find the matrix of $T$ (bases $\{1,x,x^2\}$ and standard) and use its null space to find $\ker T$.
1 $[F]_{\mathcal B}=\operatorname{diag}(1,-1)$, $P=\begin{bmatrix}1&-3\\3&1\end{bmatrix}$, $P^{-1}=\tfrac1{10}\begin{bmatrix}1&3\\-3&1\end{bmatrix}$: $\ A=P[F]_{\mathcal B}P^{-1}=\dfrac15\begin{bmatrix}-4&3\\3&4\end{bmatrix}$. Check: $A(1,3)=\tfrac15(5,15)=(1,3)$ โœ“.
2 $P=\begin{bmatrix}1&-1\\1&1\end{bmatrix}$, $P^{-1}=\tfrac12\begin{bmatrix}1&1\\-1&1\end{bmatrix}$: $A=P\begin{bmatrix}1&1\\0&1\end{bmatrix}P^{-1}=\begin{bmatrix}1&0\\1&2\end{bmatrix}\cdot\tfrac12\begin{bmatrix}1&1\\-1&1\end{bmatrix}=\dfrac12\begin{bmatrix}1&1\\-1&3\end{bmatrix}$. $\det A=\tfrac34+\tfrac14=1$, so areas are unchanged (Section 6.4).
3 $M(2,1)=(2,1)$ and $M(1,-1)=(0.7,-0.7)=0.7(1,-1)$, so $[M]_{\mathcal B}=\begin{bmatrix}1&0\\0&0.7\end{bmatrix}$. Write $\mathbf{x}_0=300(2,1)-300(1,-1)$. Then $\mathbf{x}_{10}=300(2,1)-300(0.7)^{10}(1,-1)\approx(591.53,\ 308.47)$ thousand people. As $k\to\infty$, $(0.7)^k\to0$, so the populations approach $(600,300)$ thousand โ€” city to suburbs $2:1$, the direction of $\mathbf{b}_1$.
4 Let $S:V\to V$ be the linear map with $[S]_{\mathcal B}=\left([T]_{\mathcal B}\right)^{-1}$ (define $S$ on coordinates). Then $[S(T(\mathbf{x}))]_{\mathcal B}=[T]_{\mathcal B}^{-1}[T]_{\mathcal B}[\mathbf{x}]_{\mathcal B}=[\mathbf{x}]_{\mathcal B}$, so $S(T(\mathbf{x}))=\mathbf{x}$, and similarly $T(S(\mathbf{x}))=\mathbf{x}$. Hence $S=T^{-1}$ and $[T^{-1}]_{\mathcal B}=[T]_{\mathcal B}^{-1}$.
5 Columns $T(1)=(1,1)$, $T(x)=(1,-1)$, $T(x^2)=(1,1)$: $\begin{bmatrix}1&1&1\\1&-1&1\end{bmatrix}$. Null space: $a_0+a_1+a_2=0$, $a_0-a_1+a_2=0$ give $a_1=0$, $a_0=-a_2$, spanned by $(-1,0,1)$. So $\ker T=\operatorname{span}\{x^2-1\}$ โ€” the quadratics with roots $\pm1$.
๐Ÿ”ฌ Researchโ€“Teaching NexusResearch-tutored ยท optional, about 30 minutes

Research question. How do structural engineers find the "principal axes" of stress in a loaded steel plate, and why does choosing that basis make the danger obvious?

Why it matters. The stress at a point of a thin plate (in a bridge gusset, an aircraft panel, a pressure vessel or a bone implant) is described by a symmetric $2\times2$ matrix $S$: it sends a direction to the force per unit area acting across a cut in that direction. In the standard $x,y$ axes $S$ has "shear" entries off the diagonal. In a basis of principal directions the matrix becomes diagonal, and its diagonal entries โ€” the principal stresses โ€” are what design codes compare with the strength of the material.

What to do.

  1. Sample case: a strain-gauge rosette on a plate gives $S=\begin{bmatrix}50&30\\30&-30\end{bmatrix}$ MPa.
  2. Check that $\mathbf{b}_1=(3,1)$ and $\mathbf{b}_2=(1,-3)$ satisfy $S\mathbf{b}_1=60\,\mathbf{b}_1$ and $S\mathbf{b}_2=-40\,\mathbf{b}_2$, and compute $[S]_{\mathcal B}=P^{-1}SP$.
  3. Find the angle between $\mathbf{b}_1$ and the $x$-axis. Draw the plate element turned through that angle, with the principal stresses on its faces.
  4. Verify Theorem 6.13: $\operatorname{tr}S$ and $\det S$ equal the sum and product of the principal stresses.
  5. Research how the Tresca or von Mises yield criteria use the principal stresses, and decide whether a steel with yield strength $250$ MPa is safe here.

Tools: Calculator; optionally Python/sympy or a spreadsheet to repeat for other readings

Hand in: A one-page note with $[S]_{\mathcal B}$, the principal angle, a sketch of the rotated element, and one sentence on safety.

Going further. The same idea appears as principal moments of inertia (spinning satellites and car crankshafts), principal strains in geology and earthquake studies, and principal components in data science (Section 8.4). The theorem that a symmetric matrix always has such an orthogonal basis is the Spectral Theorem.

Instructor note: $[S]_{\mathcal B}=\operatorname{diag}(60,-40)$ MPa; principal angle $\arctan\tfrac13\approx18.43^\circ$; $\operatorname{tr}S=20=60-40$, $\det S=-2400=60\cdot(-40)$. Maximum shear $\tfrac12(60-(-40))=50$ MPa; Tresca stress $100$ MPa, von Mises $\sqrt{60^2+60\cdot40+40^2}\approx87.2$ MPa โ€” both well below $250$ MPa.

๐Ÿงช Self-check quiz

0/5 correct

Q1. The $j$-th column of $[T]_{\mathcal C\leftarrow\mathcal B}$ is

Q2. A linear map $T:P_3\to P_2$ is represented, relative to bases of $P_3$ and $P_2$, by a matrix of size

Q3. $T(\mathbf{x})=A\mathbf{x}$ on $\mathbb{R}^n$ and $\mathcal B=\{\mathbf{b}_1,\dots,\mathbf{b}_n\}$. Then $[T]_{\mathcal B}=P^{-1}AP$ where

Q4. If $A$ and $B$ are similar, which of these must they share?

Q5. The matrix of $T(p)(x)=p(x+1)$ on $P_1$ relative to $\{1,x\}$ is