Parametrization of solutions of diophantine equation $x^2 + y^2 = z^2 + w^2$ I need integer solutions of $x^2 + y^2 = z^2 + w^2$ parametrized. Can it be done? Thanks.
 A: [Partial solution.]
Look for rational solutions to $$x_1^2+y_1^2-z_1^2=1\tag{1}$$ first.
We know that $p_0=(-1,0,0)$ is a solution. Let $(a,b,c)$ be any set of integers. Then solve $p_0+t(a,b,c)=(x_1,y_1,z_1)$. $(-1+at)^2+(bt)^2-(ct)^2 =1$, or $1-2at+a^2t^2+b^2t^2-c^2t^2=1$ or $2at = a^2t^2+b^2t^2-c^2t^2$.  Now, $t=0$ corresponds to $p_0$. Assuming $t\neq 0$, this means:
$$t=\frac{2a}{a^2+b^2-c^2}$$
This means that $$(x_1,y_1,z_1)=\left(\frac{a^2-b^2+c^2}{a^2+b^2-c^2},\frac{2ab}{a^2+b^2-c^2},\frac{2ac}{a^2+b^2-c^2}\right)$$
That gives a complete solution set to $(1)$.
That gives parametric solutions for the original equation:
$$(x,y,z,w)=(a^2-b^2+c^2,2ab,2ac,a^2+b^2-c^2)$$
Note that if $a^2+b^2+c^2$ is even, then all terms are even, so we can divide by $2$, so this doesn't give reduces solutions even when $\gcd(a,b,c)=1$.
Example, $(x,y,z,w)=(8,1,4,7)$. Then $(x_1,y_1,z_1)=\left(\frac{8}{7},\frac{1}{7},\frac{4}{7}\right)$. So $(-1,0,0)+\frac{1}{7}(15,1,4)$ so $(a,b,c)=(15,1,4)$. That yields $$(a^2-b^2+c^2,2ab,2ac,a^2+b^2-c^2)=(240,30,120,210)=30(8,1,4,7).$$
A: \begin{align*}
\left(\dfrac{\alpha^2-\beta^2+\gamma^2-\delta^2}{\alpha^2+\beta^2-\gamma^2-\delta^2}\right)^2+\left(\dfrac{2\left(\alpha\beta-\gamma\delta\right)}{\alpha^2+\beta^2-\gamma^2-\delta^2}\right)^2-\left(\dfrac{2\left(\alpha\gamma-\beta\delta\right)}{\alpha^2+\beta^2-\gamma^2-\delta^2}\right)^2=\large{1}
\end{align*}
...
@Thomas Andrews
A: First let us solve equation
$$
xy-zt=0.
$$
Let $(x,y,z,t)$ be any solution with $x\neq 0$, and let $u=\text{gcd}(x,z)>0$. Then $x=uv$ and $z=uw$ with $v,w$ coprime and $v\neq 0$. Then $xy-zt=0$ implies that $uvy=uwt$, or $vy=wt$. Because $v$ and $w$ are coprime, this implies that $t$ is divisible by $v$, so we can write $t=vr$ for some integer $r$. Then $vy=w(vr)$, hence  $y=wr$. In conclusion, any solution $(x,y,z,t)$ with $x\neq 0$ is representable in the form
$$
(x,y,z,t)=(uv,wr,uw,vr) \quad \text{for some integers} \,\, u,v,w,r. 
$$
If $x=0$, then either (a) $z=0$ and $y,t$ are arbitrary, or (b) $t=0$ and $y,z$ are arbitrary. However, these cases are also covered by the above family: take $u=0$, $r=1$ and $v,w$ arbitrary in case (a) and $v=0$, $w=1$, and $u,r$ arbitrary in case (b).
Now we are ready to solve the equation
$$
x^2+y^2=z^2+t^2.
$$
If $x$ and $y$ are both even, then $x^2+y^2$ is divisible by $4$, hence so is $z^2+t^2$, which is possible only if $z$ and $t$ are both even. Similarly, if $x$ and $y$ are both odd, then so are $z$ and $t$, and if $x$ and $y$ are of opposite parities, then so are $z$ and $t$. Hence, by permuting $z$ and $t$ if necessary, we may assume that $x$ and $z$ are of the same parity, and so are $y$ and $t$. Then rewrite the equation as
$$
\frac{x-z}{2}\cdot \frac{x+z}{2} = \frac{t-y}{2}\cdot \frac{t+y}{2}.
$$
Hence
$$
\left(\frac{x-z}{2},\frac{x+z}{2},\frac{t-y}{2},\frac{t+y}{2}\right)=(uv,wr,uw,vr) \quad \text{for some integers} \,\, u,v,w,r. 
$$
Thus, integer solutions to $x^2+y^2=z^2+t^2$ are
$$
(x,y,z,t)=\left(wr+uv,vr-uw,wr-uv,vr+uw\right), \quad u,v,w,r \in {\mathbb Z},
$$
as well as the solutions obtained from the above by swapping $z$ and $t$.
