# Why is {$1+x,1+x+x^2,1$} a basis for $P2$ (the set of all polynomials of degree 2 or less), while {$1+x,1+x+x^2,x$} isn't? (extending a basis)

$$A =$$ {$$1+x,1+x+x^2,1$$} is a basis for $$P2$$ ($$P2$$ signifies the set of all polynomials of degree 2 or less). It is linearly independent and spans $$P2$$ (since any arbitrary vector in $$P2$$ can be written as a linear combination of $$1+x,1+x+x^2,$$ and $$1$$).

So the dimension of $$P2$$ is 3. The set $$B =$$ {$$1+x,1+x+x^2,x$$} is linearly independent and has 3 vectors. Furthermore, it even spans all of $$P2$$ since any arbitrary vector in $$P2$$ can be written as a linear combination of $$1+x,1+x+x^2,$$ and $$x$$ .

As it turns out, the matrix I made in an attempt to prove that set $$A$$ spans $$P2$$ is just one row switch away from the matrix corresponding to set B. I feel that has something to do with my confusion but I'm not sure what.

My textbook asked me to extend {$$1+x,1+x+x^2$$} into a basis for $$P2$$. In order to do that I added $$1,x,$$ and $$x^2$$ to the set and tried to find which of those three were linearly dependent on the existing two vectors and thus could be removed. I found that none of them are linearly dependent, but my textbook only gave set $$A$$ as an answer...what is going on here? Where is the mistake in my thinking? Could any combination of three vectors here work? Any help is greatly appreciated.

• They are both bases, both extending $\{1 + x, 1 + x + x^2\}$. In most cases, there will be multiple bases that extend a given linearly independent set. In this case, there are infinitely many, so you'll have to excuse your textbook for not listing them all! :-) – Theo Bendit Feb 1 at 1:54
• @TheoBendit I see, it's truly an odd question then seeing as there are three right answers and only one was specified...thank you for the response, you've put my mind at ease! – James Ronald Feb 1 at 1:55
• Well actually, like I said, there are infinitely many. To properly extend a linearly independent set $S$ by one element, all you need to do is add in a vector that doesn't lie in the span of $S$. Since $S$ spans a plane in the three-dimensional space $P_2$, almost all vectors would work! – Theo Bendit Feb 1 at 2:01
• @TheoBendit Ahh right of course, I should've said infinitely many answers as opposed to just three. Thanks again! – James Ronald Feb 1 at 2:43