Diophantine equation ${x ^ 2}+{y ^ 2}+{z ^ 2}={m ^ 2}+{n ^ 2} $ has infinite solutions. What is its general solution formula?

300 Views Asked by At

Diophantine equation ${x ^ 2}+{y ^ 2}+{z ^ 2}={m ^ 2}+{n ^ 2} $ has infinite solutions. For examples, $\begin{array}{l} {1^2}+ {3^2} + {4^2} = {1^2} + {5^2}\\ {1^2} + {2^2} + {6^2} = {4^2} + {5^2}\\ {322^2} + {562^2} + {597^2} = {601^2} + {644^2}\\ {938^2} + {1063^2} + {4722^2} = {536^2} + {4901^2}\\ \vdots \end{array}$

What is its general solution formula? How to get the general solution formula?

4

There are 4 best solutions below

5
On BEST ANSWER

When $z\neq 0,$ that means we want all rational solutions to:

$$m^2+n^2-x^2-y^2=1\tag 1$$

We pick one solution, $\mathbf s_0=(m_0,n_0,x_0,y_0)=(-1,0,0,0)$ and any directional vector $\mathbf p=(p_1,p_2,p_3,p_4)$ with the $p_i$ integers with $\gcd(p_1,p_2,p_3,p_4)=1.$

Then $\mathbf s_0+t\mathbf p$ yields a solution for $t=0$ trivially, and we get another value $t$ where you get another solution.

Specifically, you want $$(-1+p_1t)^2+(p_2t)^2-(p_3t)^2-(p_4t)^2=1$$ which, when simplified and factoring out $t,$ gives you:

$$-2p_1+(p_1^2+p_2^2-p_3^2-p_4^2)t=0\\ t=\frac{2p_1}{p_1^2+p_2^2-p_3^2-p_4^2}$$ where now we assume $p_1^2+p_2^2\neq p_3^2+p_4^2.$

Then our integer solution formula is $$\begin{align}m&=p_1^2-p_2^2+p_3^2+p_4^2\\ n&=2p_1p_2\\ x&=2p_1p_3\\ y&=2p_1p_4\\ z&=p_1^2+p_2^2-p_3^2-p_4^2. \end{align}$$

This won't give primitive solutions, in that we won't always have $\gcd(m,n,x,y,z)=1,$ but we'll get one from every equivalence class of solutions with $z\neq 0.$

This will also give solutions with $z=0,$ but we don't know yet if it will give all (equivalence classes) of solutions for $z=0.$ But we can show if $z=0,$ the above solution is a scalar multiple of $(m,n,x,y,z)=(p_1,p_2,p_3,p_4,0),$ which gives all solutions.

The fact that three of the numbers are even makes it clear that we can't get all the primitive solutions with $z\neq 0.$ For example, we can get values $m$ odd, so we should be able to get $n$ odd.


For example, $(p_i)=(2,1,1,1)$ gives a solution $(m,n,x,y,z)=(5,4,4,4,3).$

This means we need a solution with $(m,n)$ switched, and possibly scaled .

The corresponding rational solution to $(1)$ is $(m,n,x,y)=(\frac43,\frac53,\frac43,\frac43)$ which is in the direction $p=(7,5,4,4)$ from $s_0.$

That gives $m=56, n=70, x=56,y=56, z=42.$ And that is $14$ times our goal $(m,n,x,y,z)=(4,5,4,4,3).$


This technique works for all homogenous quadratic Diophantine equations: once you find one non-zero solution, you can find an infinite class. But the formula won't general all solutions - it will only generate all solutions of the corresponding rational equation, which means it will generate all solutions modulo scalar multiplication, and with one fixed variable chosen to be non-zero.

In general, we would first assume $z\neq 0,$ apply the above technique, then assume $z=0$ and solve the resulting smaller Diophantine equation using the same technique. But often, the resulting formula for $z\neq 0$ would give (up to equivalence) all solutions for $z=0.$

Sometimes, we get an obvious variable to assume non-zero. $x^2+xy+y^2=z^2$ has only the trivial solution when $z=0,$ so we can assume $z\neq 0$ for all others.

1
On

A very simple equation. You can write various combinations.

https://artofproblemsolving.com/community/c3046h1055645_quadratic_diophantine_equation

For the equation:

$$X_1^2+X_2^2=Y_1^2+Y_2^2+Y_3^2$$

Solutions have the form:

$$X_1=t^2+2(p+s-k)t+2k^2+2p^2+4ps-4pk-2sk$$

$$X_2=t^2+2(p+s-k)t+2k^2+2s^2+4ps-2pk-4sk$$

$$Y_1=t^2+2(p+s-k)t+2k^2+2ps-2pk-2sk$$

$$Y_2=t^2+2(p+s-k)t+2ps$$

$$Y_3=2(p+s-k)(t+p+s-k)$$

2
On

Here's a practical method of getting solutions to the equation $m^2 +n^2= x^2 + y^2 + z^2$. No claim is made here that it is a general solution or that it works all the time. That has yet to be proven (and I don't think I can do that). We start with decomposing a square, odd or even doesn't matter as the method seems to work for both. I will just provide few examples to show the procedure.

Exemple 1: $81=9^2=(4+5)^2=4^2 + 2*4*5 + 5^2= 4^2 + 40 + 5^2$. It's clear that if we add $3^2$ to both sides we will end up with a solution:
$9^2 + 3^2 = 4^2 + 5^2 + 7^2$.

Example 2: $121 = 11^2 = (5+6)^2 =5^2 + 2*5*6 + 6^2= 5^2 + 60 + 6^2$. It's clear that if we add 4 to both sides, we will end up with a solution:
$11^2 +2^2 = 5^2 + 6^2 +8^2$

Example 3: $196=14^2 = (6+8)^2 = 6^2 +2*6*8 + 8^2= 6^2 + 96 + 8^2$.
Here too it's clear that if we add $2^2$ to both sides we get a solution.
$14^2 +2^2 = 6^2 + 8^2 + 10^2$.

Example 4: $324 = 18^2 = (8 + 10)^2 = 8^2 +2*8*10 + 10^2= 8^2 + 160 + 10^2$.
Adding $3^2$ to both sides we get:
$18^2 +3^2 = 8^2 +10^2 + 13^2$.

I hope that this method can be shown to work in general. There are in fact more ways to test the method since an odd square $n^2$ can be written as:
$n^2= (1 +(n-1))^2 = (2 +(n-2))^2=...= [(n-1)/2 + (n+1)/2]^2$. The same can be done with even squares by using even numbers like:
$14^2 = (6+8)^2 = (4+10)^2 = (2 + 12)^2$.

Edit #1 There can be more than one solution starting with a given square. Let's look at $18^2$ again.
$18^2 = (6+12)^2 = 6^2 + 2*6*12 + 12^2$. In this case $2*6*12=144=12^2$. So we need to add a square to $12^2$ to get a different square. $5^2$ added to both sides is the solution.
$18^2 + 5^2 = 6^2 +12^2 + 13^2$.

$18^2 = (4+14)^2 = 4^2 + 2*4*14 + 14^2 = 4^2 + 112 + 14^2$ so adding $3^2$ gives:
$18^2 + 3^2 = 4^2 +(112 + 9) + 14^2 = 4^2 + 11^2 + 14^2$.
Note that we have two expressions for $18^2 + 3^2$.
$18^2 + 3^2 = 8^2 + 10^2 + 13^2 = 4^2 + 11^2 + 14^2$.

$18^2 = (2+16)^2 = 2^2 + 2*2*16 +16^2 = 2^2 + 8^2 + 16^2$. In this case we found two squares $6^2$ and $15^2$ which when added (one at a time) to both sides will give: $18^2 + 6^2 = 2^2 + 10^2 + 16^2$ and
$18^2 + 15^2 = 2^2 + 16^2 + 17^2$

It appears that getting $n^2 = a^2 + b^2 + c^2$ can still be transformed into $n^2 + d^2 = a^2 + c^2 + f^2$.

Edit#2. In the previous method, it was shown how to solve the equation when starting from a square and its decompositions. Here a method is provided that solves the equation when the starting point is $2ab$ in a square of the form $n^2=(a+b)^2=a^2 + 2ab + b^2$ as long as $2ab=8T_{k}$ with $T_{k}$ the $kth$ triangular number. It is well known that $8T_{k} + 1 = m^2$ so in this case we only need to add $1^2$ to both sides to solve the equation.
The following example will show the procedure. Let's take $T_{k}=15$ so $8T_{k}=8*15=120=11^2-1$. Now we consider the different ways of writing $8*15$.
$8*15=2*4*15=2*2*30=2*6*10=2*3*20$. In this case we get the following values for $(a,b)=(4,15)=(2,30)=(6,10)=(3,20)$. Now we can setup the equation for every case. Only one example with be shown since the procedure is the same.

$n^2=19^2=(4+15)^2= 4^2 + 2*4*15 + 15^2 = 4^2 + 120 + 15^2$. It's clear to see that adding $1^2$ to both sides to get the solution.
$19^2 + 1^2 = 4^2 + 11^2 + 15^2$.

Once a square is identified, its decomposition into different sum of squares can be generated. This method provides a solution for an infinite number of equations involving triangular numbers through $8T_{k} + 1 = m^2$.

3
On

It is clear that there are infinitely many solutions (see my comment above). We know that the identity $$(a^2+b^2+c^2+d^2)^2=(a^2-b^2-c^2-d^2)^2+(2ab)^2+(2ac)^2+(2ad)^2$$ gives all the solutions of $x^2+y^2+z^2+w^2=u^2$.

Now we have $$x^2+y^2+z^2=m^2+n^2\iff x^2+y^2+z^2+(im)^2=n^2$$ because the identity is valid in the ring of the Gaussian integers, so for the parameters $a,b,c,id$ we get $$(a^2+b^2+c^2-d^2)^2=(a^2-b^2-c^2+d^2)^2+(2ab)^2+(2ac)^2-(2ad)^2$$ so we have $$\boxed{(a^2+b^2+c^2-d^2)^2+(2ad)^2=(a^2-b^2-c^2+d^2)^2+(2ab)^2+(2ac)^2}$$ This new identity giving consequently all the solutions of the proposed equation.