2. The solution to the equation $1-\frac{2}{x}-\frac{1}{x^{2}}=2 x+x^{2}$ is
2. $\frac{-3 \pm \sqrt{5}}{2}$.

The original equation is $\left(x+\frac{1}{x}\right)^{2}+2\left(x+\frac{1}{x}\right)-3=0$. Let $x+\frac{1}{x}=t$, then we get $t^{2}+2 t-3=0$, which is $(t+3)(t-1)=0, t_{1}=1, t_{2}=-3$. When $t=1$, we get $x+\frac{1}{x}=1$, which has no solution; when $t=-3$, we get $x+\frac{1}{x}=-3, x=\frac{-3 \pm \sqrt{5}}{2}$. Upon verification, the solutions to the equation are $x=\frac{-3 \pm \sqrt{5}}{2}$.