# Proving that the number of integer solutions of $x^2-Ny^2=1$ is infinite

I am trying to prove that the number of integer solutions of $x^2-Ny^2=1$ is infinite whenever N is a squarefree integer.

For this I define norm of $a+b\sqrt N=a^2-Nb^2$. Now I prove that $a+b \sqrt N$ forms a ring.Then I showed that a number is a unit iff its norm is one. So if there is one solution say $c+d\sqrt N$ which is a unit then I will raise it to higher powers and I will hopefully get infinite units.

$(a+b\sqrt N)^2=a^2+Nb^2+2ab\sqrt N$ Now if $N>2$ then the integer $a$ keeps increasing if the unit I start out with is not $+1$ or $-1$. But I am unable to show the existence of one such unit . If anyone has any ideas it would be great. Also I am interested in a proof which is essentially algebraic rather a number theoretic proof.Thanks

Lemma 1. If $N$ is a square-free positive integer, the continued fraction of $\alpha=\sqrt{N}$ has the following structure: $\alpha=[M,\overline{s,2M}]$ where $s$ is a palyndromic string of positive integer.
This Lemma is essentially equivalent to the fact that the class number of $\mathbb{Q}(\sqrt{D})$ is finite.
By exploiting the structure of continued fractions one may prove that $\frac{p}{q}=[M,s]$ is such that $p^2-Nq^2=1$. As an alternative, one may use the approach shown by Booher at page 8 here. There are an infinite number of convergents since $\sqrt{N}$ is irrational, and only a finite number of choices for $p^2- Nq^2$, so there must be an $r$ with an infinite number of convergents satisfying $p^2 − Nq^2= r$. There are only a finite number of choices for $(p, q)$ to reduce to modulo $r$, and an infinite number of convergents satisfying the equation, so there are two distinct convergents $(p_0 , q_0 )$ and $(p_1 , q_1 )$ with $p_0\equiv p_1\pmod{r}$ and $q_0\equiv q_1\pmod{r}$ and $p_0^2-Nq_0^2 =p_1^2-Nq_1^2 = r$. Thus we may consider the ratio $$u=\frac{p_0+q_0\sqrt{N}}{p_1+q_1\sqrt{N}}=\frac{p_0p_1-Nq_0q_1+\sqrt{N}(p_1 q_0-p_0 q_1)}{r}$$ and notice that $p_0 p_1 − N q_0 q_1 \equiv p_0^2-Nq_0^2 \equiv 0\pmod{r}$ and $p_1 q_0 − q_1 p_0 \equiv 0 \pmod{r}$, hence $u$ is of the form $p+qN$ with $p,q\in\mathbb{Z}$. Since the norm on $\mathbb{Q}(\sqrt{d})$ is multiplicative (aka Brahmagupta's identity), $u$ has norm 1. Therefore Pell’s equation has a non-trivial solution and $\mathbb{Z}[\sqrt{d}]$ has an infinite number of invertible elements.