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.

[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).$$
