2. Determine all real values of the parameter \( a \) for which the system of equations

$$
\left\{\begin{array}{l}
x-y=a(1+x y) \\
x+y+x y+2=0
\end{array}\right.
$$

has a unique solution.
Solution. We will write the system in the form

$$
\left\{\begin{array}{l}
x-y=a(1+x y) \\
x+y=-x y-2
\end{array}\right.
$$

If we square both equations and subtract the first squared equation from the second squared equation, we get

$$
(x+y)^{2}-(x-y)^{2}=(2+x y)^{2}-a^{2}(1+x y)^{2}
$$

which can be written in the form $\left(1-a^{2}\right)(x y)^{2}-2 a^{2}(x y)+4-a^{2}=0$. If we make the substitution $x y=t$, we get the quadratic equation

$$
\left(1-a^{2}\right) t^{2}-2 a^{2} t+4-a^{2}=0
$$

The system has a unique solution if and only if the quadratic equation (1) has a unique solution. The quadratic equation (1) has a unique solution if and only if
a) $1-a^{2}=0$, i.e., $a=1$ or $a=-1$.

b) $D=a^{4}-\left(1-a^{2}\right)\left(4-a^{2}\right)=0$, i.e., $5 a^{2}=4$

Thus, the system has a unique solution if and only if

$$
a=-1, a=1, a= \pm \frac{2}{\sqrt{5}}
$$