What is known about a^2 + b^2 = c^2 + d^2 Could you state or direct me to results regarding the Diophantine equation $a^2+b^2=c^2+d^2$ over integers? Specifically, I am looking for a complete parametrization. In the case that a complete parametrization does not exist, I would be interested in seeing complete parametrizations for special cases.
For example, in the case that any one of the variables is zero, we are led to Pythagorean triples. Taking a variable to be some non-zero constant would be interesting. I'm looking for known results as I am not as familiar with the literature as many MO-ers out there.
 A: MacKay and Mahajan have a short easy-to-read article expanding on Noam's comment. (pdf link)
Edit (5/14/13): There is a whole bunch of random notes on relationships like this one and others that can be found here: https://sites.google.com/site/tpiezas/003
A: This equation is quite symmetrical so formulas making too much can be written:
So for the equation:
$X^2+Y^2=Z^2+R^2$
solution:
$X=a(p^2+s^2)$
$Y=b(p^2+s^2)$
$Z=a(p^2-s^2)+2psb$
$R=2psa+(s^2-p^2)b$
solution:
$X=p^2-2(a-2b)ps+(2a^2-4ab+3b^2)s^2$
$Y=2p^2-4(a-b)ps+(4a^2-6ab+2b^2)s^2$
$Z=2p^2-2(a-2b)ps+2(b^2-a^2)s^2$
$R=p^2-2(3a-2b)ps+(4a^2-8ab+3b^2)s^2$
solution:
$X=p^2+2(a-2b)ps+(10a^2-4ab-5b^2)s^2$
$Y=2p^2+4(a+b)ps+(20a^2-14ab+2b^2)s^2$
$Z=-2p^2+2(a-2b)ps+(22a^2-16ab-2b^2)s^2$
$R=p^2+2(7a-2b)ps+(4a^2+8ab-5b^2)s^2$
solution:
$X=2(a+b)p^2+2(a+b)ps+(5a-4b)s^2$
$Y=2((2a-b)p^2+2(a+b)ps+(5a-b)s^2)$
$Z=2((a+b)p^2+(7a-2b)ps+(a+b)s^2)$
$R=2(b-2a)p^2+2(a+b)ps+(11a-4b)s^2$
solution:
$X=2(b-a)p^2+2(a-b)ps-as^2$
$Y=2((b-2a)p^2+2(a-b)ps+(b-a)s^2)$
$Z=2((b-a)p^2+(3a-2b)ps-(a-b)s^2)$
$R=2(b-2a)p^2+2(a-b)ps+as^2$
number $a,b,p,s$ integers and sets us, and may be of any sign.
