<s>[INST] The equations $x^3+5x^2+px+q=0$and $x^3+7x^2+px+r=0$ have 2 common roots, then find the third root of both equations 
The equations $x^3+5x^2+px+q=0$and $x^3+7x^2+px+r=0$ have 2 common roots, then find the third root of both equations       

From the first equation we can say, $\alpha\beta+\beta\gamma+\gamma\alpha=p/1=p$. Similarly from the second equation we know, $\alpha\beta+\beta\delta+\delta\alpha=p/1=p$
Hence,
$\alpha\beta+\beta\delta+\delta\alpha=\alpha\beta+\beta\gamma+\gamma\alpha$
$\delta(\beta+\alpha)=\gamma(\beta+\alpha)$
$\delta=\gamma$
Hence the third root of both equations should be equal, but $\alpha+\beta+\gamma=-5$ and $\alpha+\beta+\delta=-7$. Now, where did I go wrong?
 [/INST] If $x^3 + 5x^2 + px + q = 0$ and $x^3 + 7x^2 + px + r = 0$ have two common roots then there must exists a common monic binomial factor, $F(x)$.
So $F(x)$ must be a divisor of
$$(x^3 + 7x^2 + px + r) - (x^3 + 5x^2 + px + q) = 2x^2 - (q - r) $$
So $F(x) = x^2 - \dfrac 12(q - r)$.
So, for some $s$
\begin{align}
   x^3 + 7x^2 + px + r 
      &= F(x)(x-s) \\
      &= \left[x^2 - \dfrac 12(q - r)\right](x-s)\\
      &= x^3 - sx^2 - \dfrac 12(q - r)x + \dfrac 12(q - r)s\\
   \hline
   s &= -7 \\
   p &= -\dfrac 12(q - r) \\
   r &= -\dfrac 72(q - r) \\
\hline
   s &= -7 \\
   p &= \dfrac 15 q \\ 
   r &= \dfrac 75 q
\end{align}
And, for some $t$
\begin{align}
   x^3 + 5x^2 + px + q 
      &= \left[x^2 - \dfrac 12(q - r)\right](x-t)\\
      &= x^3 - tx^2 - \dfrac 12(q - r)x + \dfrac 12(q - r)t\\
   \hline
   t &= -5 \\
   p &= -\dfrac 12(q - r) \\
   q &= -\dfrac 52(q - r) \\
\hline
   t &= -5 \\
   p &= \dfrac 15 q \\ 
   r &= \dfrac 75 q
\end{align}
So the third roots are $-7$ and $-5$.
Reality check:
So, suppose $p = -\dfrac 15 q, r = \dfrac 75 q$. To get rid of the fractions, lets let q = 10k.
Then 


*

*$p =  2k$

*$r = 14k$

*$q = 10k$

*$s = -7$

*$t = -5$

*$F(x) = x^2 + 2k$

*$x^3 + 7x^2 + px + r = x^3 + 7x^2 + 2kx + 14k$

*$x^3 + 5x^2 + px + q = x^3 + 5x^2 + 2kx + 10k$

*$F(x)(x-s) = (x^2 + 2k)(x+7) = x^3 + 7x^2 + 2kx + 14k$

*$F(x)(x-t) = (x^2 + 2k)(x+5) = x^3 + 5x^2 + 2kx + 10k$
</s>