Span of Vectors

The span of vectors v₁, v₂, …, vₚ is the set of all their linear combinations c₁v₁ + c₂v₂ + ⋯ + cₚvₚ. A vector b is in the span exactly when the augmented matrix [v₁ ⋯ vₚ | b] is consistent. The vectors span all of ℝⁿ when their matrix has a pivot in every row.

Before this lesson: Linear Combinations and Gaussian Elimination

What the span of vectors means

The span of v₁, …, vₚ is written Span{v₁, …, vₚ}. It collects every vector you can build from them with scalar multiples and addition. So asking “is b in the span?” is the same as asking “is b a linear combination of the vectors?”

With one nonzero vector v, the multiples cv fill a line through the origin. Two vectors that point in different directions fill a plane through the origin. A span always contains the zero vector, because 0v₁ + ⋯ + 0vₚ = 0.

Coordinate grid from x = -5 to 5 and y = -3 to 3. A dashed navy line through the origin with slope 1/2 is labeled Span{v}. Blue arrows from the origin show v = (2, 1) and 2v = (4, 2) along the line, and an orange arrow shows -v = (-2, -1). An orange point b = (1, 3) lies above the line, off the span.
Every multiple of v = (2, 1) lands on one line through the origin; b = (1, 3) is off that line, so it is not in Span{v}.

In ℝ³ the span of a set of vectors can only be one of four shapes, and the number of pivots tells you which one.

Pivots in [v₁ ⋯ vₚ]Span in ℝ³
0 (all vectors are zero)Just the origin
1A line through the origin
2A plane through the origin
3All of ℝ³

How to tell if a vector is in the span

Put the vectors in as columns. The test for one vector b and the test for every b use the same row reduction:

\mathbf{b} \in \operatorname{Span}\{\mathbf{v}_1, \ldots, \mathbf{v}_p\} \iff \left[\begin{array}{ccc|c} \mathbf{v}_1 & \cdots & \mathbf{v}_p & \mathbf{b} \end{array}\right] \text{ is consistent}
  1. To test one vector b, row reduce [v₁ ⋯ vₚ | b]. If a row reads [0 ⋯ 0 | c] with c ≠ 0, b is not in the span. Otherwise it is, and back-substitution gives the weights.
  2. To describe the whole span, use a general b = (b₁, b₂, b₃). Each zero row on the left gives an equation that b must satisfy.
  3. To test whether the vectors span ℝⁿ, row reduce the coefficient matrix A = [v₁ ⋯ vₚ]. They span ℝⁿ exactly when A has a pivot in every row.

Since each column holds at most one pivot, fewer than n vectors can never span ℝⁿ. For n vectors in ℝⁿ, a nonzero determinant gives a quick check that they span.

Span of vectors examples

Example 1: Span of one vector

Let v = (1, −2, 3). Is b = (−3, 6, −9) in Span{v}? Is c = (2, −4, 5)?

x\mathbf{v} = \mathbf{b}

b is in Span{v} exactly when some multiple of v equals b.

x(1) = -3

Match the first entries, so x = −3.

(-3)(-2) = 6

Check the second entry with x = −3: it matches.

(-3)(3) = -9

Check the third entry: it matches.

Answer: yes, b = −3v, so b is in Span{v}.

x(1) = 2

For c, match the first entries, so x = 2.

2(-2) = -4

The second entry matches.

2(3) = 6 \ne 5

The third entry does not match, so no single x works.

Answer: no, c is not in Span{v}. It is off the line through the origin in the direction of v.

Example 2: Is b in the span of two vectors?

Is b = (3, −1, 7) in Span{v₁, v₂} for v₁ = (1, 0, 2) and v₂ = (2, 1, 3)?

\left[\begin{array}{rr|r} 1 & 2 & 3 \\ 0 & 1 & -1 \\ 2 & 3 & 7 \end{array}\right]

Augmented matrix [v₁ v₂ | b], vectors as columns.

\left[\begin{array}{rr|r} 1 & 2 & 3 \\ 0 & 1 & -1 \\ 0 & -1 & 1 \end{array}\right]

R₃ − 2R₁ → R₃: 3 − 4 = −1 and 7 − 6 = 1 (see row reduction).

\left[\begin{array}{rr|r} 1 & 2 & 3 \\ 0 & 1 & -1 \\ 0 & 0 & 0 \end{array}\right]

R₃ + R₂ → R₃.

No row reads [0 0 | c] with c ≠ 0, so the system is consistent and b is in the span. Back-substitute for the weights.

x_2 = -1

Row 2.

x_1 + 2(-1) = 3

Row 1 with x₂ = −1.

x_1 - 2 = 3

Multiply.

x_1 = 5

Add 2 to both sides.

5\begin{bmatrix} 1 \\ 0 \\ 2 \end{bmatrix} - \begin{bmatrix} 2 \\ 1 \\ 3 \end{bmatrix} = \begin{bmatrix} 5 - 2 \\ 0 - 1 \\ 10 - 3 \end{bmatrix} = \begin{bmatrix} 3 \\ -1 \\ 7 \end{bmatrix}

Check the combination entry by entry.

Answer: yes, b = 5v₁ − v₂.

Example 3: Describe a span as a plane

Describe Span{v₁, v₂} for the same v₁ = (1, 0, 2) and v₂ = (2, 1, 3) with one equation.

\left[\begin{array}{rr|c} 1 & 2 & b_1 \\ 0 & 1 & b_2 \\ 2 & 3 & b_3 \end{array}\right]

Augmented matrix with a general b = (b₁, b₂, b₃).

\left[\begin{array}{rr|c} 1 & 2 & b_1 \\ 0 & 1 & b_2 \\ 0 & -1 & b_3 - 2b_1 \end{array}\right]

R₃ − 2R₁ → R₃.

\left[\begin{array}{rr|c} 1 & 2 & b_1 \\ 0 & 1 & b_2 \\ 0 & 0 & b_3 - 2b_1 + b_2 \end{array}\right]

R₃ + R₂ → R₃.

-2b_1 + b_2 + b_3 = 0

The last row is consistent only when its right side is 0.

Answer: Span{v₁, v₂} is the plane −2x + y + z = 0 through the origin (see equation of a plane).

-2(1) + 0 + 2 = 0

Check v₁ = (1, 0, 2) on the plane.

-2(2) + 1 + 3 = 0

Check v₂ = (2, 1, 3).

-2(3) + (-1) + 7 = 0

Check b = (3, −1, 7) from Example 2.

Example 4: Three vectors that do not span ℝ³

Do v₁ = (1, 2, −1), v₂ = (2, 5, 0) and v₃ = (0, 1, 2) span ℝ³?

\begin{bmatrix} 1 & 2 & 0 \\ 2 & 5 & 1 \\ -1 & 0 & 2 \end{bmatrix}

Coefficient matrix A = [v₁ v₂ v₃].

\begin{bmatrix} 1 & 2 & 0 \\ 0 & 1 & 1 \\ -1 & 0 & 2 \end{bmatrix}

R₂ − 2R₁ → R₂: 5 − 4 = 1 and 1 − 0 = 1.

\begin{bmatrix} 1 & 2 & 0 \\ 0 & 1 & 1 \\ 0 & 2 & 2 \end{bmatrix}

R₃ + R₁ → R₃: 0 + 2 = 2 and 2 + 0 = 2.

\begin{bmatrix} 1 & 2 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{bmatrix}

R₃ − 2R₂ → R₃.

There are only 2 pivots for 3 rows, so the vectors do not span ℝ³. Their span is a plane.

\left[\begin{array}{rrr|r} 1 & 2 & 0 & 0 \\ 0 & 1 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{array}\right]

Apply the same three row operations to [A | b] with b = (0, 0, 1): the right side becomes 0, 0 + 1 = 1, then 1 − 2(0) = 1.

The last row reads [0 0 0 | 1], so b = (0, 0, 1) is not in the span.

\mathbf{v}_2 - 2\mathbf{v}_1 = \begin{bmatrix} 2 - 2 \\ 5 - 4 \\ 0 + 2 \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \\ 2 \end{bmatrix} = \mathbf{v}_3

The reason: v₃ is already a combination of v₁ and v₂, so it adds no new direction.

Answer: no. Span{v₁, v₂, v₃} = Span{v₁, v₂}, a plane through the origin.

Example 5: Can a drone push in every direction?

A drone has three motors. Each one can run forward or in reverse at any strength, so its weight can be any real number. At full forward power the motors push with force vectors f₁ = (1, 0, 1), f₂ = (0, 1, 1) and f₃ = (1, 1, 0) newtons. Can the drone produce any force in ℝ³? If so, find the weights that give the force b = (3, 1, 2).

\left[\begin{array}{rrr|r} 1 & 0 & 1 & 3 \\ 0 & 1 & 1 & 1 \\ 1 & 1 & 0 & 2 \end{array}\right]

Augmented matrix [f₁ f₂ f₃ | b].

\left[\begin{array}{rrr|r} 1 & 0 & 1 & 3 \\ 0 & 1 & 1 & 1 \\ 0 & 1 & -1 & -1 \end{array}\right]

R₃ − R₁ → R₃: 1 − 0 = 1, 0 − 1 = −1 and 2 − 3 = −1.

\left[\begin{array}{rrr|r} 1 & 0 & 1 & 3 \\ 0 & 1 & 1 & 1 \\ 0 & 0 & -2 & -2 \end{array}\right]

R₃ − R₂ → R₃: −1 − 1 = −2 and −1 − 1 = −2.

The coefficient part has a pivot in every row (3 pivots for 3 rows), so f₁, f₂ and f₃ span ℝ³. The drone can produce any force. Now find the weights for b.

x_3 = 1

Row 3: −2x₃ = −2, so divide both sides by −2.

x_2 + 1 = 1

Row 2 with x₃ = 1.

x_2 = 0

Subtract 1 from both sides.

x_1 + 1 = 3

Row 1 with x₃ = 1.

x_1 = 2

Subtract 1 from both sides.

2\begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} + 0\begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix} + 1\begin{bmatrix} 1 \\ 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 3 \\ 1 \\ 2 \end{bmatrix}

Check: 2 + 0 + 1 = 3, 0 + 0 + 1 = 1 and 2 + 0 + 0 = 2.

Answer: yes. Motor 1 at 2 times full power, motor 2 off and motor 3 at full power give the force (3, 1, 2).

Common mistakes

MistakeExample of the errorFix
Putting the vectors in as rowsWriting v₁ = (1, 0, 2) as the first row of the matrixEach vector is a column, and b goes in the last column.
Checking columns instead of rows for spanning“These 3 vectors in ℝ⁴ have 3 pivots, so they span ℝ⁴”Spanning ℝⁿ needs a pivot in every row. Three vectors can never span ℝ⁴.
Assuming n vectors always span ℝⁿ“There are 3 vectors in ℝ³, so they span ℝ³”Count the pivots. In Example 4, three vectors span only a plane.
Forgetting that a span passes through the origin“Span{(1, 1)} is the line y = x + 1”A span always contains the zero vector, so this span is the line y = x.
Reading a zero row as “no solution”Treating [0 0 | 0] as inconsistentOnly [0 ⋯ 0 | c] with c ≠ 0 is inconsistent. A row of all zeros is fine.

Related ideas

Span and the matrix equation. If A has columns v₁, …, vₚ, then b is in their span exactly when Ax = b has a solution. The next lesson, Matrix Equation Ax = b, uses this to connect spans with matrix-vector products.

Removing extra vectors. In Example 4, v₃ added nothing to the span. Sets with no such extra vector are called linearly independent, the topic of Linear Independence.

Finding the weights faster. When you need the weights for several vectors b, reduce all the way to reduced row echelon form so the weights can be read off directly.

Practice problems

  1. Is (−4, 10) in Span{(2, −5)}?
  2. Is (6, 3, 1) in Span{(2, 1, 0)}?
  3. Is (1, 4) in Span{(1, 2), (3, 6)}?
  4. Do (1, 3) and (2, 5) span ℝ²?
  5. Is b = (5, 1, 4) in Span{(1, 1, 0), (2, −1, 3)}? If so, find the weights.
  6. Find h so that (2, h, 1) is in Span{(1, −1, 2), (0, 1, 3)}.
  7. Describe Span{(1, 2, 0), (0, 1, −1)} with one equation.
  8. Do (1, 0, 2), (0, 1, 1) and (2, 1, 5) span ℝ³?
  9. Can two vectors span ℝ³? Explain with pivots.
  10. A warehouse robot drives along two tracks with directions d₁ = (2, 1) and d₂ = (4, 2), forward or backward. Can it reach the point (3, 5) from the origin?
Show answers

1.

x(2) = -4

Match the first entries.

x = -2

Divide both sides by 2.

(-2)(-5) = 10

The second entry matches.

Answer: yes, (−4, 10) = −2(2, −5).

2.

x(2) = 6

Match the first entries.

x = 3

Divide both sides by 2.

3(1) = 3

The second entry matches.

3(0) = 0 \ne 1

The third entry does not match.

Answer: no.

3.

\left[\begin{array}{rr|r} 1 & 3 & 1 \\ 2 & 6 & 4 \end{array}\right]

Augmented matrix, vectors as columns.

\left[\begin{array}{rr|r} 1 & 3 & 1 \\ 0 & 0 & 2 \end{array}\right]

R₂ − 2R₁ → R₂: 6 − 6 = 0 and 4 − 2 = 2.

Answer: no. The row [0 0 | 2] is inconsistent. The vectors are parallel, since (3, 6) = 3(1, 2), so their span is only the line y = 2x.

4.

\begin{bmatrix} 1 & 2 \\ 3 & 5 \end{bmatrix}

Coefficient matrix with the vectors as columns.

\begin{bmatrix} 1 & 2 \\ 0 & -1 \end{bmatrix}

R₂ − 3R₁ → R₂: 5 − 6 = −1.

Answer: yes. There is a pivot in both rows, so the vectors span ℝ².

5.

\left[\begin{array}{rr|r} 1 & 2 & 5 \\ 1 & -1 & 1 \\ 0 & 3 & 4 \end{array}\right]

Augmented matrix [v₁ v₂ | b].

\left[\begin{array}{rr|r} 1 & 2 & 5 \\ 0 & -3 & -4 \\ 0 & 3 & 4 \end{array}\right]

R₂ − R₁ → R₂: −1 − 2 = −3 and 1 − 5 = −4.

\left[\begin{array}{rr|r} 1 & 2 & 5 \\ 0 & -3 & -4 \\ 0 & 0 & 0 \end{array}\right]

R₃ + R₂ → R₃.

x_2 = \frac{4}{3}

Row 2: −3x₂ = −4, so divide both sides by −3.

x_1 + \frac{8}{3} = 5

Row 1 with x₂ = 4/3: 2 · 4/3 = 8/3.

x_1 = \frac{7}{3}

Subtract 8/3 from both sides: 15/3 − 8/3 = 7/3 (see adding and subtracting fractions).

\tfrac{7}{3}(1, 1, 0) + \tfrac{4}{3}(2, -1, 3) = \left(\tfrac{15}{3}, \tfrac{3}{3}, \tfrac{12}{3}\right) = (5, 1, 4)

Check the combination.

Answer: yes, with weights 7/3 and 4/3.

6.

\left[\begin{array}{rr|c} 1 & 0 & 2 \\ -1 & 1 & h \\ 2 & 3 & 1 \end{array}\right]

Augmented matrix.

\left[\begin{array}{rr|c} 1 & 0 & 2 \\ 0 & 1 & h + 2 \\ 2 & 3 & 1 \end{array}\right]

R₂ + R₁ → R₂.

\left[\begin{array}{rr|c} 1 & 0 & 2 \\ 0 & 1 & h + 2 \\ 0 & 3 & -3 \end{array}\right]

R₃ − 2R₁ → R₃: 1 − 4 = −3.

\left[\begin{array}{rr|c} 1 & 0 & 2 \\ 0 & 1 & h + 2 \\ 0 & 0 & -3h - 9 \end{array}\right]

R₃ − 3R₂ → R₃: −3 − 3(h + 2) = −3h − 9.

-3h - 9 = 0

The last row must be consistent.

-3h = 9

Add 9 to both sides.

h = -3

Divide both sides by −3.

Answer: h = −3.

7.

\left[\begin{array}{rr|c} 1 & 0 & b_1 \\ 2 & 1 & b_2 \\ 0 & -1 & b_3 \end{array}\right]

Augmented matrix with a general b.

\left[\begin{array}{rr|c} 1 & 0 & b_1 \\ 0 & 1 & b_2 - 2b_1 \\ 0 & -1 & b_3 \end{array}\right]

R₂ − 2R₁ → R₂.

\left[\begin{array}{rr|c} 1 & 0 & b_1 \\ 0 & 1 & b_2 - 2b_1 \\ 0 & 0 & b_3 + b_2 - 2b_1 \end{array}\right]

R₃ + R₂ → R₃.

-2b_1 + b_2 + b_3 = 0

Set the last right side equal to 0.

Answer: the plane −2x + y + z = 0. Check: (1, 2, 0) gives −2 + 2 + 0 = 0 and (0, 1, −1) gives 0 + 1 − 1 = 0.

8.

\begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & 1 \\ 2 & 1 & 5 \end{bmatrix}

Coefficient matrix with the vectors as columns.

\begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & 1 \\ 0 & 1 & 1 \end{bmatrix}

R₃ − 2R₁ → R₃: 1 − 0 = 1 and 5 − 4 = 1.

\begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{bmatrix}

R₃ − R₂ → R₃.

Answer: no. There are only 2 pivots for 3 rows. In fact (2, 1, 5) = 2(1, 0, 2) + (0, 1, 1), so the span is a plane.

9.

No. Two vectors in ℝ³ make a 3 × 2 matrix. Each column holds at most one pivot, so there are at most 2 pivots, but spanning ℝ³ needs a pivot in all 3 rows. For example, (1, 0, 0) and (0, 1, 0) span only the xy-plane.

10.

\left[\begin{array}{rr|r} 2 & 4 & 3 \\ 1 & 2 & 5 \end{array}\right]

Augmented matrix [d₁ d₂ | b].

\left[\begin{array}{rr|r} 1 & 2 & 5 \\ 2 & 4 & 3 \end{array}\right]

R₁ ↔ R₂, so the first pivot is 1.

\left[\begin{array}{rr|r} 1 & 2 & 5 \\ 0 & 0 & -7 \end{array}\right]

R₂ − 2R₁ → R₂: 4 − 4 = 0 and 3 − 10 = −7.

Answer: no. The row [0 0 | −7] is inconsistent. Since d₂ = 2d₁, both tracks run along the same line, y = x/2, and (3, 5) is off it. The robot could reach (6, 3) = 3d₁.

Span of vectors FAQ

What is the span of a set of vectors?

It is the set of every linear combination of the vectors. In ℝ³ it is the origin, a line, a plane or all of ℝ³, always passing through the origin.

How do you know if vectors span ℝⁿ?

Put the vectors as the columns of a matrix and row reduce. They span ℝⁿ exactly when there is a pivot in every row.

Can 2 vectors span ℝ³?

No. A matrix with 2 columns has at most 2 pivots, and spanning ℝ³ needs 3. Two vectors span at most a plane.

How do you check if a vector is in the span?

Row reduce the augmented matrix [v₁ ⋯ vₚ | b]. If no row reads [0 ⋯ 0 | c] with c ≠ 0, then b is in the span.

Summary

  • Span{v₁, …, vₚ} is the set of all linear combinations of v₁, …, vₚ.
  • A span always contains the zero vector; in ℝ³ it is the origin, a line, a plane or all of ℝ³.
  • b is in the span exactly when [v₁ ⋯ vₚ | b] is consistent.
  • The vectors span ℝⁿ exactly when [v₁ ⋯ vₚ] has a pivot in every row, so fewer than n vectors never span ℝⁿ.
  • A general b turns each zero row into an equation, such as the equation of the plane the vectors span.

Previous lesson: Linear Combinations

Next lesson: Matrix Equation Ax = b

Back to the Linear Algebra Index