Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Find the Matrix of a Linear Transformation

Every linear map T:Rn→RmT: \mathbb{R}^n \to \mathbb{R}^m is multiplication by an m×nm \times n matrix. Its jj-th column is T(ej)T(\mathbf{e}_j), the image of the jj-th standard basis vector.

Recognize the task

A linear map given by a formula, by a geometric description, or by its values on a few vectors, and the question asks for its matrix: T(x,y,z)=(x+2z, 3x−y)T(x, y, z) = (x + 2z, \ 3x - y); "T(1,1)=(3,1)T(1, 1) = (3, 1) and T(1,−1)=(1,5)T(1, -1) = (1, 5)"; differentiation on polynomials. Test: fix the shape first, with rows for the output dimension and columns for the input dimension.
The recipe is Constructing the Standard Matrix; the result is the standard matrix.

Ways to do it

Images of the standard basisformula given
A=[ T(e1) T(e2) ⋯ T(en) ]A = [\,T(\mathbf{e}_1) \ T(\mathbf{e}_2) \ \cdots \ T(\mathbf{e}_n)\,]
Works for any description of TT you can evaluate.
Images of another basisvalues on a basis given
A=[ T(b1) ⋯ T(bn) ] B−1A = [\,T(\mathbf{b}_1) \ \cdots \ T(\mathbf{b}_n)\,]\,B^{-1}
Here B=[ b1 ⋯ bn ]B = [\,\mathbf{b}_1 \ \cdots \ \mathbf{b}_n\,]. It works because a linear map is determined by its action on a basis.
Abstract spacespolynomials, matrices
[T]C←B=[ [T(b1)]C ⋯ [T(bn)]C ][T]_{\mathcal{C} \leftarrow \mathcal{B}} = [\,[T(\mathbf{b}_1)]_\mathcal{C} \ \cdots \ [T(\mathbf{b}_n)]_\mathcal{C}\,]
The columns are coordinate vectors of the images; see matrices for abstract bases.

Steps

StepOn T(x,y,z)=(x+2z, 3x−y)T(x, y, z) = (x + 2z, \ 3x - y)
1Fix the shape. Inputs in Rn\mathbb{R}^n and outputs in Rm\mathbb{R}^m give an m×nm \times n matrix.R3→R2\mathbb{R}^3 \to \mathbb{R}^2: 2×32 \times 3
2Apply TT to each standard basis vector. Put a 11 in one input slot and 00 in the others.T(e1)=(1,3)T(\mathbf{e}_1) = (1, 3), T(e2)=(0,−1)T(\mathbf{e}_2) = (0, -1), T(e3)=(2,0)T(\mathbf{e}_3) = (2, 0)
3Write the images as columns. Column jj is T(ej)T(\mathbf{e}_j), in order; then T acts as multiplication by A.A=(1023−10)A = \begin{pmatrix} 1 & 0 & 2 \\ 3 & -1 & 0 \end{pmatrix}
4Check on a test vector. Compare AxA\mathbf{x} with the formula for one vector whose entries are all nonzero.A(1,1,1)=(3,2)=T(1,1,1)A(1, 1, 1) = (3, 2) = T(1, 1, 1) ✓

Worked examples

Example 1 · read the coefficients

2×2
T(x,y)=(3x−y, x+4y)T(x, y) = (3x - y, \ x + 4y)
row ii holds output ii
A=(3−114)A = \begin{pmatrix} 3 & -1 \\ 1 & 4 \end{pmatrix}
columns T(e1)T(\mathbf{e}_1), T(e2)T(\mathbf{e}_2)

Example 2 · values on a non-standard basis

times B inverse
T(1,1)=(3,1)T(1, 1) = (3, 1), T(1,−1)=(1,5)T(1, -1) = (1, 5); B=(111−1)B = \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}
A=(3115)B−1=(3115)12(111−1)A = \begin{pmatrix} 3 & 1 \\ 1 & 5 \end{pmatrix}B^{-1} = \begin{pmatrix} 3 & 1 \\ 1 & 5 \end{pmatrix}\frac{1}{2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}
A=(213−2)A = \begin{pmatrix} 2 & 1 \\ 3 & -2 \end{pmatrix}; check A(1,−1)=(1,5)A(1, -1) = (1, 5) ✓

Example 3 · polynomials

abstract space
T(p)=p′+pT(p) = p' + p on polynomials of degree ≤2\le 2, basis {1,x,x2}\{1, x, x^2\}
T(1)=1T(1) = 1, T(x)=1+xT(x) = 1 + x, T(x2)=2x+x2T(x^2) = 2x + x^2
images of the basis
[T]=(110012001)[T] = \begin{pmatrix} 1 & 1 & 0 \\ 0 & 1 & 2 \\ 0 & 0 & 1 \end{pmatrix}
coordinates as columns
[T](3,−1,2)=(2,3,2)[T](3, -1, 2) = (2, 3, 2): T(3−x+2x2)=2+3x+2x2T(3 - x + 2x^2) = 2 + 3x + 2x^2 ✓
check on a test polynomial
Multiply out your matrix in the matrix calculator.

See it happen

Every vector is a combination x1e1+⋯+xnenx_1\mathbf{e}_1 + \cdots + x_n\mathbf{e}_n, and a linear map keeps combinations: T(x)=x1T(e1)+⋯+xnT(en)T(\mathbf{x}) = x_1T(\mathbf{e}_1) + \cdots + x_nT(\mathbf{e}_n). That sum is exactly the matrix-vector product with the images as columns, so knowing where the basis vectors land tells you where everything lands. In the linear transformation 2D visualizer, the two columns are the arrows where e1\mathbf{e}_1 and e2\mathbf{e}_2 end up.

Common mistakes

Images as rows

✗ A=(130−120)A = \begin{pmatrix} 1 & 3 \\ 0 & -1 \\ 2 & 0 \end{pmatrix}
✓ A=(1023−10)A = \begin{pmatrix} 1 & 0 & 2 \\ 3 & -1 & 0 \end{pmatrix}: the images go in columns
The 3×23 \times 2 array cannot multiply a vector of R3\mathbb{R}^3.

Using the given images as the matrix

✗ A=(3115)A = \begin{pmatrix} 3 & 1 \\ 1 & 5 \end{pmatrix} from T(1,1)T(1, 1) and T(1,−1)T(1, -1)
✓ that product is ABAB; the standard matrix is AB⋅B−1=(213−2)AB \cdot B^{-1} = \begin{pmatrix} 2 & 1 \\ 3 & -2 \end{pmatrix}

Putting the inverse on the wrong side

✗ A=B−1[ T(b1) T(b2) ]A = B^{-1}[\,T(\mathbf{b}_1) \ T(\mathbf{b}_2)\,]
✓ A=[ T(b1) T(b2) ]B−1A = [\,T(\mathbf{b}_1) \ T(\mathbf{b}_2)\,]B^{-1}, from AB=[ T(b1) T(b2) ]AB = [\,T(\mathbf{b}_1) \ T(\mathbf{b}_2)\,]

A matrix for a map that is not linear

✗ T(x,y)=(x+1,y)T(x, y) = (x + 1, y) has matrix (1001)\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}
✓ TT is not linear, so no matrix represents it; run the linearity check first