Solving the system $x^2+y^2+x+y=12$, $xy+x+y=-7$

I've been trying to solve this system for well over the past hour.$$x^2+y^2+x+y=12$$ $$xy+x+y=-7$$ I've tried declaring $x$ using $y$ ($x=\frac{-7-y}{y+1}$) and solving from there, but I've gotten to $$y^4+3y^3-9y^2-45y+30=0$$ and I don't see how we can get $y$ from here.

If anyone sees it, I'd appreciate the help. But if you see a simpler solution please do not hesitate to leave a comment and notify me of such.


Solution 1:

Let $S = x+y$ and $P=xy$. You have $S^2 - 2P +S = 12$ and $P+S=-7$. Therefore

$$S^2 - 2P +S = S^2-2(-7-S) + S=S^2+3S+14=12$$ or $$S^2+3S+2=0.$$ The roots of this last equation are $-1,-2$. Therefore $(S,P) \in \{(-1, -6) , (-2,-5)\}$. Which implies that $x,y$ are the roots of either $u^2 +u -6 = 0$ or of $u^2 +2u -5=0$. Which are quadratic equations that you can solve... You'll get

$$(x,y) \in \{(2,-3),(-3,2),(-1- \sqrt 6, -1 + \sqrt 6),(-1+ \sqrt 6, -1 - \sqrt 6)\}$$

Solution 2:

Alternatively, set $u=x+y$ and $v=x-y$. Then first equation plus twice of second equation gives $(x^2+y^2+2xy)+3(x+y)=-2 $ which is $$ u^2+3u+2=0$$

Also, first equation minus second gives $x^2+y^2-xy=19$ which can be rewritten as $$\frac{1}{4}(x+y)^2+\frac{3}{4}(x-y)^2=19 \Rightarrow u^2+3v^2=76$$

The first quadratic has easy roots, $u \in \{-1,-2\}$. From above two values of $v$ are obtained. Finally you have to solve for $x+y= \ldots$ and $x-y=\ldots$

The original equations are of a circle and a hyperbola, which on Geogebra can be seen to have four intersections (solutions). Hence both values of $u,v$ give valid solutions.