# 9.2: Spanning Sets

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$

( \newcommand{\kernel}{\mathrm{null}\,}\) $$\newcommand{\range}{\mathrm{range}\,}$$

$$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$

$$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$

$$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$

$$\newcommand{\Span}{\mathrm{span}}$$

$$\newcommand{\id}{\mathrm{id}}$$

$$\newcommand{\Span}{\mathrm{span}}$$

$$\newcommand{\kernel}{\mathrm{null}\,}$$

$$\newcommand{\range}{\mathrm{range}\,}$$

$$\newcommand{\RealPart}{\mathrm{Re}}$$

$$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$

$$\newcommand{\Argument}{\mathrm{Arg}}$$

$$\newcommand{\norm}[1]{\| #1 \|}$$

$$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$

$$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

$$\newcommand{\vectorA}[1]{\vec{#1}} % arrow$$

$$\newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow$$

$$\newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vectorC}[1]{\textbf{#1}}$$

$$\newcommand{\vectorD}[1]{\overrightarrow{#1}}$$

$$\newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}}$$

$$\newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}}$$

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

$$\newcommand{\avec}{\mathbf a}$$ $$\newcommand{\bvec}{\mathbf b}$$ $$\newcommand{\cvec}{\mathbf c}$$ $$\newcommand{\dvec}{\mathbf d}$$ $$\newcommand{\dtil}{\widetilde{\mathbf d}}$$ $$\newcommand{\evec}{\mathbf e}$$ $$\newcommand{\fvec}{\mathbf f}$$ $$\newcommand{\nvec}{\mathbf n}$$ $$\newcommand{\pvec}{\mathbf p}$$ $$\newcommand{\qvec}{\mathbf q}$$ $$\newcommand{\svec}{\mathbf s}$$ $$\newcommand{\tvec}{\mathbf t}$$ $$\newcommand{\uvec}{\mathbf u}$$ $$\newcommand{\vvec}{\mathbf v}$$ $$\newcommand{\wvec}{\mathbf w}$$ $$\newcommand{\xvec}{\mathbf x}$$ $$\newcommand{\yvec}{\mathbf y}$$ $$\newcommand{\zvec}{\mathbf z}$$ $$\newcommand{\rvec}{\mathbf r}$$ $$\newcommand{\mvec}{\mathbf m}$$ $$\newcommand{\zerovec}{\mathbf 0}$$ $$\newcommand{\onevec}{\mathbf 1}$$ $$\newcommand{\real}{\mathbb R}$$ $$\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}$$ $$\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}$$ $$\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}$$ $$\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}$$ $$\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}$$ $$\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}$$ $$\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}$$ $$\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}$$ $$\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}$$ $$\newcommand{\laspan}[1]{\text{Span}\{#1\}}$$ $$\newcommand{\bcal}{\cal B}$$ $$\newcommand{\ccal}{\cal C}$$ $$\newcommand{\scal}{\cal S}$$ $$\newcommand{\wcal}{\cal W}$$ $$\newcommand{\ecal}{\cal E}$$ $$\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}$$ $$\newcommand{\gray}[1]{\color{gray}{#1}}$$ $$\newcommand{\lgray}[1]{\color{lightgray}{#1}}$$ $$\newcommand{\rank}{\operatorname{rank}}$$ $$\newcommand{\row}{\text{Row}}$$ $$\newcommand{\col}{\text{Col}}$$ $$\renewcommand{\row}{\text{Row}}$$ $$\newcommand{\nul}{\text{Nul}}$$ $$\newcommand{\var}{\text{Var}}$$ $$\newcommand{\corr}{\text{corr}}$$ $$\newcommand{\len}[1]{\left|#1\right|}$$ $$\newcommand{\bbar}{\overline{\bvec}}$$ $$\newcommand{\bhat}{\widehat{\bvec}}$$ $$\newcommand{\bperp}{\bvec^\perp}$$ $$\newcommand{\xhat}{\widehat{\xvec}}$$ $$\newcommand{\vhat}{\widehat{\vvec}}$$ $$\newcommand{\uhat}{\widehat{\uvec}}$$ $$\newcommand{\what}{\widehat{\wvec}}$$ $$\newcommand{\Sighat}{\widehat{\Sigma}}$$ $$\newcommand{\lt}{<}$$ $$\newcommand{\gt}{>}$$ $$\newcommand{\amp}{&}$$ $$\definecolor{fillinmathshade}{gray}{0.9}$$

## Outcomes

1. Determine if a vector is within a given span.

In this section we will examine the concept of spanning introduced earlier in terms of $$\mathbb{R}^n$$. Here, we will discuss these concepts in terms of abstract vector spaces.

Consider the following definition.

## Definition $$\PageIndex{1}$$: Subset

Let $$X$$ and $$Y$$ be two sets. If all elements of $$X$$ are also elements of $$Y$$ then we say that $$X$$ is a subset of $$Y$$ and we write $X \subseteq Y\nonumber$

In particular, we often speak of subsets of a vector space, such as $$X \subseteq V$$. By this we mean that every element in the set $$X$$ is contained in the vector space $$V$$.

## Definition $$\PageIndex{2}$$: Linear Combination

Let $$V$$ be a vector space and let $$\vec{v}_1, \vec{v}_2, \cdots, \vec{v}_n \subseteq V$$. A vector $$\vec{v} \in V$$ is called a linear combination of the $$\vec{v}_i$$ if there exist scalars $$c_i \in \mathbb{R}$$ such that $\vec{v} = c_1 \vec{v}_1 + c_2 \vec{v}_2 + \cdots + c_n \vec{v}_n\nonumber$

This definition leads to our next concept of span.

## Definition $$\PageIndex{3}$$: Span of Vectors

Let $$\{\vec{v}_{1},\cdots ,\vec{v}_{n}\} \subseteq V$$. Then $\mathrm{span}\left\{ \vec{v}_{1},\cdots ,\vec{v}_{n}\right\} = \left\{ \sum_{i=1}^{n}c_{i}\vec{v}_{i}: c_{i}\in \mathbb{R} \right\}\nonumber$

When we say that a vector $$\vec{w}$$ is in $$\mathrm{span}\left\{ \vec{v}_{1},\cdots ,\vec{v}_{n}\right\}$$ we mean that $$\vec{w}$$ can be written as a linear combination of the $$\vec{v}_1$$. We say that a collection of vectors $$\{\vec{v}_{1},\cdots ,\vec{v}_{n}\}$$ is a spanning set for $$V$$ if $$V = \mathrm{span} \{\vec{v}_{1},\cdots ,\vec{v}_{n}\}$$.

Consider the following example.

## Example $$\PageIndex{1}$$: Matrix Span

Let $$A = \left [ \begin{array}{rr} 1 & 0 \\ 0 & 2 \end{array}\right ]$$, $$B = \left [ \begin{array}{rr} 0 & 1 \\ 1 & 0 \end{array}\right ]$$. Determine if $$A$$ and $$B$$ are in $\mathrm{span}\left\{ M_1, M_2 \right\} = \mathrm{span} \left\{ \left [ \begin{array}{rr} 1 & 0 \\ 0 & 0 \end{array}\right ], \left [ \begin{array}{rr} 0 & 0 \\ 0 & 1 \end{array}\right ] \right\}\nonumber$

Solution

First consider $$A$$. We want to see if scalars $$s,t$$ can be found such that $$A = s M_1 + t M_2$$. $\left [ \begin{array}{rr} 1 & 0 \\ 0 & 2 \end{array}\right ] = s \left [ \begin{array}{rr} 1 & 0 \\ 0 & 0 \end{array}\right ] + t \left [ \begin{array}{rr} 0 & 0 \\ 0 & 1 \end{array}\right ]\nonumber$ The solution to this equation is given by \begin{aligned} 1 &= s \\ 2 &= t\end{aligned} and it follows that $$A$$ is in $$\mathrm{span} \left\{ M_1, M_2 \right\}$$.

Now consider $$B$$. Again we write $$B = sM_1 + t M_2$$ and see if a solution can be found for $$s, t$$. $\left [ \begin{array}{rr} 0 & 1 \\ 1 & 0 \end{array}\right ] = s \left [ \begin{array}{rr} 1 & 0 \\ 0 & 0 \end{array}\right ] + t \left [ \begin{array}{rr} 0 & 0 \\ 0 & 1 \end{array}\right ]\nonumber$ Clearly no values of $$s$$ and $$t$$ can be found such that this equation holds. Therefore $$B$$ is not in $$\mathrm{span} \left\{ M_1, M_2 \right\}$$.

Below is a video on linear combinations and the span of vectors.

Consider another example.

## Example $$\PageIndex{2}$$: Polynomial Span

Show that $$p(x) = 7x^2 + 4x - 3$$ is in $$\mathrm{span}\left\{ 4x^2 + x, x^2 -2x + 3 \right\}$$.

Solution

To show that $$p(x)$$ is in the given span, we need to show that it can be written as a linear combination of polynomials in the span. Suppose scalars $$a, b$$ existed such that $7x^2 +4x - 3= a(4x^2+x) + b (x^2-2x+3)\nonumber$ If this linear combination were to hold, the following would be true: \begin{aligned} 4a + b &= 7 \\ a - 2b &= 4 \\ 3b &= -3 \end{aligned}

You can verify that $$a = 2, b = -1$$ satisfies this system of equations. This means that we can write $$p(x)$$ as follows: $7x^2 +4x-3= 2(4x^2+x) - (x^2-2x+3)\nonumber$

Hence $$p(x)$$ is in the given span.

Consider the following example.

## Example $$\PageIndex{3}$$: Spanning Set

Let $$S = \left\{ x^2 + 1, x-2, 2x^2 - x \right\}$$. Show that $$S$$ is a spanning set for $$\mathbb{P}_2$$, the set of all polynomials of degree at most $$2$$.

Solution

Let $$p(x)= ax^2 + bx + c$$ be an arbitrary polynomial in $$\mathbb{P}_2$$. To show that $$S$$ is a spanning set, it suffices to show that $$p(x)$$ can be written as a linear combination of the elements of $$S$$. In other words, can we find $$r,s,t$$ such that: $p(x) = ax^2 +bx + c = r(x^2 + 1) + s(x -2) + t(2x^2 - x)\nonumber$

If a solution $$r,s,t$$ can be found, then this shows that for any such polynomial $$p(x)$$, it can be written as a linear combination of the above polynomials and $$S$$ is a spanning set.

\begin{aligned} ax^2 +bx + c &= r(x^2 + 1) + s(x -2) + t(2x^2 - x) \\ &= rx^2 + r + sx - 2s + 2tx^2 - tx \\ &= (r+2t)x^2 + (s-t)x + (r-2s) \end{aligned}

For this to be true, the following must hold: \begin{aligned} a &= r+2t \\ b &= s-t \\ c &= r-2s\end{aligned}

To check that a solution exists, set up the augmented matrix and row reduce: $\left [ \begin{array}{rrr|r} 1 & 0 & 2 & a \\ 0 & 1 & -1 & b \\ 1 & -2 & 0 & c \end{array} \right ] \rightarrow \cdots \rightarrow \left [ \begin{array}{rrr|c} 1 & 0 & 0 & \frac{1}{2} a + 2b + \frac{1}{2}c\\ 0 & 1 & 0 & \frac{1}{4}a - \frac{1}{4}c \\ 0 & 0 & 1 & \frac{1}{4}a - b - \frac{1}{4}c \end{array} \right ]\nonumber$

Clearly a solution exists for any choice of $$a,b,c$$. Hence $$S$$ is a spanning set for $$\mathbb{P}_2$$.

Below is a video on determining if a vector is a linear combination of a pair of vectors (No).

Below is a video on determining if a vector is a linear combination of a pair of vectors (Yes).

Below is a video on finding a linear combination of a pair of vectors in 3D.

Below is a video on showing that a vector is in the span of two other vectors.

Below is a video on determining which vectors are in the span of a pair of vectors in $$R^3$$.

Below is a video on determining if a vector is in the span of a pair of vectors in $$R^3$$.

Below is a video on finding a linear combination and additive inverse of two vectors (polynomials).

This page titled 9.2: Spanning Sets is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Ken Kuttler (Lyryx) .