<s>[INST] Prove a binary quadratic equation has specific number of solutions How do I show that the binary quadratic equation $f(x, y) = x^2 + xy + y^2 = 1$ has exactly $6$ solutions?
The discriminant is $-3$, so I cannot use Pell's Equation ($x^2 - dy^2 = p$, where $d>0$ is an integer and $p$ prime).
I know that $4 f(x,y) = (2x+y)^2+3y^2$ is equivalent to $f(x, y) = x^2 + xy + y^2$.  But I am unsure how this helps show there are exactly $6$ solutions.
Can anyone please help?
 [/INST] The integer solutions of $(2x+y)^2+3y^2=4$ are not hard to find. We must have $y^2=0$ or $y^2=1$.
If $y^2=0$, we need $(2x)^2=4$, giving $x=\pm 1, y=0$.
If $y^2=1$, there are two cases. If $y=1$, we want $(2x+1)^2=1$, that is, $x=0$ or $x=-1$. If $y=-1$, we want $(2x-1)^2=1$, giving $x=0$ or $x=1$.
Another way: Note that 
$$2(x^2+xy+y^2)=x^2+y^2+ (x+y)^2.$$ So we are solving the Diophantine equation $x^2+y^2+(x+y)^2=2$. This holds if precisely two of $x^2$, $y^2$, and $(x+y)^2$ is equal to $1$. Each of the three possibilities gives rise to two solutions.
</s>