← Back to linear algebra 1

Linear Transformations

Linear transformations are functions between vector spaces that preserve vector addition and scalar multiplication. They form the foundation for understanding linear algebra geometrically.

Definition of Linear Transformation

Definition (Linear Transformation):
A function T:RnRmT: \mathbb{R}^n \to \mathbb{R}^m is a linear transformation if for all vectors u,v\vec{u}, \vec{v} in Rn\mathbb{R}^n and all scalars cc:

  1. Additivity: T(u+v)=T(u)+T(v)T(\vec{u} + \vec{v}) = T(\vec{u}) + T(\vec{v})
  2. Homogeneity: T(cu)=cT(u)T(c\vec{u}) = cT(\vec{u})

These properties can be combined into one:

Equivalent Definition:
TT is linear if for all u,v\vec{u}, \vec{v} in Rn\mathbb{R}^n and scalars c,dc, d: T(cu+dv)=cT(u)+dT(v)T(c\vec{u} + d\vec{v}) = cT(\vec{u}) + dT(\vec{v})

Intuition: Linear transformations "respect" the structure of vector spaces—they play nicely with addition and scaling.

Example 1: A Linear Transformation

Define T:R2R2T: \mathbb{R}^2 \to \mathbb{R}^2 by T[xy]=[2xx+y]T\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 2x \\ x + y \end{bmatrix}.

Check additivity: Let u=[x1y1]\vec{u} = \begin{bmatrix} x_1 \\ y_1 \end{bmatrix} and v=[x2y2]\vec{v} = \begin{bmatrix} x_2 \\ y_2 \end{bmatrix}.

T(u+v)=T[x1+x2y1+y2]=[2(x1+x2)(x1+x2)+(y1+y2)]=[2x1+2x2(x1+y1)+(x2+y2)]T(\vec{u} + \vec{v}) = T\begin{bmatrix} x_1 + x_2 \\ y_1 + y_2 \end{bmatrix} = \begin{bmatrix} 2(x_1 + x_2) \\ (x_1 + x_2) + (y_1 + y_2) \end{bmatrix} = \begin{bmatrix} 2x_1 + 2x_2 \\ (x_1 + y_1) + (x_2 + y_2) \end{bmatrix}

T(u)+T(v)=[2x1x1+y1]+[2x2x2+y2]=[2x1+2x2(x1+y1)+(x2+y2)]T(\vec{u}) + T(\vec{v}) = \begin{bmatrix} 2x_1 \\ x_1 + y_1 \end{bmatrix} + \begin{bmatrix} 2x_2 \\ x_2 + y_2 \end{bmatrix} = \begin{bmatrix} 2x_1 + 2x_2 \\ (x_1 + y_1) + (x_2 + y_2) \end{bmatrix}

They're equal! ✓

T(cu)=T[cx1cy1]=[2(cx1)cx1+cy1]=[c(2x1)c(x1+y1)]=c[2x1x1+y1]=cT(u)T(c\vec{u}) = T\begin{bmatrix} cx_1 \\ cy_1 \end{bmatrix} = \begin{bmatrix} 2(cx_1) \\ cx_1 + cy_1 \end{bmatrix} = \begin{bmatrix} c(2x_1) \\ c(x_1 + y_1) \end{bmatrix} = c\begin{bmatrix} 2x_1 \\ x_1 + y_1 \end{bmatrix} = cT(\vec{u})

Example 2: Not a Linear Transformation

Define T:R2R2T: \mathbb{R}^2 \to \mathbb{R}^2 by T[xy]=[x+1y]T\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} x + 1 \\ y \end{bmatrix}.

Test additivity: Let u=[10]\vec{u} = \begin{bmatrix} 1 \\ 0 \end{bmatrix} and v=[20]\vec{v} = \begin{bmatrix} 2 \\ 0 \end{bmatrix}.

T(u+v)=T[30]=[40]T(\vec{u} + \vec{v}) = T\begin{bmatrix} 3 \\ 0 \end{bmatrix} = \begin{bmatrix} 4 \\ 0 \end{bmatrix}

T(u)+T(v)=[20]+[30]=[50]T(\vec{u}) + T(\vec{v}) = \begin{bmatrix} 2 \\ 0 \end{bmatrix} + \begin{bmatrix} 3 \\ 0 \end{bmatrix} = \begin{bmatrix} 5 \\ 0 \end{bmatrix}

Not equal! So TT is not linear.

Any transformation of the form T(x)=Ax+bT(\vec{x}) = A\vec{x} + \vec{b} where b0\vec{b} \neq \vec{0} is not linear. These are called affine transformations.

Why? Check T(0)T(\vec{0}):

  • If TT is linear: T(0)=T(0v)=0T(v)=0T(\vec{0}) = T(0 \cdot \vec{v}) = 0 \cdot T(\vec{v}) = \vec{0}
  • For affine: T(0)=A0+b=b0T(\vec{0}) = A\vec{0} + \vec{b} = \vec{b} \neq \vec{0}

Key property: Linear transformations always map the zero vector to the zero vector.


Matrix Transformations

Definition (Matrix Transformation):
For any m×nm \times n matrix AA, the function T:RnRmT: \mathbb{R}^n \to \mathbb{R}^m defined by: T(x)=AxT(\vec{x}) = A\vec{x} is called a matrix transformation.

Key fact: Every matrix transformation is a linear transformation (we proved this in Note 05).

Example 3: Rotation Matrix

The transformation T:R2R2T: \mathbb{R}^2 \to \mathbb{R}^2 that rotates vectors counterclockwise by angle θ\theta is given by:

T(x)=[cosθsinθsinθcosθ]xT(\vec{x}) = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}\vec{x}

For θ=90°\theta = 90° (rotate by 90°):

A=[0110]A = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}

T[10]=[01],T[01]=[10]T\begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \end{bmatrix}, \quad T\begin{bmatrix} 0 \\ 1 \end{bmatrix} = \begin{bmatrix} -1 \\ 0 \end{bmatrix}

The unit vectors rotate 90° counterclockwise!

Example 4: Projection Matrix

The transformation that projects vectors in R2\mathbb{R}^2 onto the xx-axis:

T[xy]=[x0]=[1000][xy]T\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} x \\ 0 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix}

Matrix: A=[1000]A = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}

Example 5: Scaling Matrix

The transformation that stretches by factor kk in all directions:

T(x)=kx=[k000k000k]xT(\vec{x}) = k\vec{x} = \begin{bmatrix} k & 0 & \cdots & 0 \\ 0 & k & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & k \end{bmatrix}\vec{x}

Matrix: A=kInA = kI_n (scalar multiple of identity)


Standard Matrix Representation

Big question: Is every linear transformation a matrix transformation?

Theorem (Standard Matrix Representation):
Every linear transformation T:RnRmT: \mathbb{R}^n \to \mathbb{R}^m can be represented as T(x)=AxT(\vec{x}) = A\vec{x} for some m×nm \times n matrix AA.

The matrix AA is called the standard matrix for TT.

How to find the standard matrix:

Recipe:
Let e1,e2,,en\vec{e}_1, \vec{e}_2, \ldots, \vec{e}_n be the standard basis vectors of Rn\mathbb{R}^n. Then: A=[T(e1)T(e2)T(en)]A = \begin{bmatrix} T(\vec{e}_1) & T(\vec{e}_2) & \cdots & T(\vec{e}_n) \end{bmatrix}

The columns of AA are the images of the standard basis vectors.

Why this works: Any vector x=[x1x2xn]\vec{x} = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} can be written as: x=x1e1+x2e2++xnen\vec{x} = x_1\vec{e}_1 + x_2\vec{e}_2 + \cdots + x_n\vec{e}_n

By linearity: T(x)=T(x1e1+x2e2++xnen)=x1T(e1)+x2T(e2)++xnT(en)T(\vec{x}) = T(x_1\vec{e}_1 + x_2\vec{e}_2 + \cdots + x_n\vec{e}_n) = x_1T(\vec{e}_1) + x_2T(\vec{e}_2) + \cdots + x_nT(\vec{e}_n)

This is exactly AxA\vec{x} where AA has columns T(e1),,T(en)T(\vec{e}_1), \ldots, T(\vec{e}_n)!

Example 6: Finding the Standard Matrix

Let T:R2R3T: \mathbb{R}^2 \to \mathbb{R}^3 be defined by: T[xy]=[2xyx3y]T\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 2x - y \\ x \\ 3y \end{bmatrix}

Find the standard matrix for TT.

Solution: Compute T(e1)T(\vec{e}_1) and T(e2)T(\vec{e}_2):

T[10]=[2(1)013(0)]=[210]T\begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 2(1) - 0 \\ 1 \\ 3(0) \end{bmatrix} = \begin{bmatrix} 2 \\ 1 \\ 0 \end{bmatrix}

T[01]=[2(0)103(1)]=[103]T\begin{bmatrix} 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 2(0) - 1 \\ 0 \\ 3(1) \end{bmatrix} = \begin{bmatrix} -1 \\ 0 \\ 3 \end{bmatrix}

Standard matrix: A=[211003]A = \begin{bmatrix} 2 & -1 \\ 1 & 0 \\ 0 & 3 \end{bmatrix}

Verification: A[xy]=[2xyx3y]A\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 2x - y \\ x \\ 3y \end{bmatrix}

Example 7: Reflection Across a Line

Let T:R2R2T: \mathbb{R}^2 \to \mathbb{R}^2 reflect vectors across the line y=xy = x.

Find the standard matrix.

Solution: Figure out where the standard basis vectors go:

Standard matrix: A=[0110]A = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}

Rotation by angle θ\theta: [cosθsinθsinθcosθ]\begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}

Reflection across xx-axis: [1001]\begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}

Reflection across yy-axis: [1001]\begin{bmatrix} -1 & 0 \\ 0 & 1 \end{bmatrix}

Scaling by factor kk: [k00k]\begin{bmatrix} k & 0 \\ 0 & k \end{bmatrix}

Horizontal stretch by aa, vertical stretch by bb: [a00b]\begin{bmatrix} a & 0 \\ 0 & b \end{bmatrix}

Shear (horizontal): [1k01]\begin{bmatrix} 1 & k \\ 0 & 1 \end{bmatrix}


Practice Problems

Determine if T:R2R2T: \mathbb{R}^2 \to \mathbb{R}^2 defined by T[xy]=[xyx+y]T\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} xy \\ x + y \end{bmatrix} is linear.

Test either additivity or homogeneity with specific examples.

Test homogeneity: Let u=[11]\vec{u} = \begin{bmatrix} 1 \\ 1 \end{bmatrix} and c=2c = 2.

T(cu)=T[22]=[222+2]=[44]T(c\vec{u}) = T\begin{bmatrix} 2 \\ 2 \end{bmatrix} = \begin{bmatrix} 2 \cdot 2 \\ 2 + 2 \end{bmatrix} = \begin{bmatrix} 4 \\ 4 \end{bmatrix}

cT(u)=2T[11]=2[111+1]=2[12]=[24]cT(\vec{u}) = 2T\begin{bmatrix} 1 \\ 1 \end{bmatrix} = 2\begin{bmatrix} 1 \cdot 1 \\ 1 + 1 \end{bmatrix} = 2\begin{bmatrix} 1 \\ 2 \end{bmatrix} = \begin{bmatrix} 2 \\ 4 \end{bmatrix}

Not equal! Answer: Not linear.

The problem is the xyxy term—multiplying components is not a linear operation.

Find the standard matrix for T:R3R2T: \mathbb{R}^3 \to \mathbb{R}^2 defined by: T[xyz]=[x2y+z3x+y]T\begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} x - 2y + z \\ 3x + y \end{bmatrix}

Compute T(e1)T(\vec{e}_1), T(e2)T(\vec{e}_2), and T(e3)T(\vec{e}_3).

T[100]=[10+03+0]=[13]T\begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 - 0 + 0 \\ 3 + 0 \end{bmatrix} = \begin{bmatrix} 1 \\ 3 \end{bmatrix}

T[010]=[02+00+1]=[21]T\begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 - 2 + 0 \\ 0 + 1 \end{bmatrix} = \begin{bmatrix} -2 \\ 1 \end{bmatrix}

T[001]=[00+10+0]=[10]T\begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 0 - 0 + 1 \\ 0 + 0 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \end{bmatrix}

Standard matrix: A=[121310]A = \begin{bmatrix} 1 & -2 & 1 \\ 3 & 1 & 0 \end{bmatrix}

Find the standard matrix for the transformation that reflects vectors in R2\mathbb{R}^2 across the xx-axis.

Where do [10]\begin{bmatrix} 1 \\ 0 \end{bmatrix} and [01]\begin{bmatrix} 0 \\ 1 \end{bmatrix} go under this reflection?

Reflection across xx-axis:

  • [10]\begin{bmatrix} 1 \\ 0 \end{bmatrix} stays at [10]\begin{bmatrix} 1 \\ 0 \end{bmatrix} (already on xx-axis)
  • [01]\begin{bmatrix} 0 \\ 1 \end{bmatrix} goes to [01]\begin{bmatrix} 0 \\ -1 \end{bmatrix} (flip across xx-axis)

Standard matrix: A=[1001]A = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}

Verification: [1001][xy]=[xy]\begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} x \\ -y \end{bmatrix} (flips yy-coordinate) ✓

If T:R2R2T: \mathbb{R}^2 \to \mathbb{R}^2 has standard matrix A=[2003]A = \begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix}, describe geometrically what TT does.

See what happens to the standard basis vectors.

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

T[01]=[03]=3[01]T\begin{bmatrix} 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 0 \\ 3 \end{bmatrix} = 3\begin{bmatrix} 0 \\ 1 \end{bmatrix}

Geometric interpretation: TT stretches vectors by factor 2 in the xx-direction and by factor 3 in the yy-direction. This is called a non-uniform scaling.

For example: T[11]=[23]T\begin{bmatrix} 1 \\ 1 \end{bmatrix} = \begin{bmatrix} 2 \\ 3 \end{bmatrix}


Summary

Key insight: Linear transformations and matrices are two sides of the same coin—every linear transformation is a matrix transformation, and every matrix defines a linear transformation.