Find a and b, that there are two roots of $x^3 - 5x^2+ 7x = a$ and these numbers are roots of $x^3 - 8x + b = 0$ Find a and b, that there are two roots of $x^3 - 5x^2+ 7x = a$, that they are roots of $x^3 - 8x + b = 0$
I find that $a+b=5x(-x+3) $
Also I tried to solve second equation to get roots, depending on b, but my approach was unsuccessful.
Any help is appreciated!

Let $P(x) = x^3-5x^2+7x-a$ and $Q(x) = x^3-8x+b$ and $\gamma, \delta$ be their common roots.
We can decompose them as
$$\begin{cases}
P(x) &= (x-\alpha)M(x),\\
Q(x) &= (x-\beta)M(x)
\end{cases}\quad\text{ where }\quad M(x) = (x-\gamma)(x-\delta)
$$
Subtract them, we get
$$5x^2-15x+b+a = Q(x)-P(x) = (\alpha-\beta)M(x)$$
By comparing the coefficients of $x^2$, we find $\alpha - \beta = 5$ and
$$M(x) = x^2 - 3x + \frac{a+b}{5}$$
Notice
$$(2-\alpha)M(x) = P(x) - (x-2)M(x) =  \frac15((b+a-5)x + (3a-2b))$$
If $\alpha \ne 2$, the LHS is a polynomial of degree $2$ while the RHS is a polynomial of degree at most $1$. This is impossible, so $\alpha = 2$ and
$$(b+a-5)x + (3a-2b) = 0
\quad\implies\quad
\begin{cases}
b+a-5 &= 0\\
3a-2b &= 0
\end{cases}
\quad\implies\quad
(a,b) = (2,3)
$$
