5. What should $k$ be so that the inequality

$$
\left|\frac{x^{2}-k x+1}{x^{2}+x+1}\right|<3
$$

holds for any value of $x$?
Solution. Domain of definition: $x \in \mathbf{R}$, since $x^{2}+x+1>0$ for any real $x$. Therefore, the given inequality is equivalent to the inequality

$$
-30 \\
4 x^{2}-(k-3) x+4>0
\end{array}\right.
$$

For the inequalities in the system to be satisfied simultaneously for all $x$, it is necessary and sufficient that the discriminants of the quadratic polynomials on the left sides of the inequalities be negative, i.e., the system

$$
\left\{\begin{array}{l}
(3+k)^{2}-16=(k+7)(k-1)<0 \\
(k-3)^{2}-64=(k+5)(k-11)<0
\end{array}\right.
$$

must be satisfied. Solving this, we find $k \in[-5 ; 1]$.

Answer: $k \in[-5 ; 1]$.