6.166. $(x+4)(x+1)-3 \sqrt{x^{2}+5 x+2}=6$.
Solution.

Rewrite the equation as $x^{2}+5 x+4-\sqrt{x^{2}+5 x+2}=6 \Leftrightarrow$ $\Leftrightarrow x^{2}+5 x-2-3 \sqrt{x^{2}+5 x+2}=0$. Let $\sqrt{x^{2}+5 x+2}=y$, where $y \geq 0$, $x^{2}+5 x+2=y^{2}, x^{2}+5 x=y^{2}-2$. The equation in terms of $y$ is $y^{2}-3 y-4=0$, from which $y_{1}=-1, y_{2}=4 ; y_{1}=-1<0$ is not valid.

Then $\sqrt{x^{2}+5 x+2}=4, x^{2}+5 x+2=16, x^{2}+5 x-14=0$, from which $x_{1}=-7, x_{2}=2$.

Answer: $x_{1}=-7, x_{2}=2$.