Proving Span of Polynomials Consider the set of polynomials {$x,1+x,x-x^2$}. Determine if these polynomials form a basis for $\mathcal{P}_2$. 
I found that they are linearly independent and the rank of the resulting matrix of the polynomials is 3 and that the dimension of $\mathcal{P}_n$ is 3, but where do I go from there to make the connection that the set is a basis for $\mathcal{P}_n$? I know that I should prove that {$x,1+x,x-x^2$} spans $\mathcal{P}_2$ by showing that one can write any polynomial of degree 2, $\alpha x^2 + \beta x+\gamma$, as a linear combination of the elements in {$x,1+x,x-x^2$}. But I really don't know how to show that. This is what I got so far:
$a(x)+b(1+x)+c(x-x^2) = (-c)x^2+(a+b+c)x+b(1)$
If I try to express second degree polynomial $\alpha x^2 + \beta x+\gamma$ in terms of a,b,c, I just get that $\gamma = b$, $\alpha = -c$, $\beta = a+b+c = a+\gamma-\alpha$. Is this not a constraint on $\beta$? I don't know what to do with this information or if I am going about this in the right way. Can someone help me out?
 A: There are a couple of ways you can approach this. 
Ist method
You want to see if a general polynomial $ax^2+bx+c$ can be expressed as a linear combination of the polynomials in the given set, i.e. to find $p,q,r \in \mathbb{R}$ such that
$$p(x)+q(1+x)+r(x-x^2)=ax^2+bx+c.$$
By comparing the coefficients on both sides, we get
\begin{align*}
q&=c\\
p+q+r&=b\\
-r & =a\\
\end{align*}
Thus $r=-a, q=c$ and $p=b-c+a$ satisfies the equation. Thus we can write
$$\color{blue}{(b-c+a)}(x)+\color{blue}{c}(1+x)\color{blue}{-a}(x-x^2)=ax^2+bx+c.$$
IInd method is to show that each element of the basis set $\{1,x,x^2\}$ belongs to the span of $\{x,1+x,x-x^2\}$. This can be achieved as follows: 
\begin{align*}
1&= (1+x)-(x)\\
x&=(x)\\
x^2&=(x)-(x-x^2)
\end{align*}
Once you know that $1,x,x^2$ can be expressed as linear combination of these polynomials this implies span of $\{1,x,x^2\}$ lies  in the span of the given set. 
A: Since $\dim\mathcal P_2=3$, any $3$ linearly independent elements of $\mathcal P_2=3$ form a basis of $\mathcal P_2=3$.
Concerning your approach, you need to show that the system$$\left\{\begin{array}{l}-c=\alpha\\a+b+c=\beta\\b=\gamma\end{array}\right.$$has one and only one solution. And this is true: its only solution is$$\left\{\begin{array}{l}a=\alpha+\beta-\gamma\\b=\gamma\\c=-\alpha.\end{array}\right.$$
