TITLE: Proof: Two polynomials $P(x)$ and $Q(x)$ attain same value for every $x \in \mathbb R$ if and only if coefficients $p_i = q_i$ are equal for every $i$
QUESTION [5 upvotes]: Proof: Two polynomials $P(x)$ and $Q(x)$ attain same value for every $x \in \mathbb R$ if and only if coefficients $p_i = q_i$ are equal for every $i$
I've been thinking how to prove this. I know we can write both polynomials as a product of irreducible polynomials corresponding to roots, however this only prove that the values attained by the polynomials are equal for every $x \in \mathbb R$ not that the coefficients are equal.
Also we could let $x = 0$ to conclude $p_0 = q_0$. However we may not cancel $x$ by division on both sides ? Then we cannot continue the procedure, since division by zero is undefined.
Could someone give me a hint ?

REPLY [2 votes]: Let $S(x) = \sum_{i=0}^ns_ix^i$ be a degree-$n$ polynomial for some $n \ge 0$ (so that $s_n \ne 0$). As $|x|$ grows without limit, the highest-order term $s_nx^n$ comes to dominate all the other terms, in the sense that it is bigger in absolute value than all the other terms added together. Specifically, this happens when
$$|x| > \frac1{|s_n|}\sum_{i=0}^{n-1}|s_i|$$
(as long as $|x| > 1$). So if the above inequality holds, then $|S(x)|$ must be strictly greater than zero. This means that $S$ can't be zero on the whole of $\mathbb R$.
Now just put $S(x) = P(x) - Q(x)$. Your hypothesis implies that $S$ is zero on the whole of $\mathbb R$, so it can't be a degree-$n$ polynomial for any $n \ge 0$. Hence all its coefficients $s_i = p_i - q_i$ must be zero.