4. [6 points] Solve the inequality $2 x^{4}+x^{2}-2 x-3 x^{2}|x-1|+1 \geqslant 0$.
Answer: $\left(-\infty ;-\frac{1+\sqrt{5}}{2}\right] \cup\left[-1 ; \frac{1}{2}\right] \cup\left[\frac{\sqrt{5}-1}{2} ;+\infty\right)$.

Solution. The inequality can be rewritten as $2 x^{4}+(x-1)^{2}-3 x^{2}|x-1| \geqslant 0$ or $\mid x-$ $\left.1\right|^{2}-3 x^{2}|x-1|+2 x^{4} \geqslant 0$. To factorize the left side, note that it represents a quadratic trinomial in terms of $y=|x-2|$ with a discriminant equal to $\left(3 x^{2}\right)^{2}-4 \cdot 2 x^{4}=x^{4}$. Therefore, the roots $y_{1,2}$ are $\frac{3 x^{2} \pm x^{2}}{2}$, i.e., $y_{1}=x^{2}$ and $y_{2}=2 x^{2}$, and the inequality becomes $\left(|x-1|-x^{2}\right)\left(|x-1|-2 x^{2}\right) \geqslant 0$.

In the last inequality, we need to compare the product of two numbers with zero, so by replacing each factor with an expression of the same sign, we obtain an equivalent inequality. It is sufficient to note that for non-negative numbers $A$ and $B$, the sign of the difference $A-B$ coincides with the sign of the difference of squares $A^{2}-B^{2}=(A-B)(A+B)$. From this, we get

$$
\begin{aligned}
& \left((x-1)^{2}-x^{4}\right)\left((x-1)^{2}-4 x^{4}\right) \geqslant 0 \Leftrightarrow \\
& \left(x^{2}+x-1\right)\left(x^{2}-x+1\right)\left(2 x^{2}+x-1\right)\left(2 x^{2}-x+1\right) \geqslant 0 \Leftrightarrow \\
& \left(x^{2}+x-1\right)\left(2 x^{2}+x-1\right) \geqslant 0 \Leftrightarrow x \in\left(-\infty ;-\frac{1+\sqrt{5}}{2}\right] \cup\left[-1 ; \frac{1}{2}\right] \cup\left[\frac{\sqrt{5}-1}{2} ;+\infty\right)
\end{aligned}
$$