# integer solutions to $x^2+y^2+z^2+t^2 = w^2$

Is there a way to find all integer primitive solutions to the equation $x^2+y^2+z^2+t^2 = w^2$? i.e., is there a parametrization which covers all the possible solutions?

#### Solutions Collecting From Web of "integer solutions to $x^2+y^2+z^2+t^2 = w^2$"

All natural numbers are the sum of four squares. See Lagrange’s four-square theorem. So all perfect squares meet the property in question; i.e., $w\in\mathbb Z$.

Bradley’s excellent paper on equal sums of squares gives the complete parameterization of the equation
$$x_1^2 + x_2^2 + x_3^2 + x_4^2 = y_1^2$$
as
\begin{align}
x_1 &= (uz+vy+wz)^2 -m^2(m^2+x^2+y^2+z^2-u^2-v^2-w^2) \\
x_2 &= 2m(um^2+uz^2+xvm-ywm+xwz+yvz) \\
x_3 &= 2m(vm^2+vy^2+zwm-xum+zuy+xwy) \\
x_4 &= 2m(wm^2+wx^2+yum-zvm+yvx+zux) \\
y_1 &= (uz+vy+wz)^2 +m^2(m^2+x^2+y^2+z^2+u^2+v^2+w^2),
\end{align}
with the option of multiplying all terms by a common factor $l$. Note that each term is a homogeneous quartic expression in the seven [integer] parameters.

For the equation:

$X^2+Y^2+Z^2+Q^2=R^2$

We can write the solution:

$X=2p^2+2(a+b+t)ps+(ab+at+bt)s^2$

$Y=2p^2+2(b+t-a)ps+(bt-a^2)s^2$

$Z=2p^2+2(a+t-b)ps+(at-b^2)s^2$

$Q=2p^2+2(a+b-t)ps+(ab-t^2)s^2$

$R=4p^2+2(a+b+t)ps+(a^2+b^2+t^2)s^2$

And more:

$X=-2p^2+2(a+b+t)ps+(4a^2+4b^2+4t^2-ab-at-bt)s^2$

$Y=-2p^2+2(b+t-5a)ps+(a^2-4a(b+t)+4b^2+4t^2-bt)s^2$

$Z=-2p^2+2(t+a-5b)ps+(b^2-4b(a+t)+4a^2+4t^2-at)s^2$

$Q=-2p^2+2(a+b-5t)ps+(t^2-4t(a+b)+4a^2+4b^2-ab)s^2$

$R=4p^2+2(a+b+t)ps+(7a^2+7b^2+7t^2-4ab-4at-4bt)s^2$

$a,b,t,p,s$ – integers asked us.