4. In the field of real numbers, solve the system of equations

$$
\begin{aligned}
& x+2 y+3 z=x^{2}-z^{2}+p \\
& y+2 z+3 x=y^{2}-x^{2}+p \\
& z+2 x+3 y=z^{2}-y^{2}+p
\end{aligned}
$$

where $p$ is a real parameter. Discuss the number of solutions with respect to the parameter $p$.
SOLUTION. By adding all three equations, we get

$$
6(x+y+z)=3 p, \quad \text { i.e. } \quad x+y+z=\frac{p}{2} .
$$

Substituting this value into the left sides of the individual equations of the system, rearranged according to the pattern

$$
a+2 b+3 c=2(a+b+c)+c-a,
$$

we obtain after rearrangement the following system of equations (already without the parameter $p$ ):

$$
z-x=x^{2}-z^{2}, \quad x-y=y^{2}-x^{2}, \quad y-z=z^{2}-y^{2}
$$

From the first equation, we easily see that $z-x=0$ or $z+x+1=0$. Similarly, from the second and third equations, we get $x-y=0$ or $x+y+1=0$, and $y-z=0$ or $y+z+1=0$, respectively. Since the given system of equations does not change under cyclic permutation of the unknowns $x, y, z$, it suffices to distinguish two cases:

(i) $x=y=z$. From the original system, we easily determine that the only solution is the triplet

$$
(x, y, z)=\left(\frac{p}{6}, \frac{p}{6}, \frac{p}{6}\right) .
$$

(ii) $x=y$ and $z=-x-1$. For such triplets of unknowns, the given system is equivalent to the single equation $2 x=p+2$ (which we can easily verify by substitution), so we have

$$
x=y=1+\frac{p}{2} \quad \text { and } \quad z=-2-\frac{p}{2} .
$$

By permuting the triplet $(x, y, z)$ in case (i), we do not obtain any additional solutions, while in case (ii), the solutions are

$$
\left(1+\frac{p}{2}, 1+\frac{p}{2},-2-\frac{p}{2}\right),\left(-2-\frac{p}{2}, 1+\frac{p}{2}, 1+\frac{p}{2}\right),\left(1+\frac{p}{2},-2-\frac{p}{2}, 1+\frac{p}{2}\right) .
$$

The solution of the given system is unique precisely when

$$
\frac{p}{6}=1+\frac{p}{2}=-2-\frac{p}{2}
$$

This occurs only for $p=-3$. For any other $p$, the system has exactly four solutions, since no two of the numbers $\frac{1}{6} p, 1+\frac{1}{2} p,-2-\frac{1}{2} p$ are equal for $p \neq-3$.

AUXILIARY PROBLEMS: