I want to solve this equation
$$1 + x + x^2 + y - x y + y^2 = 0$$
under the constraint that both $x$ and $y$ are real (not complex). (Note that the unique solution is $(x,y) = (-1, -1)$.)
I first tested whether Mathematica could find an instance:
Assuming[{x,y}\[Element]Reals,
FindInstance[(1+x+x^2+y-x y+y^2)==0, {x,y}]]
but it gave this unacceptable "instance" in which $x$ is not real:
$$\left\{\left\{x\to \frac{1}{2} \left(-1-i \sqrt{3}\right),y\to 0\right\}\right\}$$
Why do we get a "solution" where $x$ is complex when we specified that $x \in \mathbb{R}$?
I also tried
Assuming[{x,y} \[Element] Reals,
Solve[(1+x+x^2+y-x y+y^2)==0,y, Reals]]
without success.
I can "manually" see that the original equation is symmetric in the interchange $x \leftrightarrow y$, and thus force the solution to be symmetric (by x == y
) as:
Assuming[{x,y}\[Element]Reals,
FindInstance[(1+x+x^2+y-x y+y^2)==0 && x==y, {x,y}]]
This indeed gives the proper unique solution,
{{x -> -1, y -> -1}}
However this requires my (human) analysis.
Mathematica cannot even find $x$ such that the "solution" is real:
Solve[1/2 Im[x-Sqrt[3] Sqrt[-1-2 x-x^2]]==0,x]
{{}}
Is there any way to add constraints or other more general information that will enable Mathematica to find the unique solution to the original equation?