Problem 9.4. Find all values of the real parameter $p$ such that the equation $\left|x^{2}-p x-2 p+1\right|=p-1$ has four real roots $x_{1}, x_{2}, x_{3}$ and $x_{4}$ such that

$$
x_{1}^{2}+x_{2}^{2}+x_{3}^{2}+x_{4}^{2}=20
$$

## Ivailo Kortezov
9.4. Answer: $p=2$. The condition $p>1$ is necessary (but not sufficient!) for existence of four roots. We consider two cases:

Case 1. If $x^{2}-p x-2 p+1=p-1 \Longleftrightarrow x^{2}-p x-3 p+2=0$ then by the Vieta theorem we obtain $x_{1}^{2}+x_{2}^{2}=p^{2}-2(2-3 p)=p^{2}+6 p-4$.

Case 2. If $x^{2}-p x-2 p+1=1-p \Longleftrightarrow x^{2}-p x-p=0$ then by the Vieta theorem we obtain $x_{3}^{2}+x_{4}^{2}=p^{2}+2 p$.

Now the condition implies

$$
x_{1}^{2}+x_{2}^{2}+x_{3}^{2}+x_{4}^{2}=20 \Longleftrightarrow 2 p^{2}+8 p-4=20 \Longleftrightarrow p^{2}+4 p-12=0
$$

whence $p=2$ or $p=-6$. The second value does not satisfy $p>1$. For $p=2$ we do have four real roots (direct check!).