Is there a general formula to solve $a^2+b^2+c^2=d^2+e^2+f^2$?

112 Views Asked by At

Is there a general formula to solve the Diophantine equation $$a^2+b^2+c^2=d^2+e^2+f^2?$$ If so, can I please have the reference? Thanks.

2

There are 2 best solutions below

0
On

Rearrange as $$e^2+f^2-b^2-c^2=a^2-d^3=(a+d)(a-d).$$ We can pick $e,f,b,c$ arbitrarily, compute $n=e^2+f^2-b^2-c^2$.

  • If $n$ is odd, any factorization $n=uv$ leads to a valid solution $a=\frac{u+v}{2}$, $d=\frac{u-v}2$.
  • If $n\equiv 2\pmod 4$, any factorization of $n$ has one even and one odd factor, whereas $a+d\equiv a-d\pmod 2$ is necessary, so these caes lead to no solution.
  • If $n$ is a multiple of $4$, then any factorization $\frac n4=uv$ leads to a valid solution $a=u+v$, $d=u-v$.

Note that $n\equiv 2\pmod 4$ occurs if only if $e,f$ are odd and $b,c$ even or vice versa.

2
On

An easy way to solve,

$$x_1^2+x_2^2+\dots+x_n^2 = y_1^2+y_2^2+\dots+y_n^2$$

is to do the substitution,

$$(a_1+b_1)^2+(a_2+b_2)^2+\dots+(a_n+b_n)^2 = (a_1-b_1)^2+(a_2-b_2)^2+\dots+(a_n-b_n)^2$$

The $2$nd powers will cancel out, and you will only have a linear equation in the $a_i,b_i$.