You cannot always simply “compare” the corresponding coefficients of $2$ polynomial equations of the same degree when they have common roots. It can only be done when both the equations are exactly the same, i.e., the given polynomials are scalar multiples of each other.
That is, comparing coefficients is valid when both the polynomial equations have all roots(no. of common roots is the same as the degree of the polynomial) common, since in this case, both the equations are exactly the same by the factor theorem.
For example, let’s consider deriving the condition for $2$ quadratic equations $a_1x^2+b_1x+c_1=0$ and $a_2x^2+b_2x+c_2=0$ to have both roots common, say $\alpha$ and $\beta$. Since a quadratic equation has $2$ roots, these equations can be rewritten in factor form as
$$a_1(x-\alpha)(x-\beta)=0$$
$$a_2(x-\alpha)(x-\beta)=0$$
This means that both these equations are the same, so both the quadratic polynomials $a_1x^2+b_1x+c_1$ and $a_2x^2+b_2x+c_2$ only differ by a non-zero scalar, i.e., the coefficients of $x^2$, $x$ and $x^0$ are in the same ratio. This is why we can compare the coefficients in this case:
$$\frac{a_1}{a_2}= \frac{b_1}{b_2} = \frac{c_1}{c_2} $$
But when both equations have only $1$ root common, say $\alpha$, they would be of the form:
$$a_1(x-\alpha)(x-\beta)=0$$
$$a_2(x-\alpha)(x-\gamma)=0$$
Since $\beta\ne\gamma$ as already stated, both these equations are not the same, hence we cannot compare their coefficients.
So, to derive the condition for $2$ quadratic equations to have only one common root, consider putting $x=\alpha$ in both the equations:
$$a_1\alpha^2+b_1\alpha+c_1=0$$
$$a_2\alpha^2+b_2\alpha+c_2=0$$
This can be recognized as a system of linear equations in $2$ variables. By the cross-multiplication method/Cramer’s rule:
$$\frac{\alpha^2}{b_1c_2-b_2c_1}=\frac{\alpha}{c_1a_2-c_2a_1}=\frac1{a_1b_2-a_2b_1}$$
Eliminating $\alpha$, we get:
$$\left(\frac{c_1a_2-c_2a_1}{a_1b_2-a_2b_1}\right)^2=\frac{b_1c_2-b_2c_1}{a_1b_2-a_2b_1}$$
$$\therefore\boxed{(c_1a_2-c_2a_1)^2=(a_1b_2-a_2b_1)(b_1c_2-b_2c_1)}$$
$$(x+1)(x-1)\quad =x^2-1\space\quad =x^2+0x-1 = 0\ (x-1)(x-1) \quad = (x-1)^2\quad = x^2+2x+1 = 0$$
– poetasis Sep 10 '21 at 16:11