6.018. $x^{2}+x+x^{-1}+x^{-2}=4$.

Translate the above text into English, please retain the original text's line breaks and format, and output the translation result directly.

6.018. $x^{2}+x+x^{-1}+x^{-2}=4$.
## Solution.

Domain of definition: $x \neq 0$.

From the condition, we have $\left(x^{2}+\frac{1}{x^{2}}\right)+\left(x+\frac{1}{x}\right)-4=0$.

Let $x+\frac{1}{x}=y \Rightarrow x^{2}+2+\frac{1}{x^{2}}=y^{2}$ or $x^{2}+\frac{1}{x^{2}}=y^{2}-2$. Our equation becomes $y^{2}-2+y-4=0 \Leftrightarrow y^{2}+y-6=0$, from which $y_{1}=-3, y_{2}=2$. For $x$, we get two equations: $x+\frac{1}{x}=-3$, from which $x_{1,2}=\frac{-3 \pm \sqrt{5}}{2}$ or $x+\frac{1}{x}=2$, from which $x_{3,4}=1$.

Answer: $x_{1,2}=\frac{-3 \pm \sqrt{5}}{2}, x_{3,4}=1$ :