1. ## A^2+b^2=c^2+d^2

According to Diophantine Equation--2nd Powers -- from Wolfram MathWorld, "Parametric solutions to the 2.2.2 equation $a^2+b^2=c^2+d^2$ are known (Dickson 2005; Guy 1994, p. 140). The number of solutions are given by the sum of squares function $r_2(n)$."

Both of the papers cited are textbooks that I would just as soon not buy. But I can't find any reference to this solution online, presumably because it is new and/or complicated. Does anyone own this book or know of a resource for seeing the proof?

2. Off the top of my head, here is one possible parametric solution in four parameters. I'm quite sure it gives all solutions but I'd have to check.

Note that

$(a+bi)(c+di)=(ac-bd)+(ad+bc)i$

so $(a^2+b^2)(c^2+d^2)=(ac-bd)^2+(ad+bc)^2$

Moreover $(a+bi)(d+ci)=(ad-bc)+(ac+bd)i$

so $(a^2+b^2)(c^2+d^2)=(ad-bc)^2+(ac+bd)^2$

so $(ac-bd)^2+(ad+bc)^2=(ad-bc)^2+(ac+bd)^2$

For instance $a=5,b=8,c=2,d=3$ would yield

$14^2+31^2=1^2+34^2=1157$

3. Yes, the Fibonacci Identity has been useful: $(a^2+b^2)(c^2+d^2)=(ac\pm bd)^2+(ad\mp bc)^2$

Leading to this solution: $(A,B,C,D)=(ad+bc,ac-bd,ad-bc,ac+bd)$

The only two problems I have with this are (1) it maps four variables to four variables, therefore creating lots of overlap, and (2) it is not invertible, there is no way to express (a,b,c,d) in terms of functions of A,B,C,D.

I am looking for something akin to the solution to Pythagorean Triples, that $A^2+B^2=C^2$ is solved wholly and uniquely by $(A,B,C)=(v^2-u^2,2uv,u^2+v^2)$ for all naturals $u, $gcd(u,v)=1$, and $uv$ even.

4. I doubt you will find such a solution, because the function mapping an integer $n$ to the set of of pairs $(a,b)$ such that $a^2+b^2=n$ is essentially a function of the prime factorization of $n$. But perhaps I misunderstand what you mean.

The above parametrization does give all solutions, but you are right in saying that it will cause some of them to be repeated; I'm pretty sure you could find restrictions on $a,b,c,d$ which will exclude repeated solutions.

Anyways, that's all the help I think I can be! Good luck.