If the quadratic equation $x^2+px+q=0$ and $x^2+qx+p=0$ have a common root

If quadratic equations $x^2+px+q=0$ and $x^2+qx+p=0$ have a common root, prove that: either $p=q$ or $p+q+1=0$.

My attempt:

Let $\alpha$ be the common root of these equations. Since one root is common, we know: $$(q-p)(p^2-q^2)=(q-p)^2.$$ How do I get to the proof from here?

If you can obtain $$(q-p)(p^2-q^2)=(q-p)^2$$ Since $p^2-q^2=(q-p)(-p-q)$, we have $$(q-p)^2(-p-q)=(q-p)^2$$

Hence $(q-p)^2(1+p+q)=0$.

Hence $q=p$ or $1+p+q =0$

Let $x$ be the common root.

Thus, $$px+q=qx+p$$ or $$(x-1)(p-q)=0,$$ which gives $p=q$ or $x=1$ and from this we obtain $p+q+1=0$.

• Where does that $x$ come from? – pi-π Aug 31 '17 at 23:38
• @blue_eyed_... $x$ is the common root. Hence, $x^2+px+q=x^2+qx+p$. – Michael Rozenberg Aug 31 '17 at 23:39
• " from here" mean from where? – pi-π Aug 31 '17 at 23:42
• @blue_eyed_... It means from $x=1$ we obtain $1^2+p\cdot1+q=0$ or $p+q+1=0$. – Michael Rozenberg Aug 31 '17 at 23:43

Let $\alpha$ be the common root.

\begin{align} \alpha^2 + p \alpha + q &= 0 \\ \alpha^2 + q \alpha + p &= 0 \\ \hline (p-q)\alpha + (q-p) &= 0 \\ (p-q)(\alpha-1) &= 0 \end{align}

$\alpha = 1$ or $p=q$.

If $\alpha = 1$, then $\alpha^2 + p \alpha + q = 0$ becomes $1+p+q = 0$