# Finding a Basis for a Set of Vectors

We will now look at some examples of finding a basis (a linearly independent spanning set) of a vector space.

## Example 1

**Consider the vector space $\mathbb{R}^5$, and the subspace $U = \{ (x_1, x_2, x_3, x_4, x_5) \in \mathbb{R}^5 : x_1 = 3x_2 \: \mathrm{and} \: x_3 = 7x_4 \}$. Find a basis for $U$.**

We first notice that: $U = \{ (3x_2, x_2, 7x_4, x_4, x_5) \in \mathbb{R}^5 : x_2, x_4, x_5 \in \mathbb{R} \}$.

We thus have that the set of vectors $\{ (3, 0, 0, 0, 0), (0, 1, 0, 0, 0), (0, 0, 7, 0, 0), (0, 0, 0, 1, 0), (0, 0, 0, 0, 1) \}$ is a basis for $U$. We can chose this since any vector $u \in U$ can be written as a linearly combination of these vectors:

(1)Furthermore we note that this set of vectors is linearly independent, that is the vector equation:

(2)Holds if and only if $a_1 = a_2 = a_3 = a_4 = a_5 = 0$. Therefore $\{ (3, 0, 0, 0, 0), (0, 1, 0, 0, 0), (0, 0, 7, 0, 0), (0, 0, 0, 1, 0), (0, 0, 0, 0, 1) \}$ is a basis of $U$.

## Example 2

**Consider the vector space $\wp_4 (\mathbb{F})$, the set of linearly independent vectors $v_1 = 1 + x^2$ and $v_2 = 1 - x^2$, and the spanning set of vectors $\{ 1, x, x^2, x^3, x^4 \}$. Which vectors from this spanning set $\{ 1, x, x^2, x^3, x^4 \}$ need to be added to $\{ v_1, v_2 \}$ to form a basis?**

Recall from the Theorems Regarding a Basis of a Vector Space page that any linearly independent set of vectors from a finite dimensional vector space $V$ can be expanded to form a basis of $V$. We first note that $\wp_4 (\mathbb{F})$ is finite dimensional, and so this particular theorem holds. One by one we will decide if the vectors from the spanning set should be added to our vector set $\{ v_1, v_2 \}$.

**Step 1:** Let's first decide whether we should add $1$ to our list. Notice that $1 = \frac{1}{2} (1 + x^2) + \frac{1}{2} (1 - x^2)$, and so $1$ is a linear combination of the vectors $\{ v_1, v_2 \}$ so we will NOT add this vector to our linearly independent set (otherwise our set would no longer be linearly independent).

**Step 2:** Now let's decide whether we should add $x$ to our list. Notice that the vector equation is satisfied only when $a + b = 0$, $a - b = 0$, and $c = 0$, which implies that $a = b = c = 0$.

Therefore $x$ is not a linear combination of the vectors $\{ v_1, v_2 \}$, so we will add it to our list which is now $\{ v_1, v_2, x \}$.

**Step 3:** Now let's decide whether we should add $x^2$ to our list. Notice that $x^2 = \frac{1}{2}(1 + x^2) - \frac{1}{2}(1 - x^2 + 0x$. Therefore $x^2$ is a linear combination of the vectors $\{ v_1, v_2, x \}$ and so we will NOT add $x^2$ to our list.

**Step 4:** Now let's decide whether we should add $x^3$ to our list. Notice that $x^3$ cannot possibly be a linear combination of the sum of terms of $(1 + x^2)$, $(1 - x^2)$ or $x$ since $\deg(x^3) = 3$ and the degree of the vectors in this set are at most 2, so $x^3$ is not a linear combination of $\{ v_1, v_2, x \}$ so we will add it to our list to get $\{ v_1, v_2, x, x^3 \}$.

**Step 5:** Lastly, let's decide whether we should add $x^4$ to our list. By a similar argument as above, $x^4$ cannot be a linear combination of lower degree polynomials, and so $x^4$ is not a linear combination of $\{v_1, v_2, x, x^3 \}$ and we add it to our list to get $\{ v_1, v_2, x, x^3, x^4 \}$.

Therefore $\{ v_1, v_2, x, x^3, x^4 \}$ is a basis of $\wp_4 (\mathbb{F})$.