# Transformations between Pell[-like] equations

I’m looking for [non-trivial] transformations that take a Pell-like equation $$u^2-dv^2=w$$ and turn it into another Pell-like equation $$x^2-my^2 = z.$$ Best-case scenario, one could always use the same transformation for a given [target] $m$; but any interesting transformations would be helpful.

EXAMPLE: Let's say I have integers $u,v,w$ such that $$u^2-6v^2=w.$$ I would like to find functions $f(u,v,w)$, $g(u,v,w)$, and $h(u,v,w)$ such that $x=f(u,v,w)$, $y=g(u,v,w)$, and $z=h(u,v,w)$, and $$x^2 - 2y^2 = z.$$

I know about the $d \to d$ transformations (e.g., turning the Pell-like $u^2-dv^2= \pm 2$ into the Pell $x^2-dy^2=1$). Now I'm looking for something more substantial — a real method of intra-Pellian transformation.

• can I pick constant functions ? – mercio Aug 8 '16 at 14:24
• @mercio: If it's a serious question, then 'yes'. (To be honest, I don't really understand what you're asking, in the context of the OP.) – Kieren MacMillan Aug 8 '16 at 16:26
• @Kieren MacMillan : could you point me to the $d \to d$ transformations you mentioned above? – arthur Aug 9 '16 at 21:54
• @Kieren MacMillan : this is trivial: $$u^2-dv^2=w \rightarrow u^2-(d-c)v^2=w + cv^2$$ but it changes $d$ and if you can reduce the rhs to $1$ by the $d \to d$ transform then can you solve $$u^2-(d-c)v^2=1$$ – arthur Aug 9 '16 at 22:18
• @arthur: e.g. <en.wikipedia.org/wiki/Pell%27s_equation#Transformations> – Kieren MacMillan Aug 9 '16 at 23:53

## 2 Answers

Knowing that if you can find one solution to a Pell equation you can generate others.

If you could target $m$ then:

$x^2 -my^2 = z$

can be written as

$\displaystyle \frac{x^2}{y^2} - \frac{z}{y^2} = m$

$\displaystyle \left( \frac{x}{y} + \frac{\sqrt{z}}{y} \right) \left( \frac{x}{y} - \frac{\sqrt{z}}{y} \right) = m$

This could provide a method for factoring $m$ by looking for $y|x$ and $z$ is square etc.

If you could solve $u^2-dv^2=w$ then transform it into $x^2-my^2 = z$ this could provide a means to factor one number by factoring another.

If a transform that could target $m$ existed it would have significant consequences.

Copy of my comment to the answer:

Trivially:

$$u^2-dv^2=w \rightarrow u^2-(d-c)v^2=w + cv^2$$

but it changes $d$ and if you can reduce the rhs to $1$ by a $d \to d$ transform then you can solve:

$$u^2-(d-c)v^2=1$$

Admittedly there are very limited $d \to d$ transforms.

I haven't had time to fully test or sanity check this:

For the identical rhs case:

$$x^2 - my^2 = w$$ $$u^2 -dv^2 = w$$

Try $v = y$

$$u^2 -dy^2 = w$$

$$x^2 -u^2 - (m-d)y^2 = 0$$

$$x^2 - (m-d)y^2 = u^2$$

we know that $x^2-dy^2=z^2$ is solved by $x=m^2+dn^2, \quad y=2mn, \quad z=m^2-dn^2$.

i.e. $z$ solves the Pell like equation with the same $d$ value as $z^2$ does.

So we can write:

$$X^2 - (m-d)Y^2 = u$$

but $u$ is a variable not a constant.

So select an $X$ and a $Y$ and calculate $u$.

Then solve for $x$ and $y$ in the square rhs equation $x^2 - (m-d)y^2 = u^2$.

More sanity checks done:

$$u = X^2 - (m-d)Y^2 \, , \, v = 2XY$$ $$x = X^2 + (m-d)Y^2 \, , \, y = 2XY$$

There should be a $w$ in the equations?

The equations give a relationship between $(u,v)$ and $(x,y)$ but do not solve the equations for $w$.

• I agree it would have significant consequences — hence the bounty. ;) – Kieren MacMillan Aug 9 '16 at 3:46
• As you can imagine, I'm looking for something more like Legendre's method of turning any second-degree equation into a Pell-like equation (cf. math.stackexchange.com/questions/947000/…)… but your observation, albeit trivial, is not devoid of interesting possibilities. – Kieren MacMillan Aug 10 '16 at 15:27
• I presumed the solution to the equation $u^2-dv^2=w$ was known then transform it to $x^2-my^2 = z$ never mind. The Legendre tip has me on another track. – arthur Aug 11 '16 at 3:38
• Algebraic substitutions $(x,y) \to (u,v)$ then using Legendre won't alter $d$. – arthur Aug 11 '16 at 17:42
• No… For the special case $$x^2-my^2=u^2-dv^2,$$ I'm playing around with rearranging it and then applying Cauchy's solution of $$rX+sY+tZ=0.$$ But even if that results in something useful, it's a long way from a real transformational method applicable to non-equal Pell-like equations (as per the OP). – Kieren MacMillan Aug 11 '16 at 18:41

Transform from Pell like equation to a ternary quadratic form:

$$u^2 -dv^2 = k$$

From factorization $$d = c^2 - e^2$$

$$u^2 -(c^2 - e^2)v^2 = k$$

$$u^2 + e^2v^2 -c^2v^2 = k$$

write as

$$x^2 + y^2 - z^2 = k$$

where $x = u$ , $y = ev$ and $z =cv$.

$$x^2+y^2-z^2=k$$

$$y=y$$

$$x=\frac{y^2-k}{2t}-\frac{t}{2}$$

$$z=\frac{y^2-k}{2t}+\frac{t}{2}$$