Matching of polynomial coefficients I am trying to find the proof/theorem that states:

Given two polynomials in x, if they are equal to eachother, their coefficients must also be equal

For example, in

ax^3 + bx^2 + cx + d = ex^2 + fx + g

a MUST equal 0, and b must equal e, etc...
Does anyone have the actual proof stating this?
Thank you!
 A: Set $x=0$ and get $0+0+0+d=0+0+g$ so $d=g$. Subtract $d=g$ from both sides, cancel off $x$, and continue...
A: It's the same thing as saying that if a polynomial is equal to the zero polynomial then its coefficients must all be zero. That can be proved a number of ways. For example, if the constant term is not zero, then the polynomial is not zero at zero, so it isn't the zero polynomial; if the constant term is zero, you can factor a power of the variable out of the polynomial to get one where the constant term is not zero, reducing to a problem already solved. 
A: In a general field, the Vandemonde determinant tells all.
A: The way I do this is to start with 
$$p(x)=a_nx^n+a_{n-1}x^{n-1}+\cdots+a_1x+a_0\sim b_nx^n+b_{n-1}x^{n-1}+\cdots+b_1x+b_0=q(x).$$
If I want these to be equal I want their outputs to be equal and in particular at $x=0$:
$$p(0)\overset{!}{=}q(0)\Rightarrow a_0=b_0.$$
Also I want all of their derivatives to be equal if they are to be equal. Direct calculation shows that
$$\begin{align}
p'(x)&=a_1+\mathcal{O}(x)
\\ p''(x)&=2a_2+\mathcal{O}(x)
\\ \vdots&
\\ p^{(k)}(x)&=k!a_k+\mathcal{O}(x),
\end{align}$$
and similarly
$$q^{(k)}(x)=k!b_k+\mathcal{O}(x).$$
Setting 
$$p^{(k)}(0)\overset{!}{=}q^{(k)}(0)\Rightarrow k!a_k=k!b_k\Rightarrow a_k=b_k,$$
for all $k$.
