[Math] Solving Pell’s equation $x^2-5y^2=\pm4$ using elementary methods.

number theorypell-type-equations

Solve Pell's equation $x^2-5y^2=\pm4$.

This equation arises when I tried to prove that the units of $\mathbb{Z}[\varphi]$, where $\varphi=\frac{1+\sqrt{5}}{2}$ is the golden ratio, are of the form $\pm\varphi^n$. I found that $x+\varphi y$ is a unit iff $x^2+xy-y^2=\pm1$, i.e. $(2x+y)^2-5y^2=\pm4$. Yet I am unable to solve this equation. I saw here a solution using algebraic number theory, but I am interested in how to solve this equation using elementary methods, without using results from algebraic number theory. Thanks in advance!

Best Answer

Let's take a solution $(x,y)$ of $x^2-5y^2=\pm4$. Assume $x>0$ and $y>0$. Clearly also $x$ and $y$ have the same parity. Define $$x'=\frac{5y-x}2,\qquad y'=\frac{x-y}2.$$ Then $x'$ and $y'$ are integers, and $$x'^2-5y'^2=\frac{(5y-x)^2-5(x-y)^2}4=\frac{20y^2-4x^2}4=\pm4.$$ Therefore $(x',y')$ is also a solution. I claim that $y'\ge0$ and $x'>0$.

If $y'<0$ then $x<y$ and $x^2-5y^2<-4x^2<-4$, which is false. So $y'\ge0$. If $x'\le0$ then $x\ge5y$ and $x^2-5y^2\ge20y^2>4$ which is false. So $y'\ge0$.

I claim that as long as $y\ge2$, then $y'<y$. Otherwise, $x\ge3y$ and $\pm 4=x^2-5y^2\ge4y^2$. This is only possible if $y=1$.

So, iterating the operation $(x,y)\mapsto(x',y')$ eventually reduces $(x,y)$ to a solution $(X,Y)$ with $X>0$ and $Y\in\{0,1\}$. Therefore to $(X,Y)=(2,0)$, $(1,1)$ or $(3,1)$. All of these reduce down to $(2,0)$.

Therefore we can start with $(x_0,y_0)=(2,0)$ and reversing the operation generate all positive solutions. The iterative process is $$(x_{n+1},y_{n+1})=\left(\frac{x+5y}2,\frac{x+y}2\right).$$

Related Question