TITLE: Finding a basis for subspace of polynomials
QUESTION [8 upvotes]: Let $V=\mathscr{P}_{3}$ be the vector space of polynomials of degree 3. Let W be the
subspace of polynomials p(x) such that p(0)= 0 and p(1)= 0. Find a basis for W. Extend the basis to a basis of V.
Here is what I've done so far.
$$p(x) = ax^3 + bx^2 + cx + d$$
$$p(0) = 0 = ax^3 + bx^2 + cx + d\\\text{d = 0}\\
p(1) = 0 = ax^3 + bx^2 + cx + 0 => a + b + c = 0\\
c = -a - b\\
p(x)= ax^3 + bx^2 + (-a-b)x = 0\\
= a(x^3-x) + b(x^2-x)\\
\text{Basis is {(x^3-x),(x^2-x)}}
$$
Would this be a correct basis for W, and how would I extend it to the vector space V?

REPLY [2 votes]: Yes, that's fine. Notice also that the polynomials you have factorise as
$$ x(x-1)q(x), $$
where you have $q(x)=1$ and $q(x)=1+x$.
An obvious initial way to extend is to throw in a constant function, since we clearly can't make one of those out of things that have roots at $0$ and $1$. Similarly, we can't make a polynomial of degree $1$ out of this basis, so we can add $x$. The original space has dimension $4$ (being spanned by $\{1,x,x^2,x^3\}$, so we can't find more linearly independent vectors. Therefore the final basis is
$$ \{ 1,x,x(1-x),x(1-x)(1+x) \}. $$