TITLE: On the cubic generalization $(a^3+b^3+c^3+d^3)(e^3+f^3+g^3+h^3 ) = v_1^3+v_2^3+v_3^3+v_4^3$ for the Euler four-square
QUESTION [10 upvotes]: We are familiar with the Euler Four-Square identity,

$$(a^2+b^2+c^2+d^2)(e^2+f^2+g^2+h^2 ) = u_1^2+u_2^2+u_3^2+u_4^2$$

where,
$$u_1 = ae-bf-cg-dh\\
u_2 = af+be+ch-dg\\
u_3 = ag-bh+ce+df\\
u_4 = ah+bg-cf+de$$
or the product of two sums of four squares is itself a sum of four squares.

Tinkering about, I came across a cubic version,

$$(a^3+b^3+c^3+d^3)(e^3+f^3+g^3+h^3 ) = 6^{-3} (w_1^3+w_2^3+w_3^3+w_4^3)$$

where,
$$w_1= 9 + a^3 + b^3 + c^3 + d^3 + e^3 + f^3 + g^3 + h^3\\
w_2= -9 - a^3 - b^3 - c^3 - d^3 + e^3 + f^3 + g^3 + h^3\\
w_3= 9 - a^3 - b^3 - c^3 - d^3 - e^3 - f^3 - g^3 - h^3\\
w_4= -9 + a^3 + b^3 + c^3 + d^3 - e^3 - f^3 - g^3 - h^3$$
Q: Does the cubic version have any number theoretic implications, like the set of sums of four cubes is closed under multiplication? Or is it just an interesting curiosity?

REPLY [6 votes]: Summarizing some comments and adding a bit on top:
The identity is a special case of
$$24ABC = (\underbrace{A+B+C}_{w_1})^3 + (\underbrace{-A+B-C}_{w_2})^3
        + (\underbrace{-A-B+C}_{w_3})^3 + (\underbrace{A-B-C}_{w_4})^3
\tag{1}$$
where setting $C=9$ turns the left-hand side into $6^3AB$.
The settings
$$\begin{align}
    A &= a^3 + b^3 + c^3 + d^3
\\  B &= e^3 + f^3 + g^3 + h^3
\end{align}$$
are not necessary for $(1)$ but lead to an interesting specialization.
To make the right-hand side of $(1)$ a symbolic integer multiple of $6^3$,
we might want to require that each $w_i$ is divisible by $6$.
Straightforward calculations show that this happens if and only if both $A$
and $B$ are divisible by $3$ and $A+B$ is odd.
In other words,
$$\{A,B\}=\{6m,6n+3\}\quad\text{for some}\quad m,n\in\mathbb{Z}$$
Conversely, for every choice of $m,n\in\mathbb{Z}$ there exist
representations of $A$ and $B$ as sums of four cubes, such as
$$\begin{align}
     6m &= (m+1)^3 + (m-1)^3 + (-m)^3 + (-m)^3                   \tag{2}
\\   6n+3 &= n^3 + (-n + 4)^3 + (2n - 5)^3 + (-2n + 4)^3         \tag{3}
\end{align}$$
taken from the Alpertron
hyperlinked in Dietrich Burde's comment.
Specializing your identity to that scenario gives
$$18\,m\,(2n+1) =
(2 + m + n)^3 + (-1 - m + n)^3 + (1 - m - n)^3 + (-2 + m - n)^3 \tag{4}$$
which may give much smaller solutions for representations of $18q$ than $(2)$,
particularly if $q$ has an odd divisor near $\sqrt{2|q|}$ which we can use for
$2n+1$.
Examples:
$$\begin{array}{r|rr|rrr}
    18q & (2)\quad\text{with}               & m
        & (4)\quad\text{with}               & m,    & n
\\\hline
    18  & 4^3 + 2^3 + (-3)^3 + (-3)^3       & 3
        & 3^3 + (-2)^3 + 0^3 + (-1)^3       & 1     & 0
\\  504 & 85^3 + 83^3 + (-84)^3 + (-84)^3   & 84
        & 9^3 + (-2)^3 + (-6)^3 + (-1)^3    & 4     & 3
\end{array}$$
The following points may be worth mentioning:

Replacing $2$ with $0$ in the right-hand side of $(4)$ turns the left-hand
side into $6\,m\,(2n-1)$ which is more widely applicable.
Replacing $2$ with $1$ in the right-hand side of $(4)$ turns the left-hand
side into $24mn$, an easy specialization of $(1)$.
$(1)$ itself, where applicable, might give solutions
with even smaller absolute maximum of the numbers involved, particularly if
$A,B,C$ can be chosen to be pairwise close.