2. Solve the inequality $x^{2}-2 x+1-\left|x^{3}-1\right|-2\left(x^{2}+x+1\right)^{2} \geqslant 0$.
Answer. $x \in\left[-1 ;-\frac{1}{2}\right]$.

Solution. The given inequality is equivalent to the inequality

$$
|x-1|^{2}-|x-1|\left(x^{2}+x+1\right)-2\left(x^{2}+x+1\right)^{2} \geqslant 0
$$

Let $|x-1|=u, x^{2}+x+1=v$ (note that $u \geqslant 0, v>0$, since $v$ is a quadratic trinomial with a negative discriminant). Then the inequality takes the form $u^{2}-u v-2 v^{2} \geqslant 0$. Factoring the left side (for example, considering it as a quadratic function in terms of $u$ and finding the roots), we get $(u+v)(u-2 v) \geqslant 0$. The first factor is positive, so $u \geqslant 2 v$. Returning to the variable $x$:

$$
2 x^{2}+2 x+2 \leqslant|x-1| \Leftrightarrow\left(2 x^{2}+2 x+2\right)^{2}-(x-1)^{2} \leqslant 0 \Leftrightarrow\left(2 x^{2}+3 x+1\right)\left(2 x^{2}+x+3\right) \leqslant 0
$$

The second factor is positive, so we are left with $2 x^{2}+3 x+1 \leqslant 0$, from which $-1 \leqslant x \leqslant-\frac{1}{2}$.