I need integer solutions of $x^2 + y^2 = z^2 + w^2$ parametrized. Can it be done? Thanks.
-
It’ll help a lot to know how this problem arose [is it homework?]; what level of mathematics you’re familiar with; and what you’ve tried so far. In particular, do you know the parametrization of solutions of $x^2+y^2=z^2$? (By the way, the answer to whether it can be parametrized is Yes.) – Lubin Jan 30 '15 at 13:52
-
It's not homework. It's one of those online programming challenges problem that I sometimes do for fun... One problem got reduced to finding integer solution of such an equation. I'm aware of parametrization of Pythagorean triples. I was trying to do the same, by parametrizing rational solutions on hyperboloid of one sheet, but as I have very limited experience in number theory wrongly chose a, so to speak, sweeping line. Thomas's solutions showed me the right way. :) – user75619 Jan 30 '15 at 14:26
-
The solution there. http://math.stackexchange.com/questions/153603/diophantine-equation-a2b2-c2d2/736164#736164 – individ Jan 30 '15 at 14:34
-
One trivial thing is to note the identity $(ab+cd)^2+(ad-bc)^2=(ab-cd)^2+(ad+bc)^2$. – Jan 30 '15 at 14:37
-
That certainly, is at heart, the source of all the cases, @user170039, by unique factorization on $\mathbb Z[i]$. – Thomas Andrews Jan 30 '15 at 18:29
3 Answers
[Partial solution.]
Look for rational solutions to $$x_1^2+y_1^2-z_1^2=1\tag{1}$$ first.
We know that $p_0=(-1,0,0)$ is a solution. Let $(a,b,c)$ be any set of integers. Then solve $p_0+t(a,b,c)=(x_1,y_1,z_1)$. $(-1+at)^2+(bt)^2-(ct)^2 =1$, or $1-2at+a^2t^2+b^2t^2-c^2t^2=1$ or $2at = a^2t^2+b^2t^2-c^2t^2$. Now, $t=0$ corresponds to $p_0$. Assuming $t\neq 0$, this means:
$$t=\frac{2a}{a^2+b^2-c^2}$$
This means that $$(x_1,y_1,z_1)=\left(\frac{a^2-b^2+c^2}{a^2+b^2-c^2},\frac{2ab}{a^2+b^2-c^2},\frac{2ac}{a^2+b^2-c^2}\right)$$
That gives a complete solution set to $(1)$.
That gives parametric solutions for the original equation:
$$(x,y,z,w)=(a^2-b^2+c^2,2ab,2ac,a^2+b^2-c^2)$$
Note that if $a^2+b^2+c^2$ is even, then all terms are even, so we can divide by $2$, so this doesn't give reduces solutions even when $\gcd(a,b,c)=1$.
Example, $(x,y,z,w)=(8,1,4,7)$. Then $(x_1,y_1,z_1)=\left(\frac{8}{7},\frac{1}{7},\frac{4}{7}\right)$. So $(-1,0,0)+\frac{1}{7}(15,1,4)$ so $(a,b,c)=(15,1,4)$. That yields $$(a^2-b^2+c^2,2ab,2ac,a^2+b^2-c^2)=(240,30,120,210)=30(8,1,4,7).$$

- 177,126
-
Thanks for this. If I’d essayed a response, it would’ve looked very similar. – Lubin Jan 30 '15 at 18:12
-
Well done. Now it remains to find a solution to this equation. $ax^2+by^2=cz^2+jq^2$ Where $a,b,c,j - $ any integer coefficients. Such a formula write? – individ Jan 30 '15 at 18:24
-
Well, that wasn't part of the question, but the same approach works as long as you can find one solution. The trick was to start from a particular rational solution to $ax_1^2+by_1^2-cz^2=j$. Then any rational-sloped line through that solution has (at most) one other solution, and that solution will also be rational. This finds all rational solutions. But you need to find one solution, first. @individ – Thomas Andrews Jan 30 '15 at 18:26
-
And will solve the equations as 1000 years ago? Immediately write the formula. There are cases that we need a formula when you do not know what will be the odds. – individ Jan 30 '15 at 18:30
-
2What are you talking about, @individ. What odds? And what do you mean about 1000 years ago? – Thomas Andrews Jan 30 '15 at 18:31
-
This Diofantos geometry. Known for a very long time. I led the equation with some coefficients. Write a formula solution. And what factors will be the solution? – individ Jan 30 '15 at 18:34
-
Your English is very rusty, to the point of being useless. "I led the equation" doesn't make sense. "And will solve the equations as 1000 years ago?" reads like a question, but it is unclear what the question is. Try to be as direct as possible, don't be obtuse, because your English is, unfortunately, obtuse already. @individ – Thomas Andrews Jan 30 '15 at 18:56
-
@ThomasAndrews The issue has created separately. You can see it there. http://math.stackexchange.com/questions/1127654/parametrization-of-solutions-of-diophantine-equation I hope understand what I mean? – individ Jan 31 '15 at 13:14
\begin{align*} \left(\dfrac{\alpha^2-\beta^2+\gamma^2-\delta^2}{\alpha^2+\beta^2-\gamma^2-\delta^2}\right)^2+\left(\dfrac{2\left(\alpha\beta-\gamma\delta\right)}{\alpha^2+\beta^2-\gamma^2-\delta^2}\right)^2-\left(\dfrac{2\left(\alpha\gamma-\beta\delta\right)}{\alpha^2+\beta^2-\gamma^2-\delta^2}\right)^2=\large{1} \end{align*}
...
@Thomas Andrews

- 897
First let us solve equation $$ xy-zt=0. $$ Let $(x,y,z,t)$ be any solution with $x\neq 0$, and let $u=\text{gcd}(x,z)>0$. Then $x=uv$ and $z=uw$ with $v,w$ coprime and $v\neq 0$. Then $xy-zt=0$ implies that $uvy=uwt$, or $vy=wt$. Because $v$ and $w$ are coprime, this implies that $t$ is divisible by $v$, so we can write $t=vr$ for some integer $r$. Then $vy=w(vr)$, hence $y=wr$. In conclusion, any solution $(x,y,z,t)$ with $x\neq 0$ is representable in the form $$ (x,y,z,t)=(uv,wr,uw,vr) \quad \text{for some integers} \,\, u,v,w,r. $$ If $x=0$, then either (a) $z=0$ and $y,t$ are arbitrary, or (b) $t=0$ and $y,z$ are arbitrary. However, these cases are also covered by the above family: take $u=0$, $r=1$ and $v,w$ arbitrary in case (a) and $v=0$, $w=1$, and $u,r$ arbitrary in case (b).
Now we are ready to solve the equation $$ x^2+y^2=z^2+t^2. $$ If $x$ and $y$ are both even, then $x^2+y^2$ is divisible by $4$, hence so is $z^2+t^2$, which is possible only if $z$ and $t$ are both even. Similarly, if $x$ and $y$ are both odd, then so are $z$ and $t$, and if $x$ and $y$ are of opposite parities, then so are $z$ and $t$. Hence, by permuting $z$ and $t$ if necessary, we may assume that $x$ and $z$ are of the same parity, and so are $y$ and $t$. Then rewrite the equation as $$ \frac{x-z}{2}\cdot \frac{x+z}{2} = \frac{t-y}{2}\cdot \frac{t+y}{2}. $$ Hence $$ \left(\frac{x-z}{2},\frac{x+z}{2},\frac{t-y}{2},\frac{t+y}{2}\right)=(uv,wr,uw,vr) \quad \text{for some integers} \,\, u,v,w,r. $$ Thus, integer solutions to $x^2+y^2=z^2+t^2$ are $$ (x,y,z,t)=\left(wr+uv,vr-uw,wr-uv,vr+uw\right), \quad u,v,w,r \in {\mathbb Z}, $$ as well as the solutions obtained from the above by swapping $z$ and $t$.

- 111