$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.