Pell's equation and fundamental units I am looking at a problem from Neukirch's Algebraic Number theory:
Let $D$ be squarefree and $d$ be the discriminant of $K=\mathbb{Q}(\sqrt{D})$. Let $x_{1}$, $y_{1}$ be the integer solution of the equation $x^{2}-dy^{2}=4$ or $-4$, for which $x_{1}$, $y_{1}>0$ are as small as possible. Then $\dfrac{x_{1}+y_{1}\sqrt{d}}{2}$ is a fundamental unit of $K$.
I am confused how to distinguish fundamental unit from those "usual" units. Only thing I know is that every unit can be written uniquely as a product of fundamental units. 
$\dfrac{x_{1}+y_{1}\sqrt{d}}{2}$ is obviously a unit by checking its norm, but what should I do next?
Thank you in advance!
 A: Human mathematicians define the fundamental unit $\eta$ of $\mathcal{O}_{\mathbb{Q}(\sqrt{D})}$ to be the smallest unit greater than $1$. But it could just as easily be the greatest unit less than $-1$, and that is how certain electrical beings here on Earth and on Mars define it. Though as you can imagine, they are far more interested in rings with $D < 0$. Get it, imagine? Never mind.
The important thing is the minimality of $x_1$ and $y_1$. For example, is $7 + 5 \sqrt{2}$ the fundamental unit of $\mathbb{Z}[\sqrt{2}]$? It does have a norm of $-1$, and we see that $7^2 - 2 \times 5^2 = -1$.
But that's not the minimal solution to $x^2 - 2y^2 = -1$. That would be $1^2 - 2 \times 1^2$. Check that $1 + \sqrt{2} \approx 2.41$, while $1 - \sqrt{2} \approx -0.41$ and $7 + 5 \sqrt{2} \approx 14.071$. So indeed $\eta = 1 + \sqrt{2}$.
Furthermore, and far more importantly, $(7 + 5 \sqrt{2})^n$ with $n \in \mathbb{Z}$ skips over units of norm $1$, like $3 + 2 \sqrt{2}$, while $\eta^n, -\eta^n, \overline{\eta}^n, -\overline{\eta}^n$ does give you all the units in this ring, both of norm $1$ and norm $-1$.
A: If $K$ is a quadratic field then a fundamental unit of $\mathcal{O}_K$ is exactly what you've written; a unit such that every other unit can be written uniquely (modulo signs) as an integral power of that unit. 
Abstractly, this is the statement that $\mathcal{O}_K^\times \cong \Bbb Z/(2) \oplus \Bbb Z$ where the factor $\Bbb Z$ is generated by the fundamental unit, and the torsion factor $\Bbb Z/(2)$ gives the sign of a unit.
More abstractly, Dirichlet's Unit Theorem tells us that the group of units of an arbitrary number field $L$ has the structure
$$\mathcal{O}_L^\times \cong \mu(\mathcal{O}_L) \oplus \Bbb Z^{r + s - 1}$$
where $\mu(\mathcal{O}_L)$ is the torsion factor consisting of the roots of unity, and where $r$ is the number of real embeddings $L \to \Bbb R$, and $2s$ the number of conjugate pairs of complex embeddings $L \to \Bbb C$. The positive integer $r + s - 1$ is called the rank of $\mathcal{O}_L^\times$.
We refer to a fundamental unit when the rank of $\mathcal{O}_L^\times$ is $1$ (since then it only has one generator). Otherwise, the generators of the free part are called a system of fundamental units. 
