Show that for a non square positive integer $d$, there exists a rational number $x/y$ such that $\vert \sqrt{d} - x/y\vert < 1/2y^2$ I have been given that $d > 0$ is an integer, which is not a complete square. How do I prove that there exists a rational number $\frac{x}{y}$ such that $$\left\vert \sqrt{d} - \frac{x}{y}\right\vert < \frac{1}{2y^2}$$
The questions says to use Dirichlet's Unit Theorem as a hint. 
I've been wracking my brains, but have no idea on how to start. Any hints that you guys can give me on how to apply Dirichlet's Unit Theorem to this problem? 
 A: It actually holds for all real numbers, not only for those of the form $\sqrt{d}$. In fact Hurwitz had shown that there are infinitely many rationals satisfy the inequality even when one replaces the constant $2$ by $\sqrt{5}$ on the right side, so the statement in your question is comparatively much weaker. 
A standard proof of the proposition(and also the Hurwitz's theorem) makes use of the theory of continued fractions, but since you are asking for a proof using Dirichlet's unit theorem, I'd like to say a few more words. As @Gerry Myerson pointed out, the unit theorem gives rise to infinitely many integral solutions to the Pell's equation  $x^2-dy^2=\pm1$. Then since
$$\frac{1}{y^2}=\left|\frac{x^2}{y^2}-d\right|=\left|\frac{x}{y}-\sqrt{d}\right|\cdot\left|\frac{x}{y}+\sqrt{d}\right|$$ 
the task is reduced to finding a unit $x+y\sqrt{d}\in\Bbb{Z}[\sqrt{d}]$ such that $x/y+\sqrt{d}>2$. It turns out that there are infinitely many such units for each $d$, as when $x,y$ being taken large enough, the rational $x/y$ is getting closer and closer to $\sqrt{d}$. 
A: Adding to Phil. Z's excellent answer, I'd like to mention that the solution is quite straightforward with a bit of knowledge of continued fractions.
Indeed, suppose that $\sqrt{d}$ has continued fraction expansion $[a_0; a_1,a_2,\dotsc]$ and let $x_n / y_n = [a_0; a_1, \dotsc, a_n]$ be a convergent of $\sqrt{d}$. It is a standard result in the theory of continued fractions that
$$
\frac{1}{y_n (y_{n+1} + y_n)}
< \left\lvert \sqrt{d} - \frac{x_n}{y_n} \right\rvert
< \frac{1}{y_n y_{n+1}}.
$$
From the recursive formula $y_{n+1} = a_{n+1} y_n + y_{n-1}$ and the fact that $y_n \geq 1$ for every $n \geq 0$, it follows that we're done if we can find at least one $n$ for which $a_n \geq 2$. But this is the case because:


*

*$\sqrt{d}$ is irrational since $d$ isn't a square, hence it's continued fraction expansion is infinite;

*the expansion $[1;1,1,\dotsc]$ corresponds to the golden ratio, which isn't of the form $\sqrt{d}$.

