Linear Transformations
A linear transformation is a function T from ℝⁿ to ℝᵐ that keeps vector addition and scalar multiplication: T(u + v) = T(u) + T(v) and T(cu) = cT(u) for all vectors u, v and scalars c. To check one, test both properties with general vectors, or find one counterexample to show it is not linear.
Before this lesson: Matrix Equation Ax = b and Linear Combinations
What is a linear transformation?
A transformation T: ℝⁿ → ℝᵐ is a rule that assigns each vector x in ℝⁿ an output vector T(x) in ℝᵐ. The set ℝⁿ is the domain, ℝᵐ is the codomain, and T(x) is the image of x.
A transformation is linear when it respects the two vector operations. Adding inputs adds outputs, and scaling an input scales its output by the same factor. Geometrically, a linear transformation keeps the origin fixed, sends lines to lines (or to a single point) and sends every parallelogram to a parallelogram.
Definition of a linear transformation
T: ℝⁿ → ℝᵐ is linear if both properties hold for all u and v in ℝⁿ and every scalar c:
T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v}) \qquad T(c\mathbf{u}) = cT(\mathbf{u})Two facts follow right away. Setting c = 0 gives T(0) = 0, so a linear transformation always sends the zero vector to the zero vector. Combining the properties gives T(cu + dv) = cT(u) + dT(v), so T keeps every linear combination.
Every matrix transformation is linear. If T(x) = Ax for an m × n matrix A, then A(u + v) = Au + Av and A(cu) = c(Au), the properties of the matrix-vector product. The next lesson shows the converse: every linear transformation from ℝⁿ to ℝᵐ is a matrix transformation.
How to check whether a transformation is linear
- Check T(0) = 0. If T(0) ≠ 0, T is not linear, and you are done.
- Look at the formula. If each output entry is a sum of constants times input entries, with no constant terms, powers, products of variables or other functions, T can be written as T(x) = Ax and is linear.
- To prove linearity directly, write u = (u₁, …, uₙ) and v = (v₁, …, vₙ), then show T(u + v) = T(u) + T(v) and T(cu) = cT(u) with algebra.
- To prove T is not linear, find one specific u, v or c that breaks a property.
Passing the zero test is not enough: some nonlinear maps still send 0 to 0, as Example 3 shows. A few numerical checks that happen to work are not a proof either.
Linear transformation examples
Example 1: Prove a transformation is linear
Show that T(x₁, x₂) = (3x₁ − x₂, x₁ + 2x₂) is a linear transformation from ℝ² to ℝ².
T(\mathbf{u} + \mathbf{v}) = T(u_1 + v_1,\; u_2 + v_2)Add u = (u₁, u₂) and v = (v₁, v₂) entry by entry.
= (3(u_1 + v_1) - (u_2 + v_2),\; (u_1 + v_1) + 2(u_2 + v_2))
Apply the rule for T.
= (3u_1 - u_2 + 3v_1 - v_2,\; u_1 + 2u_2 + v_1 + 2v_2)
Distribute and regroup the terms (see the distributive property).
= (3u_1 - u_2,\; u_1 + 2u_2) + (3v_1 - v_2,\; v_1 + 2v_2)
Split into a u part and a v part.
= T(\mathbf{u}) + T(\mathbf{v})Each part is T of one input, so the first property holds.
T(c\mathbf{u}) = T(cu_1,\; cu_2)Multiply each entry of u by c.
= (3cu_1 - cu_2,\; cu_1 + 2cu_2)
Apply the rule for T.
= c(3u_1 - u_2,\; u_1 + 2u_2)
Factor out c.
= cT(\mathbf{u})The second property holds.
Answer: T is linear. In matrix form, T(x) = Ax with rows [3 −1] and [1 2].
Example 2: A translation is not linear
Is T(x₁, x₂) = (x₁ + 4, x₂) linear?
T(0, 0) = (0 + 4,\; 0)
Substitute the zero vector.
T(0, 0) = (4, 0)
Simplify.
(4, 0) \ne (0, 0)
A linear transformation must send 0 to 0.
Answer: T is not linear. It shifts every point 4 units right, and a shift moves the origin.
Example 3: Passing the zero test but not linear
Is T(x₁, x₂) = (x₁x₂, x₁) linear?
T(0, 0) = (0 \cdot 0,\; 0) = (0, 0)
The zero test passes, so look further.
\mathbf{u} = (1, 1),\; c = 2Try a simple input and scalar.
T(2\mathbf{u}) = T(2, 2) = (2 \cdot 2,\; 2) = (4, 2)Scale first, then apply T.
2T(\mathbf{u}) = 2(1 \cdot 1,\; 1) = (2, 2)Apply T first, then scale.
(4, 2) \ne (2, 2)
The two results differ.
Answer: T is not linear, because T(2u) ≠ 2T(u). The product x₁x₂ grows like c², not c, when the input is scaled.
Example 4: Use linearity to find an output
T: ℝ² → ℝ³ is linear, T(u) = (2, −1, 3) and T(v) = (0, 4, 1). Find T(3u − 2v).
T(3\mathbf{u} - 2\mathbf{v}) = 3T(\mathbf{u}) - 2T(\mathbf{v})T keeps linear combinations.
= 3(2, -1, 3) - 2(0, 4, 1)
Substitute the given outputs.
= (6, -3, 9) - (0, 8, 2)
Multiply each vector by its scalar.
= (6, -11, 7)
Subtract entry by entry: 6 − 0 = 6, −3 − 8 = −11 and 9 − 2 = 7.
Answer: T(3u − 2v) = (6, −11, 7). You never needed a formula for T, only its values on u and v.
Example 5: Ingredients for a bakery order
A bakery makes x₁ batches of muffins and x₂ batches of bread. Each muffin batch uses 2 cups of flour and 1 cup of sugar; each bread batch uses 5 cups of flour and 1 cup of sugar. So T(x₁, x₂) = (2x₁ + 5x₂, x₁ + x₂) gives (flour, sugar). Find the ingredients for the order (3, 2), and use linearity to find them for (3, 2) and (1, 4) combined.
T(3, 2) = (2 \cdot 3 + 5 \cdot 2,\; 3 + 2)
Substitute x₁ = 3 and x₂ = 2.
T(3, 2) = (16, 5)
Simplify: 6 + 10 = 16 cups of flour, 5 cups of sugar.
T(1, 4) = (2 \cdot 1 + 5 \cdot 4,\; 1 + 4) = (22, 5)
Substitute x₁ = 1 and x₂ = 4.
T(3, 2) + T(1, 4) = (16 + 22,\; 5 + 5) = (38, 10)
Add the two outputs, using T(u + v) = T(u) + T(v).
T(4, 6) = (2 \cdot 4 + 5 \cdot 6,\; 4 + 6) = (38, 10)
Check: the combined order is (4, 6).
Answer: the order (3, 2) needs 16 cups of flour and 5 cups of sugar; both orders together need 38 cups of flour and 10 cups of sugar. A fixed amount used every day no matter what is baked, like Example 2’s shift, would make T not linear.
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Stopping after the zero test | Calling T(x₁, x₂) = (x₁x₂, x₁) linear because T(0) = 0 | T(0) = 0 is necessary, not enough. Check both properties or find a counterexample. |
| Proving with one numerical example | Checking T(u + v) = T(u) + T(v) for u = (1, 2), v = (3, −1) and stopping | A proof needs general vectors u and v. One example can only disprove. |
| Calling y = mx + b linear | Treating T(x) = 3x + 2 as a linear transformation | T(0) = 2 ≠ 0. Only T(x) = mx is linear as a transformation. |
| Mixing up the domain and codomain | Saying a 3 × 2 matrix A gives T: ℝ³ → ℝ² | A is m × n gives T: ℝⁿ → ℝᵐ. A 3 × 2 matrix takes inputs in ℝ² to outputs in ℝ³. |
| Scaling a nonlinear term like a linear one | Writing T(cu) = (c·u₁u₂, cu₁) for Example 3 | (cu₁)(cu₂) = c²u₁u₂, so the first entry scales by c². |
Related ideas
Geometric transformations. Rotations about the origin, reflections across lines through the origin and dilations are linear; translations are not. See matrix transformations for rotation and reflection matrices in the plane, and compare with the geometry lesson on translations.
Standard matrix. Because T keeps linear combinations, its values on the vectors (1, 0, …, 0), …, (0, …, 0, 1) determine T completely. The next lesson, Standard Matrix of a Linear Transformation, turns those values into a matrix.
Practice problems
- Is T(x₁, x₂) = (x₁ − 5x₂, 4x₁) linear?
- Is T(x₁, x₂) = (x₁, x₂ − 3) linear?
- Is T(x₁, x₂) = (x₁², x₂) linear?
- Is T(x₁, x₂, x₃) = (x₁ + x₃, 2x₂) linear? Give its domain and codomain.
- Is T(x) = |x|, from ℝ to ℝ, linear?
- T is linear, T(u) = (1, 4) and T(v) = (−2, 3). Find T(2u + 5v).
- T is linear and T(u) = (3, −1, 2). Find T(−4u) and T(0).
- T(x) = Ax, where A has rows [1 2], [0 −1] and [3 1]. Give the domain and codomain, then find T(2, −1).
- For T(x₁, x₂) = (2x₁ + x₂, x₁ − x₂), check T(u + v) = T(u) + T(v) for u = (1, 2) and v = (3, −1). Does this check prove T is linear?
- A phone plan charges $15 a month plus $0.10 per minute, so C(x) = 0.10x + 15 for x minutes. Is C a linear transformation?
Show answers
1.
T(x_1, x_2) = \begin{bmatrix} 1 & -5 \\ 4 & 0 \end{bmatrix}\begin{bmatrix} x_1 \\ x_2 \end{bmatrix}Each entry is a sum of constants times x₁ and x₂ with no constant term, so write T as Ax.
Answer: yes. T is a matrix transformation, and every matrix transformation is linear.
2.
T(0, 0) = (0,\; 0 - 3) = (0, -3)
Substitute the zero vector.
Answer: no, because T(0) = (0, −3) ≠ 0.
3.
T(2(1, 0)) = T(2, 0) = (4, 0)
Take u = (1, 0) and c = 2; scale first, then apply T.
2T(1, 0) = 2(1, 0) = (2, 0)
Apply T first, then scale.
Answer: no, because T(2u) = (4, 0) ≠ (2, 0) = 2T(u).
4.
T(\mathbf{x}) = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 2 & 0 \end{bmatrix}\begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix}Write T as Ax with a 2 × 3 matrix.
Answer: yes, T is linear. Its domain is ℝ³ and its codomain is ℝ².
5.
T(-1 \cdot 1) = T(-1) = 1
Take u = 1 and c = −1; |−1| = 1.
-1 \cdot T(1) = -1 \cdot 1 = -1
Apply T first, then scale.
Answer: no, because T(−1) = 1 but −1·T(1) = −1.
6.
T(2\mathbf{u} + 5\mathbf{v}) = 2T(\mathbf{u}) + 5T(\mathbf{v})T keeps linear combinations.
= 2(1, 4) + 5(-2, 3)
Substitute the given outputs.
= (2, 8) + (-10, 15)
Multiply each vector by its scalar.
= (-8, 23)
Add entry by entry: 2 − 10 = −8 and 8 + 15 = 23.
Answer: T(2u + 5v) = (−8, 23).
7.
T(-4\mathbf{u}) = -4T(\mathbf{u}) = -4(3, -1, 2)Use T(cu) = cT(u).
= (-12, 4, -8)
Multiply each entry by −4.
T(\mathbf{0}) = \mathbf{0}Every linear transformation sends 0 to 0.
Answer: T(−4u) = (−12, 4, −8) and T(0) = (0, 0, 0).
8.
A \text{ is } 3 \times 2A has 3 rows and 2 columns, so T: ℝ² → ℝ³.
T(2, -1) = (1 \cdot 2 + 2(-1),\; 0 \cdot 2 + (-1)(-1),\; 3 \cdot 2 + 1(-1))
Multiply each row of A by (2, −1).
T(2, -1) = (0, 1, 5)
Simplify: 2 − 2 = 0, 0 + 1 = 1 and 6 − 1 = 5.
Answer: domain ℝ², codomain ℝ³, and T(2, −1) = (0, 1, 5).
9.
\mathbf{u} + \mathbf{v} = (4, 1)Add entry by entry.
T(4, 1) = (2 \cdot 4 + 1,\; 4 - 1) = (9, 3)
Apply T to the sum.
T(1, 2) = (2 + 2,\; 1 - 2) = (4, -1)
Apply T to u.
T(3, -1) = (6 - 1,\; 3 + 1) = (5, 4)
Apply T to v.
(4, -1) + (5, 4) = (9, 3)
Add the outputs; the results match.
Answer: the check works, but one example does not prove linearity. T is linear because it equals Ax with rows [2 1] and [1 −1].
10.
C(0) = 0.10(0) + 15 = 15
Substitute x = 0.
Answer: no. C(0) = 15 ≠ 0 because of the $15 monthly fee. Only the per-minute part, 0.10x, is linear.
Linear transformations FAQ
What is a linear transformation?
It is a function T from ℝⁿ to ℝᵐ with T(u + v) = T(u) + T(v) and T(cu) = cT(u) for all vectors u, v and scalars c.
How do you prove a transformation is linear?
Use general vectors u = (u₁, …, uₙ) and v = (v₁, …, vₙ) and a scalar c, then show both properties with algebra. Writing T(x) = Ax for a matrix A also proves it.
Is a translation a linear transformation?
No. A translation by a nonzero vector moves the origin, but every linear transformation sends 0 to 0.
What is the difference between a linear function and a linear transformation?
The graph of y = mx + b is a line, but the function is a linear transformation only when b = 0. Linear transformations must satisfy T(0) = 0.
Summary
- T: ℝⁿ → ℝᵐ is linear when T(u + v) = T(u) + T(v) and T(cu) = cT(u).
- Every linear transformation has T(0) = 0 and keeps linear combinations: T(cu + dv) = cT(u) + dT(v).
- Every matrix transformation T(x) = Ax is linear; an m × n matrix maps ℝⁿ to ℝᵐ.
- To show T is not linear, find one counterexample; T(0) ≠ 0 is the quickest one.
- Constant terms, powers, products of variables and absolute values usually make a map nonlinear.
Previous lesson: Linear Independence
Next lesson: Standard Matrix of a Linear Transformation
Back to the Linear Algebra Index