3B. In the equation $x^{2}+p x+q=0$, determine the real numbers $p$ and $q$, if the difference between the roots of the equation is 5, and the difference between their cubes is 35.
Solution. Let $x_{1}$ and $x_{2}$ be the roots of the given equation. From the condition of the problem, we have $x_{1}-x_{2}=5, x_{1}^{3}-x_{2}^{3}=35$. Since

$$
x_{1}^{3}-x_{2}^{3}=\left(x_{1}-x_{2}\right)\left(x_{1}^{2}+x_{1} x_{2}+x_{2}^{2}\right)
$$

we get $x_{1}^{2}+x_{1} x_{2}+x_{2}^{2}=7$. Then

$$
q=x_{1} x_{2}=\frac{1}{3}\left[\left(x_{1}^{2}+x_{1} x_{2}+x_{2}^{2}\right)-\left(x_{1}-x_{2}\right)^{2}\right]=\frac{1}{3}(7-25)=-6
$$

$$
p^{2}=\left(x_{1}+x_{2}\right)^{2}=\left(x_{1}-x_{2}\right)^{2}-4 x_{1} x_{2}=25-24=1
$$

from which we get $p=-1$ or $p=1$.