Seeking sum of two squares reference I need a reference to the fact that if a number can be the sum of two squares in four different ways, e.g.,
\begin{equation*}
\begin{split}
w = u_1^2 + v_1^2\\
w = u_2^2 + v_2^2\\
w = u_3^2 + v_3^2\\
w = u_4^2 + v_4^2\\
\end{split}
\end{equation*}
the variables can always be parameterized as follows:
$w = (r^2 + R^2)(s^2 + S^2)(t^2 + T^2)$, 
$u_1 = ( rst + rST + RsT - RSt)$,
$v_1 = (-rsT + rSt + Rst + RST)$,
$u_2 = $, etc etc
Could anyone please supply a reference?  Many thanks.
 A: The question, as clarified by the OP in a comment, can be formulated as follows. Suppose that $w\in\mathbb{Z}$ factors in $\mathbb{Z}[i]$ in four ways as
$$ w=(u_k+iv_k)(u_k-iv_k),\qquad u_k,v_k\in\mathbb{Z},\qquad k=1,2,3,4. $$
Then is it true that we can further factor these factors $u_k\pm iv_k$ as:
$$ u_1+iv_1=(r+iR)(s+iS)(t-iT),\quad u_1-iv_1=(r-iR)(s-iS)(t+iT), $$
$$ u_2+iv_2=(r+iR)(s-iS)(t+iT),\quad u_2-iv_2=(r-iR)(s+iS)(t-iT), $$
$$ u_3+iv_3=(r-iR)(s+iS)(t+iT),\quad u_3-iv_3=(r+iR)(s-iS)(t-iT), $$
$$ u_4+iv_4=-(r-iR)(s-iS)(t-iT),\quad u_4-iv_4=-(r+iR)(s+iS)(t+iT) ?$$
The answer is no. This is because the above equations imply that
$$ \prod_{k=1}^4 (u_k+iv_k) = -(r^2+R^2)^2(s^2+S^2)^2(t^2+T^2)^2 = - w^2,$$
while it is possible to find factorizations where this product is very different. For example, in the special case when $u_3+iv_3=u_1-iv_1$ and $u_4+iv_4=u_2-iv_2$, the considered product equals $w^2$.
Just for the fun of it, if we have two factorizations
$$ w=(u_k+iv_k)(u_k-iv_k),\qquad u_k,v_k\in\mathbb{Z},\qquad k=1,2, $$
then it is true that we can further factor these factors $u_k\pm iv_k$ as:
$$ u_1+iv_1=(r+iR)(s+iS),\qquad u_1-iv_1=(r-iR)(s-iS), $$
$$ u_2+iv_2=(r+iR)(s-iS),\qquad u_2-iv_2=(r-iR)(s+iS). $$
This can be proved in many ways, e.g. by Theorem 90 applied in $\mathbb{Q}(i)$.
