# Sum of n squares $(x_1^2+x_2^2 + \dots + x_n^2)^2 (y_1^2+y_2^2 + \dots + y_n^2) = z_1^2+z_2^2 + \dots + z_n^2$

Consider this 5-Square Identity,

$(x_1^2+x_2^2+x_3^2+x_4^2+x_5^2)^2 (y_1^2+y_2^2+y_3^2+y_4^2+y_5^2) = z_1^2+z_2^2+z_3^2+z_4^2+z_5^2$

where,

\begin{align} z_1 &= (-x_1^2+x_2^2+x_3^2+x_4^2+x_5^2)y_1 - 2x_1(0x_1 y_1+x_2 y_2+x_3 y_3+x_4 y_4 + x_5 y_5)\\ z_2 &= (x_1^2-x_2^2+x_3^2+x_4^2+x_5^2)y_2 - 2x_2(x_1 y_1+0x_2 y_2+x_3 y_3+x_4 y_4 + x_5 y_5)\\ z_3 &= (x_1^2+x_2^2-x_3^2+x_4^2+x_5^2)y_3 - 2x_3(x_1 y_1+x_2 y_2+0x_3 y_3+x_4 y_4 + x_5 y_5)\\ z_4 &= (x_1^2+x_2^2+x_3^2-x_4^2+x_5^2)y_4 - 2x_4(x_1 y_1+x_2 y_2+x_3 y_3+0x_4 y_4 + x_5 y_5)\\ z_5 &= (x_1^2+x_2^2+x_3^2+x_4^2-x_5^2)y_5 - 2x_5(x_1 y_1+x_2 y_2+x_3 y_3+x_4 y_4 + 0x_5 y_5) \end{align}

The pattern is easily seen for,

$(x_1^2+x_2^2 + \dots + x_n^2)^2 (y_1^2+y_2^2 + \dots + y_n^2) = z_1^2+z_2^2 + \dots + z_n^2$

The case n = 4 is used in Pfister’s 8-square Identity. How to prove the pattern indeed holds true for ALL positive integer n?

• Is there a square wrong on $x_1^2+\dots+x_5^2$ in the title and the first equation? Jan 30, 2012 at 19:44
• Look at first term. Get $(\sum x_i^2)-2x_1^2$. Also, have in second summand of first term, $-2x_1((\sum x_iy_i)-x_1y_1)$. But still unpleasant! Jan 30, 2012 at 19:49
• @emiliocba: No, I've checked it with Mathematica and the 5-Square identity holds true. Jan 30, 2012 at 20:02

We can write \begin{align*} z_k&=y_k\left(\sum_ix_i^2-2x_k^2\right)-2x_k\sum_{i\neq k}x_iy_i\\ &=y_k\sum_ix_i^2-2x_k\left(\sum_{i\neq k}x_iy_i+x_ky_k\right)\\ &=y_k\sum_ix_i^2-2x_k\sum_ix_iy_i \end{align*} so hopping we are working in a commutative ring $$z_k^2=y_k^2\left(\sum_ix_i^2\right)^2-4x_ky_k\left(\sum_ix_i^2\right)\left(\sum_ix_iy_i\right)+4x_k^2\left(\sum_ix_iy_i\right)^2$$ and finally \begin{align*} \sum_{k=1}^nz_k^2&=\sum_{k=1}^ny_k^2\left(\sum_ix_i^2\right)^2-4x_ky_k\left(\sum_ix_i^2\right)\left(\sum_ix_iy_i\right)+4x_k^2\left(\sum_ix_iy_i\right)^2\\ &=\left(\sum_ix_i^2\right)^2\sum_{k=1}^ny_k^2-4\left(\sum_kx_ky_k\right)\left(\sum_ix_i^2\right)\left(\sum_ix_iy_i\right)\\ &+4\left(\sum_kx_k^2\right)\left(\sum_ix_iy_i\right)^2\\ &=\left(\sum_ix_i^2\right)^2\sum_{k=1}^ny_k^2. \end{align*}
• strictly speaking, is it true that: $$\sum_{k=1}^{n}-4\left(\sum_{k} x_{k}y_{k}\right)\left(\sum_{i} x_{i}^2\right) \left(\sum_{i} x_iy_i\right)+4\left(\sum_{k}x_{k}^2\right)\left(\sum_{i} x_{i}y_{i}\right)^2=0$$??????? I am not saying you are incorrect, I am simply saying that it looks bizarre to me. Do you have any way of clarifying this? My issue lies in the fact that you are cancelling summations which have similar terms but different indexes.
• @user22144: in the equality you write, there should not be $\sum_{k=1}^n$. The last step of my computation is in fact a consequence of the fact that $\sum_{i=1}^nc_i=\sum_{j=1}^nc_j$. Jan 30, 2012 at 21:02