Which one of these is an abelian group? Consider the sets $$G_1=\{x+y\sqrt{3} | x,y \in \mathbb{Z}, x^2-3y^2=1\}$$ and
$$G_2=\{x+y\sqrt{3} | x,y \in \mathbb{Q}, x^2-3y^2=1\}.$$
Which one of $(G_1,\cdot)$ and $(G_2, \cdot)$ is an abelian group, where $\cdot$ denotes the multiplication of the real numbers?
I think that both of them are abelian groups, because to me it seems that they both satisfy the group axioms(they are commutative and associative due to the fact that the multiplication of reals satisfies these conditions etc). However, my book says that only $(G_2,\cdot)$ is a group without providing any explanation. I don't understand why $(G_1,\cdot)$ isn't a group.
 A: We have $$G_1=\{x+y\sqrt{3} | x,y \in \mathbb{Z}, x^2-3y^2=1\}$$ 
Lets have a look at all group properties one by one. 
Associativity and identity element are trivial to verify.
Inverse let $x+y\sqrt{3}\in G_1$. We want to find $a+b\sqrt{3} \ \in G_1$ such that the product equals 1. Then $(x+y\sqrt{3})\cdot (a+b\sqrt{3}) = 1$ implies
$$\left\{ \begin{align*}
ax+3by&=1\\
ay+bx&=0
\end{align*}\right.$$
Note that we cannot have an element with $x=0$ in $G_1$ (this would imply $y=-1/3$ but by condition $y\in\mathbb{Z}$), therefore 
$$\left\{ \begin{align*}
&b=-\frac{ay}{x}\\
&a\left(x-3\frac{y^2}{x}\right)=1
\end{align*}\right.$$
Using the fact that $x^2-3y^2=1$ the second line yields $a=x$ and therefore $b=-y$, and indeed $(x-y\sqrt{3})(x+y\sqrt{3})=1$ using the condition in $G_1$. The inverse property is verified
Closure This is again simple computation. Lets $a+b\sqrt{3}$ and $x+y\sqrt{3}$ be two elements of $G_1$, and lets looks at their products. Obviously the product can be written as $c+d\sqrt{3}$ with $c,d\in\mathbb{Z}$. Then we only need to check the condition. 
We have 
$$\left\{ \begin{align*}
c&=ax+3by\\
d&=ay+bx 
\end{align*}\right.$$
Computing $c^2-3d^2$, using both facts that $a^2=1+3b^2$ and $x^2=1+3y^2$, we do ends up with $c^2-3d^2=1$ (I'll let you do the math, it's pretty straightforward). The closure property is verified
As far as i can tell $(G_1,\cdot)$ is a group.
