5. Find all values of the parameter $b$, for which for any value of the parameter $a \in[-1 ; 2]$ the inequality $\operatorname{tg}^{2} x+4(a+b) \operatorname{tg} x+a^{2}+b^{2}-18<0$ is satisfied for each $x \in[-\pi / 4 ; \pi / 4]$.
Solution. Let's make the substitution $y=\operatorname{tg} x, \quad y \in[-1 ; 1]$. We get $y^{2}+4(a+b) y+a^{2}+b^{2}-18<0$. Consider the function $f(y)=y^{2}+4(a+b) y+a^{2}+b^{2}-18$. Its graph is a parabola with branches directed upwards, with the vertex at the point with abscissa $y_{0}=-2(a+b)$. Let's determine for which values of $a$ and $b$ the inequality $f(y)<0$ holds for any $y \in[-1 ; 1]$.

$$
\left\{\begin{array} { l } 
{ f ( - 1 ) < 0 , } \\
{ f ( 1 ) < 0 , }
\end{array} \quad \left\{\begin{array}{l}
(a-2)^{2}+(b-2)^{2}<25 \\
(a+2)^{2}+(b+2)^{2}<25
\end{array}\right.\right.
$$

On the coordinate plane $O a b$, let's plot the set of points $(a ; b)$ that satisfy these conditions. We get the intersection of two circles of radius 5 without the boundary.

To solve the problem, we need to find such values of $b$ for which the points $(a ; b)$ fall into the resulting area for any $a \in[-1 ; 2]$.

Such values of $b$ form the interval $\left(b_{1} ; b_{2}\right)$. The lower boundary $b_{1}$ is found by substituting $a=-1$ into the equation of the circle $(a-2)^{2}+(b-2)^{2}=25$. We get $b_{1}=-2$. The upper boundary $b_{2}$ is found by substituting $a=2$ into the equation of the circle $(a+2)^{2}+(b+2)^{2}=25$.

We get $b_{2}=1$.

Answer: $(-2 ; 1)$.