Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Find all units in $\mathbb{Z}[\sqrt n] = \{a + b\sqrt n \mid a, b \in \mathbb Z \}$ and $n \in\mathbb N$, $n\ge 2$.

First let $c +d\sqrt n$ be a unit so $$(a +b\sqrt n)(c +d\sqrt n) = 1,$$ $$ac + bdn +(bc + ad)\sqrt n = 1.$$

What next?

share|cite|improve this question
next you need $ac + bdn = 1$ and $bc + ad = 0$. – MJD Mar 26 '12 at 19:29
@lhf I don't think this is a duplicate. This question is asking for finding all the units (which is a difficult task), not only to show that there are infinitely many. – user26857 Feb 14 '13 at 10:46

If $a+b\sqrt n$ is a unit, so is $a-b\sqrt n$; their inverses are conjugates. So $(a+b\sqrt n)(a-b\sqrt n)=a^2-nb^2$ is both an integer and a unit. Since $\frac{1}{m} \notin \mathbb{Z}[\sqrt n]$ for any $m$ in $\mathbb{Z}$ other than $\pm 1$, we are reduced to solving the equation $a^2-nb^2=\pm 1$. Since we can multiply the equation through by 1, changing the signs on $a$ and $b$, we are looking for the solutions to Pell's equation: $a^2-nb^2=1$.

Finding solutions to Pell's equation is a well-known (and fortunately solved) problem which is a bit too much for a math.SE answer post, so I'll leave you with a link to the wikipedia page:

share|cite|improve this answer

Since $a$, $b$, $c$, $d$, and $n$ are integers, the only way you can have $(ac + bdn) + (bc + ad)\sqrt n = 1$ is if $ac+bdn = 1$ and $bc+ad= 0$. This gives you two equations in $c$ and $d$. If you can solve for $c$ and $d$ in terms of $a$, $b$, and $n$, you will have an expression for the inverse of $a+b\sqrt n$. $a+b\sqrt n$ is a unit whenever this expression is well-defined and yields integers for $c$ and $d$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.