LINEAR ALGEBRA • LINEAR TRANSFORMATIONS

Composition of Transformations — Composition of Linear Transformations

Learn how combining two transformations into one reveals the power of matrix multiplication.

Historical Context & Motivation

Have you ever used a photo-editing app to rotate a picture and then flip it? You just performed two transformations, one after the other. Mathematicians call this process composition — combining two actions into a single action. The idea of composing transformations has deep roots in the history of mathematics, and it became one of the most important tools in modern science and technology.

1770s
Euler & Rotations
Leonhard Euler studied how combining two rotations in three-dimensional space always produces another rotation. This was an early example of composing geometric transformations.
1855
Cayley & Matrix Algebra
Arthur Cayley introduced matrix notation and showed that multiplying two matrices corresponds to composing two linear transformations. This linked algebra to geometry.
1888
Lie Groups
Sophus Lie formalized continuous groups of transformations, showing how smooth motions (like rotations and stretches) could be composed and studied systematically.
1950s–Today
Computer Graphics & AI
Modern video games, animated films, and artificial-intelligence systems rely on composing many linear transformations — rotations, scalings, and projections — to render 3-D worlds and process data.

The central question this lesson answers is: When you apply one linear transformation and then another, what single transformation does the same job? Understanding this lets you simplify chains of operations into one clean step, saving time and revealing hidden structure.

Core Principles & Definitions

Before we compose transformations, let's nail down a few building-block ideas. A transformation is any rule that takes an input (like a point or a vector) and produces an output. A linear transformation is a special kind that keeps lines straight and the origin fixed. Think of stretching, reflecting, rotating, or shearing a shape — these are all linear transformations.

1

Linear Transformation

A rule T that maps vectors to vectors while preserving addition and scalar multiplication: T(u + v) = T(u) + T(v) and T(cv) = cT(v).
2

Composition (S ∘ T)

Applying transformation T first, then transformation S to the result. Written (S ∘ T)(v) = S(T(v)). Read it right to left: T acts first.
3

Matrix Representation

Every linear transformation in ℝⁿ can be captured by a matrix. Composing two transformations corresponds to multiplying their matrices.
4

Order Matters

S ∘ T is usually NOT the same as T ∘ S. Just like putting on socks then shoes gives a different result from shoes then socks!
KEY TAKEAWAY
Think of composition like a factory assembly line. Station T bends a metal sheet, then Station S paints it. The finished product depends on which station the sheet visits first. Swapping the order — painting before bending — gives a completely different result. Composition chains actions in a specific order, and that order matters.

Visual Explanation

The diagram below shows how a vector v is first transformed by T (a 90° counter-clockwise rotation), producing T(v). Then S (a reflection across the x-axis) is applied to T(v), giving the final output S(T(v)). The single combined transformation S ∘ T takes v directly to the same final point.

The cyan arrow is the original vector v. The violet arrow shows the result after T (rotation). The pink arrow shows the final result after S (reflection). The gold matrix on the right is the single matrix for the composed transformation S ∘ T.

Notice how the original cyan vector at (2, 1) moves to (−1, 2) after the rotation T, and then to (−1, −2) after the reflection S. The gold matrix on the right side of the diagram is the product of the two individual matrices. Multiplying this single matrix by v gives (−1, −2) directly — no need to do two separate steps!

Mathematical Framework

Every linear transformation in ℝ² (the 2-D plane) can be written as a matrix. If T is represented by matrix A and S is represented by matrix B, then the composition S ∘ T is represented by the product B × A. Pay close attention to the order: because T acts first, its matrix A goes on the right.

COMPOSITION RULE
(S ∘ T)(v) = S(T(v)) = B(Av) = (BA)v
v = input vector, A = matrix for T, B = matrix for S, BA = matrix for the composed transformation S ∘ T.

Let's see why the order matters. Matrix multiplication is associative — meaning (BA)v = B(Av) — but it is generally not commutative, which means BA ≠ AB in most cases. So S ∘ T and T ∘ S usually give different results.

2 × 2 MATRIX MULTIPLICATION
[a b; c d] × [e f; g h] = [ae + bg, af + bh; ce + dg, cf + dh]
Each entry in the product is the dot product of a row from the left matrix and a column from the right matrix. Semicolons separate rows.
LINEARITY PRESERVED
(S ∘ T)(u + v) = (S ∘ T)(u) + (S ∘ T)(v) and (S ∘ T)(cv) = c(S ∘ T)(v)
The composition of two linear transformations is itself linear. This is a key property: composing linear maps always stays in the world of linear maps.
💡 Order Tip
When you see S ∘ T, read it right to left: "apply T first, then S." The matrix for the transformation that acts first goes on the right side of the product.

Detailed Breakdown — Common Compositions

Different pairs of transformations produce interesting combined effects. The diagram below illustrates three common compositions and the matrices that result from them. Understanding these patterns helps you predict what a composition will do before you compute it.

Three panels show different pairs of transformations being composed. Each panel displays the original shape (lighter), the result (darker), and the combined matrix. Notice that two reflections combine into a rotation!
Common composition results in ℝ²
First (T)Second (S)Composition S ∘ T
Rotate 90° CCWReflect over x-axisReflect over line y = −x
Scale by 2Rotate 90° CCWRotate 90° CCW and scale by 2
Reflect over x-axisReflect over y-axisRotate 180°
Rotate θRotate φRotate (θ + φ)

A particularly cool pattern: two rotations always compose into a single rotation whose angle is the sum of the two individual angles. And two reflections across different lines compose into a rotation by twice the angle between the lines.

Worked Example

Let's walk through a full example. Suppose T is a reflection over the y-axis and S is a rotation by 90° counter-clockwise. We want the matrix for S ∘ T and then apply it to the vector v = (3, 1).

Finding S ∘ T and Applying It to v = (3, 1)
1
Step 1 — Write the matrix for T (reflect over y-axis)Reflecting over the y-axis flips the x-coordinate. The matrix is A = [−1, 0; 0, 1]. This sends (x, y) to (−x, y).
A = [−1, 0; 0, 1]
2
Step 2 — Write the matrix for S (rotate 90° CCW)A 90° counter-clockwise rotation has the matrix B = [0, −1; 1, 0]. This sends (x, y) to (−y, x).
B = [0, −1; 1, 0]
3
Step 3 — Multiply B × A to get the composition matrixRow 1 of B dot column 1 of A: (0)(−1) + (−1)(0) = 0. Row 1 of B dot column 2 of A: (0)(0) + (−1)(1) = −1. Row 2 of B dot column 1 of A: (1)(−1) + (0)(0) = −1. Row 2 of B dot column 2 of A: (1)(0) + (0)(1) = 0.
BA = [0, −1; −1, 0]
4
Step 4 — Apply BA to v = (3, 1)Multiply [0, −1; −1, 0] × [3; 1]. First component: (0)(3) + (−1)(1) = −1. Second component: (−1)(3) + (0)(1) = −3.
(S ∘ T)(v) = (−1, −3)
5
Step 5 — Verify by doing T then S separatelyT(v) = A × (3, 1) = (−3, 1). Then S(T(v)) = B × (−3, 1) = (−1, −3). ✓ Same answer! The single matrix BA does the same job as applying T and then S one at a time.
Verified: (−1, −3) ✓

Strengths, Limitations & Comparisons

Composition of linear transformations is powerful, but it has boundaries. Let's compare it with doing transformations one at a time and see where each approach shines.

Comparing approaches to multiple transformations
FeatureOne-at-a-TimeComposition (Single Matrix)
Speed for many pointsSlow — each point goes through every matrix separatelyFast — multiply the combined matrix by each point once
Ease of setupEasy — just list the matricesRequires matrix multiplication first
Understanding intermediate stepsYou see each intermediate resultIntermediate results are hidden
Works for non-linear transforms?Yes — you can chain any functionsOnly works when both transformations are linear
Scalability (10+ transforms)Very slowVery efficient — multiply all matrices once, reuse the result
KEY TAKEAWAY
Imagine you're a chef who makes 100 pizzas per day. If each pizza needs three separate oven steps (bake base, add toppings, broil cheese), you could either run three oven cycles per pizza (300 total), or figure out one oven program that does all three steps at once (100 total). Composition is like designing that single program — upfront work to combine the steps pays off when you apply the result many times.

Connection to Advanced Theory

The idea of composing linear transformations grows into some of the most important topics you'll encounter later in mathematics. Here's a glimpse of where it leads.

From composition basics to advanced topics
This LessonAdvanced Extension
Composing two 2×2 matricesComposing n×n matrices for higher-dimensional spaces (3-D graphics, data science)
Order matters (BA ≠ AB)Group theory studies which sets of transformations can be composed and when order can be swapped (abelian groups)
Single matrix for S ∘ TMatrix decompositions (SVD, eigendecomposition) break a complex matrix into simpler composed parts
Linear transformations onlyAffine transformations add translations; handled by augmenting the matrix to 3×3 (or 4×4 in 3-D)

In computer graphics, a single frame of a video game might compose dozens of transformations — scaling a character model, rotating it to face the camera, and projecting it onto a flat screen. All of these are multiplied into one 4×4 matrix that is applied to thousands of points in the model. The concept you learned today is the engine behind that process.

Practice Problems

PROBLEM 1CONCEPTUAL
If T is a rotation by 45° and S is a rotation by 90°, describe what S ∘ T does geometrically. Is S ∘ T the same as T ∘ S in this case?
PROBLEM 2BASIC CALCULATION
Let A = [2, 0; 0, 3] (a scaling) and B = [1, 0; 0, −1] (a reflection over the x-axis). Find the matrix BA and apply it to the vector v = (1, 4).
PROBLEM 3INTERMEDIATE
T reflects vectors over the y-axis (matrix A = [−1, 0; 0, 1]) and S rotates by 90° counter-clockwise (matrix B = [0, −1; 1, 0]). Compute both BA and AB and show that they give different results when applied to v = (2, 5).
PROBLEM 4APPLIED
A game developer applies three transformations to a character sprite: first scale by 0.5 (shrink), then rotate 90° counter-clockwise, then reflect over the x-axis. Write each 2×2 matrix, compute the single combined matrix, and find where the point (4, 6) ends up.
PROBLEM 5CRITICAL THINKING
Prove that if T and S are both linear transformations, then their composition S ∘ T is also a linear transformation. (Hint: show that (S ∘ T)(u + v) = (S ∘ T)(u) + (S ∘ T)(v) and (S ∘ T)(cv) = c(S ∘ T)(v) using only the fact that S and T are each individually linear.)

Lesson Summary

The composition of linear transformations lets you combine two (or more) transformations into a single operation. If transformation T has matrix A and transformation S has matrix B, then the composed transformation S ∘ T has matrix BA (the product of B and A). The key rule is to read right to left: the transformation that acts first goes on the right in the matrix product.

Because matrix multiplication is not commutative, the order of composition matters — S ∘ T usually gives a different result from T ∘ S. However, the composition of two linear transformations is always linear, which means you stay in the world of matrices no matter how many transformations you chain together. This principle powers everything from video-game graphics to data science and robotics.

Varsity Tutors • Linear Algebra • Composition of Transformations — Composition of Linear Transformations