TITLE: Basis for a Subspace of Polynomials of Degree 5
QUESTION [7 upvotes]: I have the following question: "Consider the subspace $W$ of $P_5(\mathbb{R})$ (the set of polynomials of at most degree five) given by $$W=\{p(x)\in P_5(\mathbb{R})|p(1)=p(-1)=0\}.$$ Find a basis for $W$, and compute its dimension." I have been working on this for a bit, and I know that the standard basis for $P_5(\mathbb{R})$ won't work, so I came up with $$\{x^5-x^3,x^4-2x^2+1,x^3-x,x^2-1\}.$$ However, I'm  afraid that the set doesn't span $P_5(\mathbb{R})$, but I think that it's linearly independent.  Once I have all this, I can easily find the dimension.  Thank you in advance.

REPLY [2 votes]: Written in linear algebra terms, given the basis $e_i = x^i$ and a polynomial $p$ expressed as
$$\begin{bmatrix}
p_0  \\
p_1  \\
p_2 \\
p_3\\
p_4\\
p_5
\end{bmatrix}$$
evaluating $p$ at 1 is the same as $[1,1,1,1,1,1]p$, and evaluating it at -1 is  $[1,-1,1,-1,1,-1]p$
We have that both are equal to zero, so 
$$\begin{bmatrix}
1&1&1&1&1&1  \\
1&-1&1&-1&1&-1
\end{bmatrix}p =\begin{bmatrix}
0  \\
0
\end{bmatrix}$$
So we can take the augmented matrix 
$$\begin{bmatrix}
1&1&1&1&1&1 &|0 \\
1&-1&1&-1&1&-1&|0
\end{bmatrix}$$
And reduce it to row-echelon form
$$\begin{bmatrix}
1&0&1&0&1&0 &|0 \\
0&1&0&1&0&1&|0
\end{bmatrix}$$
This tells you that among even $i$, you can pick two $p_i$ to be free and the third will be fixed, and similarly for odd $i$. For instance, we can have $p_i$ free for $i<4$, and then $p_5=-(p_3+p_1)$ and $p_4=-(p_2+p_0)$. If we successively set one free variable to 1 and the other free variables to zero, this gives
$$1-x^4$$
$$x-x^5$$
$$x^2-x^4$$
$$x^3-x^5$$
Another basis, that could be written more succinctly, would be $b_i = e_{i+2}-e_{imod2}$, which gives
$$b_0 = x^2-1$$
$$b_1=x^3-x$$
$$b_2=x^4-1$$
$$b_3 = x^5-x$$