Linear Algebra · Vectors & Vector Spaces

Vectors and Vector Spaces — The Language of Linear Algebra

Vectors are the fundamental objects of linear algebra, they encode both direction and magnitude, and the rules governing how they combine give rise to one of the most powerful mathematical structures: the vector space. Everything else in linear algebra (matrices, eigenvalues, transformations) lives inside this framework.

Share this page

§ 01What Is a Vector?

A vector is a quantity with both magnitude and direction, but the deeper definition is purely algebraic: a vector is any object that can be added to another and scaled by a number, provided those operations follow eight specific rules.

In elementary courses, vectors appear as arrows in the plane or in three-dimensional space. An arrow from the origin to the point (3, 2) is the vector v = (3, 2): it points 3 units right and 2 units up, and its length encodes how "large" it is. This geometric picture is the right place to start, but it is only one instance of a vastly more general idea.

Algebraically, a vector in ℝⁿ is an ordered list of n real numbers, written as a column:

Column Vector in ℝⁿ
v = (v₁, v₂, …, vₙ)ᵀ ∈ ℝⁿ

The superscript T denotes the transpose: turning a row list into a column. In ℝ² and ℝ³ these correspond directly to points in the plane and in space.

Geometric vs. Algebraic View Both views are essential. The geometric view builds intuition — you can see addition as placing arrows tip-to-tail. The algebraic view is what makes the ideas extend to ℝ¹⁰⁰, function spaces, and polynomial spaces where geometry is harder to draw.
u v u + v O
Vector addition: place v at the tip of u — the resultant arrow u + v runs from the origin to the new tip
Example 1Locating vectors in ℝ² and ℝ³

Identify the geometric position of each vector and state its dimension.

  1. u = (3, −2): a point in the plane ℝ², 3 units right and 2 units down from the origin. Dimension: 2.
  2. v = (1, 0, 4): a point in space ℝ³, 1 unit along x, 0 along y, 4 along z. Dimension: 3.
  3. w = (0, 0), the zero vector in ℝ². It has no direction and zero magnitude; it sits at the origin.
Vectors in ℝⁿ are specified by exactly n components. The zero vector 0 = (0, 0, …, 0) plays the role of "no displacement".

§ 02Vector Operations — Addition and Scalar Multiplication

Two operations are fundamental: adding two vectors and multiplying a vector by a scalar (a real number). Both operate component-by-component, and both have vivid geometric interpretations.

Vector Addition
u + v = (u₁+v₁, u₂+v₂, …, uₙ+vₙ)

Geometrically: place v at the tip of u. The resultant vector runs from the origin to the new tip, the parallelogram law.

Scalar Multiplication
c·v = (cv₁, cv₂, …, cvₙ)

Geometrically: stretches or shrinks the vector by factor |c|; if c < 0, the direction reverses. c = 0 gives the zero vector.

Commutativity
u + v = v + u

Order of addition does not matter, parallelogram has the same diagonal either way.

Associativity
(u + v) + w = u + (v + w)

Grouping of addition is irrelevant: the tip-to-tail chain arrives at the same point.

Zero Vector
v + 0 = v

Adding the zero vector leaves any vector unchanged. 0 is the additive identity.

Additive Inverse
v + (−v) = 0

Every vector has a negative: −v = (−v₁, …, −vₙ). Together they cancel to zero.

Scalar Distributivity
c(u + v) = cu + cv

Scaling distributes over vector addition.

Vector Distributivity
(c + d)v = cv + dv

A sum of scalars distributes over a single vector.

Scalar Associativity
c(dv) = (cd)v

Scaling by c then d is the same as scaling by cd at once.

Unity
1·v = v

Multiplying by 1 leaves the vector unchanged. The scalar 1 is the multiplicative identity.

These eight axioms are not just properties of ℝⁿ: they are the definition of a vector space. Any set of objects that satisfies all eight forms a vector space, regardless of whether those objects look like arrows.

Example 2Vector addition and scalar multiplication in ℝ³

Let u = (2, −1, 3) and v = (0, 4, −2). Compute 3u − 2v.

  1. 3u = (6, −3, 9)
  2. 2v = (0, 8, −4)
  3. 3u − 2v = (6−0, −3−8, 9−(−4)) = (6, −11, 13)
3u − 2v = (6, −11, 13)
Example 3Finding the unit vector in the direction of v

A unit vector has magnitude 1. To normalise v = (3, 4), divide by its magnitude.

  1. |v| = √(3² + 4²) = √(9 + 16) = √25 = 5
  2. v̂ = v / |v| = (3/5, 4/5)
  3. Verify: |(3/5, 4/5)| = √(9/25 + 16/25) = √1 = 1 ✓
v̂ = (3/5, 4/5) — same direction as v but with magnitude 1.

§ 03The Dot Product — Measuring Alignment

The dot product (also called the scalar product or inner product) takes two vectors of the same length and returns a single number. It is the key tool for measuring angles, projections, and orthogonality.

Dot Product — Algebraic Definition
u · v = u₁v₁ + u₂v₂ + … + uₙvₙ = Σᵢ uᵢvᵢ

Multiply corresponding components and sum. The result is a scalar, not a vector.

Dot Product — Geometric Definition
u · v = |u| |v| cos θ

Where θ is the angle between u and v (0 ≤ θ ≤ π). Both definitions always agree.

Key Geometric Consequences

The geometric form reveals the dot product's power as a measuring tool:

Orthogonality
u · v = 0 ⟺ u ⊥ v

Two vectors are perpendicular if and only if their dot product is zero. This is the most important special case.

Magnitude
|v|² = v · v

The squared length of a vector equals its dot product with itself: |v| = √(v · v). No Pythagorean theorem needed separately.

Angle Between Vectors
cos θ = (u · v) / (|u| |v|)

Rearranging the geometric formula. θ = 90° if dot product is 0; θ is acute if positive; obtuse if negative.

Projection
proj_v u = (u·v / v·v) v

The vector projection of u onto v, how much of u lies in the direction of v. Scalar projection = u·v̂ = u·v / |v|.

Example 4Computing a dot product and the angle between two vectors

Let u = (1, 2, 2) and v = (3, 0, −1). Find u · v and the angle between them.

  1. u · v = 1·3 + 2·0 + 2·(−1) = 3 + 0 − 2 = 1
  2. |u| = √(1+4+4) = √9 = 3
  3. |v| = √(9+0+1) = √10
  4. cos θ = 1 / (3√10) ≈ 1/9.487 ≈ 0.1054
  5. θ = arccos(0.1054) ≈ 83.95°
u · v = 1; the angle between u and v is approximately 84°. The positive dot product confirms the angle is acute (less than 90°).
Example 5Testing orthogonality and computing a projection

Let u = (4, 2, −1) and v = (1, 0, 4). Are they orthogonal? If not, find the projection of u onto v.

  1. u · v = 4·1 + 2·0 + (−1)·4 = 4 + 0 − 4 = 0
  2. Since u · v = 0, the vectors are orthogonal (perpendicular).
  3. Therefore proj_v u = (0 / |v|²) v = 0: the zero vector. None of u lies in the direction of v.
u · v = 0, so u ⊥ v. The projection of u onto v is the zero vector.

§ 04The Cross Product — A Vector Perpendicular to Both

The cross product is defined only in ℝ³. Unlike the dot product, which returns a scalar, the cross product of two vectors returns a new vector that is perpendicular to both inputs.

Cross Product Formula
u × v = (u₂v₃−u₃v₂, u₃v₁−u₁v₃, u₁v₂−u₂v₁)

Computed as the formal determinant expansion of a 3×3 matrix with standard basis vectors i, j, k in the first row.

PropertyFormulaMeaning
Anti-commutativityu × v = −(v × u)Swapping inputs reverses direction of result
Magnitude|u × v| = |u||v| sin θEquals the area of the parallelogram spanned by u and v
Self-crossv × v = 0Any vector crossed with itself is the zero vector
Orthogonality(u × v) · u = 0The result is always perpendicular to both u and v
Distributivityu × (v + w) = u×v + u×wCross product distributes over addition
Right-hand rulePoint fingers from u toward vThumb points in direction of u × v
Example 6Computing a cross product and verifying perpendicularity

Let u = (1, 2, 3) and v = (4, 5, 6). Find u × v and verify it is perpendicular to both.

  1. Component 1: u₂v₃ − u₃v₂ = 2·6 − 3·5 = 12 − 15 = −3
  2. Component 2: u₃v₁ − u₁v₃ = 3·4 − 1·6 = 12 − 6 = 6
  3. Component 3: u₁v₂ − u₂v₁ = 1·5 − 2·4 = 5 − 8 = −3
  4. So u × v = (−3, 6, −3).
  5. Verify: (u × v) · u = −3·1 + 6·2 + (−3)·3 = −3 + 12 − 9 = 0 ✓
  6. Verify: (u × v) · v = −3·4 + 6·5 + (−3)·6 = −12 + 30 − 18 = 0 ✓
u × v = (−3, 6, −3), confirmed perpendicular to both u and v. Area of parallelogram = |u × v| = √(9+36+9) = √54 = 3√6.
Cross Product is NOT Commutative or Associative u × v = −(v × u), so order matters critically. Furthermore, u × (v × w) ≠ (u × v) × w in general — the cross product is not associative. Never rearrange the order of a cross product without care.

§ 05Vector Spaces — The Abstract Framework

A vector space over ℝ is a set V equipped with two operations, addition and scalar multiplication, that satisfy the eight axioms listed in § 02. The elements of V are called vectors, even if they are not arrows.

The power of the vector space concept is that it applies to many different kinds of mathematical objects simultaneously. All of the following are vector spaces:

Set VVectors are…Dimension
ℝⁿn-tuples of real numbersn
PₙPolynomials of degree ≤ nn + 1
M_{m×n}All m×n real matricesm·n
C[a,b]Continuous functions on [a,b]
{0}Just the zero vector0
Why Abstract Vector Spaces Matter Once you prove a theorem about vector spaces in general — for example, that every finite-dimensional vector space has a basis — it automatically applies to ℝⁿ, polynomial spaces, matrix spaces, and every other instance at once. Abstraction multiplies the reach of every result.

§ 06Subspaces — Vector Spaces Inside Vector Spaces

A subspace of a vector space V is a subset H ⊆ V that is itself a vector space under the same operations. Rather than verifying all eight axioms, there is a three-condition shortcut: because most axioms are inherited automatically from V.

The Three Subspace Conditions
Contains the zero vector

The zero vector 0 must be in H. This immediately rules out any "shifted" plane or line that doesn't pass through the origin.

Closed under addition

If u ∈ H and v ∈ H, then u + v ∈ H. Adding two elements of H must stay inside H: the set cannot "leak out" under addition.

Closed under scalar multiplication

If v ∈ H and c ∈ ℝ, then cv ∈ H. Scaling any element of H must keep it in H, stretching or shrinking cannot escape the subspace.

The Most Common Mistake — Forgetting the Zero Vector A line in ℝ² like y = x + 1 fails condition ①: the zero vector (0, 0) gives 0 ≠ 0 + 1. Any line or plane not passing through the origin is not a subspace. Geometrically, every subspace of ℝⁿ must pass through the origin.
Example 7Is the set of vectors (x, y) with y = 2x a subspace of ℝ²?

Let H = {(x, 2x) : x ∈ ℝ}, this is a line through the origin with slope 2.

  1. Zero vector: (0, 2·0) = (0, 0) ∈ H. ✓
  2. Closure under addition: Take (a, 2a) and (b, 2b) in H. Their sum: (a+b, 2a+2b) = (a+b, 2(a+b)) ∈ H. ✓
  3. Closure under scaling: Take (a, 2a) ∈ H and scalar c. Then c(a, 2a) = (ca, 2ca) = (ca, 2(ca)) ∈ H. ✓
All three conditions hold. H is a subspace of ℝ² — it is a line through the origin, which is the simplest non-trivial subspace in the plane.
Example 8Is the set of vectors (x, y) with xy ≥ 0 a subspace of ℝ²?

H = {(x, y) : xy ≥ 0}: pairs where x and y have the same sign (or one is zero).

  1. Zero vector: (0)(0) = 0 ≥ 0. ✓
  2. Closure under scaling: If xy ≥ 0 and c ∈ ℝ, then (cx)(cy) = c²(xy) ≥ 0. ✓
  3. Closure under addition: Take u = (2, 1), product 2 ≥ 0 ✓, and v = (−1, 3), product −3 < 0... actually v ∉ H. Try u = (1, 2) and v = (−2, 1): uv products are 2 and −2, so v ∉ H either. Let's use u = (3, 1) and v = (−1, 2): products are 3 ≥ 0 ✓ and −2 < 0 ✗: v ∉ H, so the sum test doesn't apply cleanly. Take instead u = (2, 1) and v = (1, −3). 2·1 = 2 ≥ 0 ✓; 1·(−3) = −3 < 0. v ∉ H. For a valid test, pick u = (1, 2) and w = (2, −1): 1·2=2 ≥ 0 ✓, 2·(−1) = −2 < 0, so w ∉ H. We need both in H. Use u = (2, 3) and v = (−1, −2): products 6 ≥ 0 ✓ and 2 ≥ 0 ✓. Sum: (1, 1): product 1 ≥ 0 ✓. Try u = (1, 2) and v = (−3, −1): products 2 ≥ 0 and 3 ≥ 0. Sum = (−2, 1), product = −2 < 0. ✗ Fails!
  4. Since (1,2) + (−3,−1) = (−2, 1) ∉ H, closure under addition fails.
H is NOT a subspace — it fails closure under addition. Geometrically it is the union of two quadrants, not a "flat" subspace through the origin.

§ 07Linear Combinations, Span, and Basis

Linear Combinations

A linear combination of vectors v₁, v₂, …, vₖ is any vector of the form:

Linear Combination
c₁v₁ + c₂v₂ + … + cₖvₖ

Where c₁, c₂, …, cₖ are arbitrary scalars. The result is always a single vector in the same space.

The Span

The span of a set of vectors {v₁, …, vₖ} is the set of ALL possible linear combinations. It is the smallest subspace containing all the listed vectors:

Span Definition
span{v₁, …, vₖ} = {c₁v₁ + … + cₖvₖ : c₁, …, cₖ ∈ ℝ}

The span of a single non-zero vector is a line. The span of two non-parallel vectors in ℝ³ is a plane through the origin.

Linear Independence

Vectors v₁, …, vₖ are linearly independent if the only solution to c₁v₁ + … + cₖvₖ = 0 is c₁ = c₂ = … = cₖ = 0. If any non-trivial solution exists, the vectors are linearly dependent, at least one is redundant, expressible as a combination of the others.

Basis and Dimension

A basis of a vector space V is a set of vectors that is both linearly independent and spans V. Every basis of the same vector space has exactly the same number of vectors: this number is the dimension of V.

Standard Basis of ℝⁿ
e₁=(1,0,…,0), e₂=(0,1,…,0), …, eₙ=(0,0,…,1)

The standard basis vectors are the columns of the n×n identity matrix. They are orthogonal unit vectors and form the natural coordinate system for ℝⁿ.

Example 9Testing linear independence of three vectors in ℝ³

Are v₁ = (1, 0, 1), v₂ = (2, 1, 0), v₃ = (0, 1, −2) linearly independent?

  1. Set c₁v₁ + c₂v₂ + c₃v₃ = 0 and solve for c₁, c₂, c₃.
  2. This gives the system: c₁ + 2c₂ = 0; c₂ + c₃ = 0; c₁ − 2c₃ = 0.
  3. From equation 1: c₁ = −2c₂. From equation 2: c₃ = −c₂. Sub into equation 3: −2c₂ − 2(−c₂) = −2c₂ + 2c₂ = 0 ✓ for all c₂.
  4. The system has infinitely many solutions, take c₂ = 1: c₁ = −2, c₃ = −1. Then −2v₁ + v₂ − v₃ = 0.
The vectors are linearly dependent. v₂ = 2v₁ + v₃ — the third vector is redundant. This set does not form a basis for any space of dimension 3.
Example 10Expressing a vector as a linear combination

Write w = (5, 3) as a linear combination of e₁ = (1, 0) and e₂ = (0, 1).

  1. We need c₁(1,0) + c₂(0,1) = (5,3).
  2. Matching components: c₁ = 5, c₂ = 3.
  3. So w = 5e₁ + 3e₂.
w = 5e₁ + 3e₂. The coefficients (5, 3) are exactly the components of w — this is the definition of coordinates in the standard basis.
Example 11The span of two vectors in ℝ³

Describe span{(1, 0, 2), (0, 1, −1)} geometrically.

  1. These two vectors are clearly not parallel (neither is a scalar multiple of the other).
  2. Their span is all vectors c₁(1,0,2) + c₂(0,1,−1) = (c₁, c₂, 2c₁−c₂) for c₁, c₂ ∈ ℝ.
  3. Setting z = 2x − y (where x = c₁, y = c₂, z = 2c₁−c₂), the span satisfies the equation z = 2x − y, i.e., 2x − y − z = 0.
  4. This is a plane through the origin in ℝ³ with normal vector (2, −1, −1).
span{(1,0,2),(0,1,−1)} is the plane 2x − y − z = 0 — a two-dimensional subspace of ℝ³.
Example 12Verifying that a set forms a basis for ℝ²

Does B = {(1, 1), (1, −1)} form a basis for ℝ²?

  1. Linear independence: c₁(1,1) + c₂(1,−1) = (0,0) gives c₁+c₂ = 0 and c₁−c₂ = 0. Adding: 2c₁ = 0, so c₁ = 0, then c₂ = 0. Only the trivial solution, independent ✓
  2. Spans ℝ²: Two linearly independent vectors in ℝ² automatically span all of ℝ². ✓
  3. Expressing (3, 7) in this basis: c₁+c₂ = 3 and c₁−c₂ = 7. Solving: c₁ = 5, c₂ = −2.
B is a basis for ℝ². The vector (3, 7) has coordinates (5, −2) in this basis: (3,7) = 5(1,1) + (−2)(1,−1).

§ 08Common Mistakes

Mistake 1 — Confusing the dot product with multiplication u · v is a scalar; it is NOT a vector. You cannot dot-product a result with a third vector without first checking whether the output is a vector or scalar. Expressions like (u · v) · w are valid (scalar times vector); (u · v) · (w · z) is a product of two scalars. But u · (v · w) is invalid — you cannot take the dot product of a vector u with a scalar.
Mistake 2 — Checking only two of the three subspace conditions All three must hold. Forgetting to verify closure under scalar multiplication (or the zero vector) leads to wrong conclusions. In particular, a non-empty set closed under addition and scalar multiplication necessarily contains 0 (take c = 0), so conditions ② and ③ actually imply ①. But it is safer to verify all three explicitly.
Mistake 3 — Assuming n vectors in ℝⁿ always form a basis You need n linearly independent vectors to form a basis for ℝⁿ. Any n vectors that are linearly dependent do not form a basis, even if there are exactly n of them. Always check independence.
Mistake 4 — Treating the cross product as commutative u × v = −v × u. The cross product reverses sign when you swap the inputs. This sign error causes mistakes in physics (torque, angular momentum) and in computing normal vectors to surfaces.

§ 09Practice Quiz — Vectors and Vector Spaces

0 / 10
Question 1 of 10
Compute u + 2v where u = (1, −3, 2) and v = (4, 0, −1). What is the second component?
  1. 2v = (8, 0, −2)
  2. u + 2v = (1+8, −3+0, 2+(−2)) = (9, −3, 0)
  3. Second component = −3.
Question 2 of 10
What is the magnitude of v = (3, −4)?
  1. |v| = √(3² + (−4)²) = √(9 + 16) = √25 = 5.
Question 3 of 10
Compute the dot product u · v where u = (2, 3) and v = (4, −1).
  1. u · v = 2·4 + 3·(−1) = 8 − 3 = 5.
Question 4 of 10
Two vectors are orthogonal if and only if their dot product equals what?
  1. From u · v = |u||v|cosθ, orthogonality means θ = 90°, so cosθ = 0, giving u · v = 0.
Question 5 of 10
Which of the following sets is not a subspace of ℝ²?
  1. x + y = 1 does not contain (0,0) since 0 + 0 = 0 ≠ 1. Condition ① fails immediately.
  2. A line not through the origin is never a subspace.
Question 6 of 10
Find the first component of the cross product u × v where u = (1, 2, 0) and v = (0, 1, 3).
  1. First component of u×v: u₂v₃ − u₃v₂ = 2·3 − 0·1 = 6 − 0 = 6.
  2. Full cross product: (6, 0·0−1·3, 1·1−2·0) = (6, −3, 1).
Question 7 of 10
The vectors {(1, 0), (0, 1)} are the standard basis for ℝ². How many vectors are in any basis for ℝ⁵?
  1. Every basis for ℝⁿ has exactly n vectors, this is the definition of dimension.
  2. ℝ⁵ has dimension 5, so every basis contains exactly 5 vectors.
Question 8 of 10
Are v₁ = (1, 2) and v₂ = (2, 4) linearly independent?
  1. v₂ = (2,4) = 2·(1,2) = 2v₁. So the non-trivial combination 2v₁ − v₂ = 0 exists.
  2. They are linearly dependent, and their span is only a line, not all of ℝ².
Question 9 of 10
The unit vector in the direction of v = (0, 5) has components (0, ?). What is the second component?
  1. |v| = √(0² + 5²) = 5.
  2. v̂ = v/|v| = (0/5, 5/5) = (0, 1).
  3. Second component = 1.
Question 10 of 10
The span of a single non-zero vector in ℝ³ is geometrically a:
  1. span{v} = {cv : c ∈ ℝ}, all scalar multiples of v.
  2. Geometrically, this is the line through the origin in the direction of v. It is a 1-dimensional subspace of ℝ³.
0/10

Keep practising!

Cookie Settings