Q:

What is meant by "equating the coefficients of 1, x, and $x^2$ gives a set of linear equations?

The textbook I am reading shows an example problem:
Problem:
Show that {$1 + x, 3x + x^2, 2 + x - x^2$} is independent in $P_2$.  Where $P_2$ is the set of all polynomials.  
Solution:
Suppose a linear combination of these polynomials vanishes.
$$s_1(1 + x) + s_2(3x + x^2) + s_3(2 + x - x^2) = 0$$
Equating the coefficients of 1, x, and $x^2$ gives a set of linear equations.
$$s_1 + \space \space  + 2s_3 = 0$$
$$s_1 + 3s_2 +  \space s_3 = 0$$
$$\space s_2 - \space s_3 = 0$$
The only solution is $s_1 = s_2 = s_3 = 0$.  
My question is what is meant by "Equating the coefficients of 1, x, and $x^2$ gives a set of linear equations." i.e. what exactly is done in this step to obtain the three equalities after?

A:

Starting from the equation:
$$s_1(1+x)+s_2(3x+x^2)+s_3(2+x-x^2)=0$$
This can be rewritten as:
$$(s_1+2s_3)x^0+(s_1+3s_2+s_3)x^1+(s_2-s_3)x^2=0$$
The RHS is zero but can also be written as:
$$(s_1+2s_3)x^0+(s_1+3s_2+s_3)x^1+(s_2-s_3)x^2=0*x^0+0*x^1+0*x^2$$.
These two expressions can only be equal to each other if each power has the same coefficient is equivalent. But that means that the coefficient in from of $x^0$ on the left and right hand side equate ($s_1+2s_3=0$), as well as the coefficient in front of $x^1$ (s_1+3s_2+s_3=0), and of course the coefficient in front of $x^2$ (s_2-s_3=0).
This gives the system of equations:
$$s_1+2s_3=0$$
$$s_1+3s_2+s_3=0$$
$$s_2-s_3=0$$
If the only solution is $s_1,s_2,s_3=0$ then the basis (originally polynomials in this case) is independent.

