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

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} \leqslant 0
$$

Let us denote here $|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} \leqslant 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) \leqslant 0$. The first factor is positive, so $u \leqslant 2 v$. Returning to the variable $x$:

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

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