Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Linear Transformations






Functions That Preserve Linear Structure

A linear transformation is a function between vector spaces that respects addition and scalar multiplication. Every matrix defines one, and every linear transformation between finite-dimensional spaces can be encoded as a matrix. This correspondence is the bridge between abstract maps and concrete computation — it turns geometric questions into algebraic ones and algebraic results into geometric insight.



What a Linear Transformation Is

A linear transformation is a function T:V→WT: V \to W between vector spaces that preserves the two fundamental operations. For all vectors u,v∈V\mathbf{u}, \mathbf{v} \in V and all scalars c,dc, d:

Linear Transformation Definition
T(cu+dv)=cT(u)+dT(v)T(c\mathbf{u} + d\mathbf{v}) = cT(\mathbf{u}) + dT(\mathbf{v})
Learn more about this formula: Linear Transformation Definition →


This single condition packages two requirements: TT preserves addition (T(u+v)=T(u)+T(v)T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v})) and TT preserves scalar multiplication (T(cv)=cT(v)T(c\mathbf{v}) = cT(\mathbf{v})). A function satisfying both is called linear. A function violating either is not.

The space VV is the domain and WW is the codomain, both vector spaces over the same field. The terms "linear map," "linear operator" (when V=WV = W), and "linear transformation" are all synonymous. The full set of properties that linearity entails — and the strategies for verifying or disproving it — are developed on their own page.

Examples in Rⁿ

The prototypical example is matrix multiplication: T(x)=AxT(\mathbf{x}) = A\mathbf{x} for a fixed m×nm \times n matrix AA. Linearity follows from the distributive properties of matrix-vector multiplication: A(cu+dv)=cAu+dAvA(c\mathbf{u} + d\mathbf{v}) = cA\mathbf{u} + dA\mathbf{v}.

Several familiar operations are special cases. The zero transformation T(v)=0T(\mathbf{v}) = \mathbf{0} sends every vector to the origin — it corresponds to the zero matrix. The identity transformation T(v)=vT(\mathbf{v}) = \mathbf{v} leaves every vector unchanged — it corresponds to the identity matrix. The projection T(x,y)=(x,0)T(x, y) = (x, 0) drops the second coordinate — it corresponds to (1000)\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}. Rotation by a fixed angle θ\theta in R2\mathbb{R}^2 is linear, with matrix (cos⁡θ−sin⁡θsin⁡θcos⁡θ)\begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}.

In each case, linearity can be verified directly from the definition. The matrix formulation makes the verification automatic — every matrix-vector product is linear by construction.

Non-Examples

Translation T(v)=v+bT(\mathbf{v}) = \mathbf{v} + \mathbf{b} with b≠0\mathbf{b} \neq \mathbf{0} is the most common non-example. It fails immediately: T(0)=b≠0T(\mathbf{0}) = \mathbf{b} \neq \mathbf{0}, but every linear transformation must send 0\mathbf{0} to 0\mathbf{0}.

Pitfall: Trusting the zero test alone
Calling T(x,y)=(x,xy)T(x, y) = (x, xy) linear because T(0)=0T(\mathbf{0}) = \mathbf{0} skips the real test: T(2(1,1))=(2,4)T(2(1, 1)) = (2, 4), but 2T(1,1)=(2,2)2T(1, 1) = (2, 2). Passing the zero test does not prove linearity, and this map is not linear.

The squaring function T(x)=x2T(x) = x^2 from R\mathbb{R} to R\mathbb{R} fails additivity: T(1+1)=4T(1 + 1) = 4 but T(1)+T(1)=2T(1) + T(1) = 2. The absolute value function T(x)=∣x∣T(x) = |x| fails homogeneity: T(−1⋅2)=2T(-1 \cdot 2) = 2 but −1⋅T(2)=−2-1 \cdot T(2) = -2. Norms T(v)=∥v∥T(\mathbf{v}) = \|\mathbf{v}\| fail additivity by the triangle inequality.

RULE
Affine maps T(v)=Av+bT(\mathbf{v}) = A\mathbf{v} + \mathbf{b} are linear only when b=0\mathbf{b} = \mathbf{0}.

The matrix part preserves linearity; the constant shift breaks it. Affine maps are important in geometry and optimization, but they are not linear transformations in the sense used here.

Fact: One dimension up, translation is linear
The shear (x,y,z)↦(x+b1z,  y+b2z,  z)(x, y, z) \mapsto (x + b_1 z, \; y + b_2 z, \; z) of R3\mathbb{R}^3 is linear, and on the plane z=1z = 1 it acts as the translation by (b1,b2)(b_1, b_2). Graphics software moves 3D objects the same way, with 4×44 \times 4 matrices.

The failure of translation is a real inconvenience in practice. Computer graphics, robotics and surveying all rotate, scale and move objects, and rotations and scalings combine neatly as matrix products, while a translation can never be written as AvA\mathbf{v}, since A0=0A\mathbf{0} = \mathbf{0} for every matrix. A long chain of such steps would then have to carry a matrix and a separate shift vector through every product. One way around this is an extra coordinate: the point (x,y)(x, y) of the plane is stored as (x,y,1)(x, y, 1) in R3\mathbb{R}^3.
Transformation Failed property Demonstration
Translation T(v) = v + b, b ≠ 0 T(0) = 0 test T(0) = b ≠ 0
Squaring T(x) = x² additivity T(1 + 1) = 4, but T(1) + T(1) = 2
Absolute value T(x) = |x| homogeneity (scalar mult.) T(−1 · 2) = 2, but −1 · T(2) = −2
Norm T(v) = ‖v‖ additivity (triangle inequality) ‖u + v‖ ≤ ‖u‖ + ‖v‖, with strict inequality generic
Affine T(v) = Av + b, b ≠ 0 T(0) = 0 test T(0) = b ≠ 0 (matrix part alone would be linear)

Examples Beyond Rⁿ

Linear transformations are not limited to matrix multiplication on column vectors. Any function between vector spaces that respects addition and scaling qualifies.

Fact: A squared input, yet a linear map
The map p(x)↦p(x2)p(x) \mapsto p(x^2) is linear, although squaring is the standard non-example: (p+q)(x2)=p(x2)+q(x2)(p + q)(x^2) = p(x^2) + q(x^2) and (cp)(x2)=c p(x2)(cp)(x^2) = c\,p(x^2). Linearity is judged in the function pp, not in xx; Koopman used this in 1931 to study nonlinear motion with linear maps.

Differentiation T(p)=p′T(p) = p' on the polynomial space Pn\mathcal{P}_n is linear: (p+q)′=p′+q′(p + q)' = p' + q' and (cp)′=cp′(cp)' = cp'. Integration T(f)=∫axf(t) dtT(f) = \int_a^x f(t)\,dt on C[a,b]C[a, b] is linear by the linearity of the integral. The transpose map T(A)=ATT(A) = A^T on Rn×n\mathbb{R}^{n \times n} is linear: (A+B)T=AT+BT(A + B)^T = A^T + B^T and (cA)T=cAT(cA)^T = cA^T. The trace T(A)=tr(A)T(A) = \text{tr}(A) from Rn×n\mathbb{R}^{n \times n} to R\mathbb{R} is linear by additivity and scalar homogeneity of the trace.

These examples show that the concept reaches far beyond columns of numbers. Whenever a mathematical operation respects addition and scaling — and many fundamental operations do — it is a linear transformation, and the entire theory applies.
Operation Domain → Codomain Why linear
Differentiation T(p) = p' 𝒫ₙ → 𝒫ₙ₋₁ (p + q)' = p' + q'; (cp)' = cp'
Integration T(f) = ∫ₐˣ f(t) dt C[a, b] → C[a, b] linearity of the definite integral
Transpose T(A) = Aᵀ ℝⁿˣⁿ → ℝⁿˣⁿ (A + B)ᵀ = Aᵀ + Bᵀ; (cA)ᵀ = cAᵀ
Trace T(A) = tr(A) ℝⁿˣⁿ → ℝ tr(A + B) = tr(A) + tr(B); tr(cA) = c · tr(A)

Determined by Action on a Basis

A linear transformation is completely determined by what it does to a basis. If B={v1,…,vn}\mathcal{B} = \{\mathbf{v}_1, \dots, \mathbf{v}_n\} is a basis for VV and the images T(v1),…,T(vn)T(\mathbf{v}_1), \dots, T(\mathbf{v}_n) are specified, then T(v)T(\mathbf{v}) is determined for every vector v∈V\mathbf{v} \in V.

The reason is that every vector in VV has a unique expression v=c1v1+⋯+cnvn\mathbf{v} = c_1\mathbf{v}_1 + \cdots + c_n\mathbf{v}_n, and linearity forces

Determined by Action on a Basis
T(v)=c1T(v1)+⋯+cnT(vn)T(\mathbf{v}) = c_1T(\mathbf{v}_1) + \cdots + c_nT(\mathbf{v}_n)

Pitfall: Using standard coordinates with basis images
With T(1,1)=(2,0)T(1, 1) = (2, 0) and T(1,−1)=(0,4)T(1, -1) = (0, 4), putting the images in as columns and multiplying by the standard coordinates of (3,1)(3, 1) gives (6,4)(6, 4). In the basis, (3,1)=2(1,1)+1(1,−1)(3, 1) = 2(1, 1) + 1(1, -1), so T(3,1)=2(2,0)+(0,4)=(4,4)T(3, 1) = 2(2, 0) + (0, 4) = (4, 4).

Conversely, any choice of images for the basis vectors — any nn vectors in WW, with no constraints — defines a unique linear transformation. There are no compatibility conditions to satisfy; the basis images can be chosen freely.

This is the bridge to matrix representation. The columns of the matrix are precisely the images of the basis vectors, and the matrix encodes the entire transformation in a rectangular array of numbers.
A linear map is nothing more than a free choice of where each basis vector goes.

Properties

Linearity has immediate consequences that go beyond the defining condition. The zero vector always maps to zero: T(0)=0T(\mathbf{0}) = \mathbf{0}. Negation is preserved: T(−v)=−T(v)T(-\mathbf{v}) = -T(\mathbf{v}). Arbitrary linear combinations are preserved: T(∑civi)=∑ciT(vi)T(\sum c_i \mathbf{v}_i) = \sum c_i T(\mathbf{v}_i).

The composition of two linear transformations is linear. If T:U→VT: U \to V and S:V→WS: V \to W are both linear, then S∘T:U→WS \circ T: U \to W satisfies (S∘T)(cu+dv)=c(S∘T)(u)+d(S∘T)(v)(S \circ T)(c\mathbf{u} + d\mathbf{v}) = c(S \circ T)(\mathbf{u}) + d(S \circ T)(\mathbf{v}). When both maps are represented by matrices, composition corresponds to matrix multiplication.

Pitfall: Reversing the order of a composition
Writing the matrix of S∘TS \circ T as ABAB, with AA for TT = rotation by 90∘90^\circ and BB for SS = reflection across the x-axis, gives (0110)\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}. TT acts first, so the matrix is BA=(0−1−10)BA = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}.

The order of the two maps needs care here. In S∘TS \circ T the map written second acts first: a vector is sent through TT, and SS is then applied to the result. When both maps are given by matrices, the matrix of the composition is found by following a vector through the two steps in that order.

A linear transformation is invertible if and only if it is bijective — both injective (trivial kernel) and surjective (image equals the codomain). The inverse of a linear transformation is itself linear. The full development of these properties, including strategies for proving and disproving linearity, is on its own page.

The Matrix Connection

THEOREM
Every linear transformation T:Rn→RmT: \mathbb{R}^n \to \mathbb{R}^m can be written as T(x)=AxT(\mathbf{x}) = A\mathbf{x} for a unique m×nm \times n matrix AA whose columns are the images of the standard basis vectors: A=[T(e1)  T(e2)  ⋯  T(en)]A = [T(\mathbf{e}_1) \; T(\mathbf{e}_2) \; \cdots \; T(\mathbf{e}_n)].

Pitfall: Writing the images as rows
For T(x,y)=(2x+y,3y)T(x, y) = (2x + y, 3y), writing T(e1)=(2,0)T(\mathbf{e}_1) = (2, 0) and T(e2)=(1,3)T(\mathbf{e}_2) = (1, 3) as rows gives (2013)\begin{pmatrix} 2 & 0 \\ 1 & 3 \end{pmatrix}, which sends (0,1)(0, 1) to (0,3)(0, 3) instead of (1,3)(1, 3). As columns they give A=(2103)A = \begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}.

This gives a one-to-one correspondence between linear maps Rn→Rm\mathbb{R}^n \to \mathbb{R}^m and m×nm \times n matrices. Every property of the transformation — its rank, determinant (when square), eigenvalues, image and kernel — can be read from the matrix. And every matrix operation — multiplication, inversion, decomposition — has a transformation-level interpretation.

For transformations between abstract vector spaces, the matrix depends on the choice of bases for both domain and codomain. Changing the bases changes the matrix but not the transformation. The relationship between different matrix representations of the same map is governed by similarity.
A matrix is a linear map written down in chosen bases; new bases rewrite the matrix, not the map.

Geometry

In R2\mathbb{R}^2 and R3\mathbb{R}^3, linear transformations have vivid geometric meanings. Rotations spin every vector around the origin by a fixed angle. Reflections mirror across a line or plane through the origin. Projections flatten space onto a subspace. Shears tilt one axis relative to another. Scalings stretch or compress along coordinate directions.

Each of these transformations has an explicit matrix that encodes its geometric action. The determinant of the matrix measures how the transformation scales areas or volumes: ∣det⁡(A)∣|\det(A)| is the scaling factor, and the sign of det⁡(A)\det(A) indicates whether orientation is preserved (++) or reversed (−-). Orthogonal matrices (QTQ=IQ^TQ = I, which forces det⁡=±1\det = \pm 1) preserve all lengths and angles — they are the rigid motions of linear algebra.

The singular value decomposition reveals the hidden geometry of any matrix: every linear transformation is a rotation or reflection, followed by a coordinate-axis scaling, followed by another rotation or reflection. Even the most complicated-looking matrix is just three simple geometric operations composed together.
Transformation Geometric action Standard matrix (ℝ²) Determinant / preservation
Rotation by θ spins every vector around the origin [cosθ  −sinθ; sinθ  cosθ] det = 1; preserves lengths and angles
Reflection (across x-axis) mirrors across a line through the origin [1  0; 0  −1] det = −1; reverses orientation
Projection (onto x-axis) flattens space onto a subspace [1  0; 0  0] det = 0; not invertible
Shear (horizontal by k) tilts one axis relative to another [1  k; 0  1] det = 1; preserves area
Scaling (uniform by s) stretches or compresses uniformly [s  0; 0  s] det = s²; scales area by s²
îĵ
What survives the transformation

Lines are still lines, parallel families are still parallel, spacing along each family is still even, and the origin has not moved. Those four survivals are the geometric content of the two algebraic conditions, and a map that breaks any of them is not linear. Break them deliberately and watch which condition fails on the linear transformation explorer.

The non-examples earlier on this page all fail one of these four in a way that is easier to see than to calculate.

Summary: When a Transformation Is Linear

The eight sections above are unified by a single condition — preservation of linear combinations — but recognizing whether a particular function satisfies that condition means knowing which specific tests catch failure and which standard operations are guaranteed to pass. The table below collects every transformation discussed across the page, names the space it acts on, gives the verdict, and identifies the reason in a single cell. It serves both as a recap of the page and as a reference card to return to when judging a new transformation.
Transformation Defined on Linear? Reason
Zero map T(v) = 0 any V → W ✓ corresponds to the zero matrix
Identity T(v) = v any V → V ✓ corresponds to the identity matrix
Matrix multiplication T(x) = Ax ℝⁿ → ℝᵐ ✓ A(cu + dv) = cAu + dAv
Rotation by θ ℝ² → ℝ² ✓ matrix transformation
Projection onto a subspace ℝⁿ → ℝⁿ ✓ matrix transformation
Differentiation T(p) = p' 𝒫ₙ → 𝒫ₙ₋₁ ✓ derivative respects + and scalar mult.
Integration T(f) = ∫ₐˣ f C[a, b] → C[a, b] ✓ integral respects + and scalar mult.
Transpose T(A) = Aᵀ ℝⁿˣⁿ → ℝⁿˣⁿ ✓ (A + B)ᵀ = Aᵀ + Bᵀ; (cA)ᵀ = cAᵀ
Trace T(A) = tr(A) ℝⁿˣⁿ → ℝ ✓ additive and scalar-homogeneous
Translation T(v) = v + b, b ≠ 0 V → V ✗ T(0) = b ≠ 0
Squaring T(x) = x² ℝ → ℝ ✗ fails additivity
Absolute value T(x) = |x| ℝ → ℝ ✗ fails homogeneity
Norm T(v) = ‖v‖ V → ℝ ✗ fails additivity (triangle inequality)
Affine T(v) = Av + b, b ≠ 0 V → V ✗ T(0) = b ≠ 0

Common Pitfalls

Five mistakes account for many wrong answers on this topic. Four are marked with a box where they happen in the sections above, and the fifth, calling a straight-line function such as 2x+32x + 3 linear, belongs with the affine maps of the non-examples section. Here each is worked through in full, with the wrong and the right working side by side.

Trusting the zero test alone

The check T(0)=0T(\mathbf{0}) = \mathbf{0} is carried out, it holds, and the map is declared linear. The zero test can only show that a map is not linear; passing it proves nothing.

Wrong working: T(x,y)=(x,xy)T(x, y) = (x, xy) sends (0,0)(0, 0) to (0,0)(0, 0), so TT is linear.

Right working: test the defining condition. T(1,1)=(1,1)T(1, 1) = (1, 1), while
T(2(1,1))=T(2,2)=(2,4)≠(2,2)=2T(1,1)T(2(1, 1)) = T(2, 2) = (2, 4) \neq (2, 2) = 2T(1, 1)

Scalar multiplication is not preserved, so TT is not linear. The squaring function and the absolute value from the non-examples section pass the zero test as well, since 02=00^2 = 0 and ∣0∣=0|0| = 0, and neither is linear.

Why it happens: the zero test is the quickest check and it does catch translations and affine maps, so it gets used as if it were the whole definition.

How to check: after the zero test, try one scaling, with c=2c = 2 or c=−1c = -1, and one sum of two simple vectors. A product or a power of the coordinates in the formula, such as xyxy or x2x^2, is a sign that one of these will fail.

Calling a straight-line function linear

In school algebra, f(x)=2x+3f(x) = 2x + 3 is called a linear function because its graph is a straight line. The name is carried over, and ff is taken to be a linear transformation of R\mathbb{R}.

Wrong working: the graph of f(x)=2x+3f(x) = 2x + 3 is a line, so ff is linear.

Right working: test additivity.
f(1+1)=f(2)=7,f(1)+f(1)=5+5=10f(1 + 1) = f(2) = 7, \qquad f(1) + f(1) = 5 + 5 = 10

The two sides differ, so ff is not linear. It is an affine map x↦2x+3x \mapsto 2x + 3 with shift b=3b = 3; only its matrix part x↦2xx \mapsto 2x is linear.

Why it happens: the word "linear" is used for two different things. In algebra it describes the shape of a graph; in linear algebra it describes how a map treats sums and multiples.

How to check: evaluate at zero. Here f(0)=3≠0f(0) = 3 \neq 0. A linear map of R\mathbb{R} has the form x↦mxx \mapsto mx, and its graph is a line through the origin.

Using standard coordinates with basis images

The map is given on a basis that is not the standard one. The images are put into a matrix as columns, and that matrix is multiplied by the standard coordinates of a vector.

Wrong working: with the basis v1=(1,1)\mathbf{v}_1 = (1, 1), v2=(1,−1)\mathbf{v}_2 = (1, -1) and the images T(v1)=(2,0)T(\mathbf{v}_1) = (2, 0), T(v2)=(0,4)T(\mathbf{v}_2) = (0, 4),
T(3,1)=(2004)(31)=(64)T(3, 1) = \begin{pmatrix} 2 & 0 \\ 0 & 4 \end{pmatrix}\begin{pmatrix} 3 \\ 1 \end{pmatrix} = \begin{pmatrix} 6 \\ 4 \end{pmatrix}


Right working: first write (3,1)(3, 1) in the basis. From c1+c2=3c_1 + c_2 = 3 and c1−c2=1c_1 - c_2 = 1, c1=2c_1 = 2 and c2=1c_2 = 1. Then linearity gives
T(3,1)=2T(v1)+1T(v2)=2(2,0)+(0,4)=(4,4)T(3, 1) = 2T(\mathbf{v}_1) + 1T(\mathbf{v}_2) = 2(2, 0) + (0, 4) = (4, 4)


Why it happens: for the standard basis the shortcut is correct, because the coordinates of (3,1)(3, 1) in that basis are 33 and 11. In any other basis the coordinates are different numbers, and the shortcut silently uses the wrong ones.

How to check: apply the method to a basis vector itself. The matrix above sends v1=(1,1)\mathbf{v}_1 = (1, 1) to (2,4)(2, 4), not to the given image (2,0)(2, 0).

Reversing the order of a composition

The matrix of S∘TS \circ T is written with the matrix of TT on the left, because TT is the map that acts first.

Wrong working: with TT the rotation by 90∘90^\circ, A=(0−110)A = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}, and SS the reflection across the x-axis, B=(100−1)B = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},
AB=(0−110)(100−1)=(0110)AB = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}


Right working: (S∘T)(x)=S(Ax)=B(Ax)=(BA)x(S \circ T)(\mathbf{x}) = S(A\mathbf{x}) = B(A\mathbf{x}) = (BA)\mathbf{x}, so
BA=(100−1)(0−110)=(0−1−10)BA = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}


Why it happens: the maps act in the order TT, then SS, and that order is copied into the product. But a matrix acts on the vector to its right, so the matrix of the first map has to stand next to the vector.

How to check: follow e1\mathbf{e}_1 by hand. The rotation sends (1,0)(1, 0) to (0,1)(0, 1), and the reflection sends (0,1)(0, 1) to (0,−1)(0, -1). So the first column of the matrix must be (0,−1)(0, -1), as in BABA; the first column of ABAB is (0,1)(0, 1).

Writing the images as rows

The images T(e1),…,T(en)T(\mathbf{e}_1), \dots, T(\mathbf{e}_n) are found correctly but are written into the matrix as rows instead of columns.

Wrong working: for T(x,y)=(2x+y,3y)T(x, y) = (2x + y, 3y), the images are T(e1)=(2,0)T(\mathbf{e}_1) = (2, 0) and T(e2)=(1,3)T(\mathbf{e}_2) = (1, 3), and stacking them as rows gives
(2013)\begin{pmatrix} 2 & 0 \\ 1 & 3 \end{pmatrix}


Right working: the images are the columns.
A=(2103),A(xy)=(2x+y3y)A = \begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}, \qquad A\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 2x + y \\ 3y \end{pmatrix}


Why it happens: vectors are often written in a row, as (2,0)(2, 0), so a list of images is naturally stacked one under another.

How to check: multiply the matrix by e2=(0,1)\mathbf{e}_2 = (0, 1). The result must be T(e2)=(1,3)T(\mathbf{e}_2) = (1, 3); the matrix with rows gives (0,3)(0, 3).