Integral solutions of hyperboloid $x^2+y^2-z^2=1$
Are there integral solutions to the equation $x^2+y^2-z^2=1$?
Solution 1:
The advanced approach is to rewrite this as $x^2+y^2= z^2+1$ and use unique factorization in $\mathbb Z[i]$. Assuming you disallow the obvious answers where $x$ or $y$ is $\pm 1$, you get that $x+yi=(a+bi)(c+di)$ and $z+i=(a+bi)(c-di)$ for some $a,b,c,d$. That yields a condition on $a,b,c,d$ and an explicit formulas form $x,y,z$ in terms of $a,b,c,d.$
Specifically, if $bc-da=1$ then $x=ac-bd, y=bc+ad, z=ac+bd$ is a solution to your equation. I think this gives all of them, but there is some concern about units.
This doesn't give us all ordered triples, since $y=bc+ad=bc-ad+2ad=1+2ad$, and hence this only gives us $y$ odd. However, it is clearly true that one of $x,y$ has to be odd, so this might sill give all un-ordered pairs $x,y$.
For example, $(a,b,c,d)=(7,2,4,1)$ then $x=26, y=15, z=30$ is the solution.
A more elementary solution is to assume $y=2n+1$ is odd (one of $x,y$ must be odd.) Then $x$ and $z$ have to have the same parity, and we get: $$4n(n+1)=y^2-1 = z^2-x^2=(z-x)(z+x)$$
Dividing by $4$: $$n(n+1)=\frac{z-x}{2}\frac{z+x}{2}$$
So we just need a factorization, $n(n+1)=UV$ with $U<V$. Then $z=V+U$ and $x=V-U$.
The most basic answer is $V=n(n+1)$ and $U=1$. Then $x=n(n+1)-1, y=2n+1, z=n(n+1)+1$.
The "obvious" answer, $U=n$, $V=n+1$ just gets you $x=1, y=2n+1, z=2n+1$.
Since $n(n+1)$ is even, we can write $U=2$, $V=\frac{n(n+1)}{2}=T_n$. Then $$x=T_n-2, y=2n+1, z=T_n+2$$
When $n>0$ we see that the number of distinct positive solutions $(x,2n+1,z)$ is $$\frac{\tau(n(n+1))}{2}=\frac{\tau(n)\tau(n+1)}2$$
If $UV=n(n+1)$ we can get $a,b,c,d$ from the first solution by defining: $$a=(V,n), b=(U,n+1), c=(V,n+1), d=(U,n)$$
then $$bc=n+1, ad=n, ac=V, bd=U$$
So $bc-ad=1$, $bc+ad=2n+1=y$, $V-U=ac-bd=x$ and $V+U=ac+bd=z$.
So any result from the second method is a result from the first method, which means the first method gets all positive solutions, too.
Solution 2:
Recall the Brahmagupta formula $$(ad-bc)^2 + (ac+bd)^2 = (a^2+b^2)(c^2+d^2) = (ac-bd)^2 + (ad+bc)^2$$ Now find $a,b,c,d$ such that say $ad-bc = 1$. Then set $z = ac+bd$, $x=ac-bd$ and $y = ad+bc$ to get a solution.
For instance, one such one parameter family solution following the above procedure is $$x = 2t, y = 2t^2-1, z = 2t^2$$ where $a = d = t, b = (t+1), c = (t-1)$ since $t^2 - (t^2-1) = 1$.