2. Solve the equation

$$
\left(x^{2}+x+2\right)^{x^{2}+x+1}=9
$$
Solution. Since $x^{2}+x+2=\left(x+\frac{1}{2}\right)^{2}+\frac{7}{4}>1$ for every real number $x$, we get that the domain of the given equation is the set of real numbers.

Let $f(x)=x^{x-1}, g(x)=x^{2}+x+2$ and $h(x)=3$. Then the given equation can be written in the form

$$
f(g(x))=f(h(x))
$$

Furthermore, let $1<x_{1}<x_{2}$, then we have $f\left(x_{1}\right)=x_{1}^{x_{1}-1}<x_{1}^{x_{2}-1}<x_{2}^{x_{2}-1}=f\left(x_{2}\right)$, so it follows that the function $f$ is increasing on the set of values taken by the functions $g(x)$ and $h(x)$.

According to this and (1), it must be true that $g(x)=h(x)$, from which we get $x^{2}+x+2=3$, i.e., $x^{2}+x-1=0$, hence the solutions are $x_{1,2}=\frac{-1+\sqrt{5}}{2}$.