<s>[INST] Show that the set $B=\{ x+1, x^2+x, x^2-1, x \}$ span $P_2$ Show that the set $B=\{ x+1, x^2+x, x^2-1, x \}$ span $P_2$, the set of polynomial of degree $\leq 2$ with real coefficients. Extract a basis from this set.
I am uncertain of the first part of the question. But I believe the basis of this set is (x, x+1,x-1).
 [/INST] Let $p \in P_{2}$ be any polynomial. Then $p$ can be written as $p = a+bx+cx^2$, for some $a,b,c \in K$, assuming the canonic basis $\lbrace 1,x,x^2\rbrace$. 
Let $a_{1},a_{2},a_{3},a_{4} \in K$. Then
$\begin{align}\hat{p} &= a_{1}(x+1) + a_{2}(x^2+x)+a_{3}(x^2-1)+ a_{4}x \\& = a_{1}x+a_{1}+a_{2}x^2+a_{2}x+a_{3}x^2-a_{3}+a_{4}x \\&=a_{1}-a_{3}+(a_{1}+a_{2}+a_{4})x+(a_{2}+a_{3})x^2\end{align}$ 
Take $a=(a_{1}-a_{3}), b=(a_{1}+a_{2}+a_{4}), c=(a_{2}+a_{3})$ and we have that $p$ is a linear combination of $x+1,x^2+x,x^2-1,x$, because of our choice for $a,b$ and $c$ we have $p=\hat{p}$ . Thus $P_{2}$ is spanned by $\lbrace x+1,x^2+x,x^2-1,x \rbrace$. 
</s>