Distinct integer solutions to $a^2+b^2=c^2+d^2$ I'm trying to find integer solutions to
$$a^2+b^2=c^2+d^2$$
with values  $a> c > d > b>0$
Or in other words, two triangles with integer legs and equal hypotenuse lengths, not necessarily integer. Seems like a Diophantine equation to me, but I only learned how to solve Diophantine equations in the form of Pell's equations. I couldn't find anything on this equation when I checked Wikipedia. It is similar to a Pythagorean quadruple, although not quite, so that's not helpful either. How do I find integer solutions to this?
 A: One way to find some solutions is to rewrite as $a^2-c^2=d^2-b^2$, which in turn becomes $(a-c)(a+c)=(d-b)(d+b)$.
Then choose a number that factors in more than one way and see what you get.
Example: $15=3\cdot 5=1\cdot 15$
Then $15=(4-1)(4+1)=(8-7)(8+7)$.
So take $a=4, b=7, c=1, d=8$
A: HINT.-The general solution of the equation $x^2+y^2=z^2+w^2$ is given by the known enough parametrization with four parameters
$$x=tX+sY\\y=tY-sX\\z=tX-sY\\w=tY+sX$$.
A: $$\implies a^2-c^2=b^2-d^2=N$$
For some $N\in \mathbb{Z}$
If
 $$d_1 d_2=d_3 d_4=N$$
Then 
$$\begin{cases} \begin{align} a&=\frac{d_1 +d_2}{2} \\
c&=\frac{d_1 -d_2}{2} \\
b&=\frac{d_3 +d_4}{2} \\
d&=\frac{d_3 -d_4}{2} \\
\end{align} \end{cases}$$
What's needed is that $(d_1,d_2)$ need to be of the same parity and $(d_3,d_4)$ need to be of the same parity. 
This answer is of the same spirit as paw88789
A: Strong Hint:
$$\begin{align} a^2 + b^2 &= c^2 + d^2 \\ \implies a^2 + b^2 - c^2 &= d^2 \\ \implies a^2 + (b + c)(b - c) &= d^2 \\ \implies (b + c)(b - c) &= d^2 - a^2 \\ \implies (b + c)(b - c) &= (d + a)(d - a) \end{align}$$.
$$\therefore a^2 + b^2 \neq \{p : p = \text{prime number}\} \iff a^2 + b^2 = c^2 + d^2$$
Now what separates a prime number from any other (composite) number?

Solution to finding distinct integer solutions:
$$a^2 + b^2 = c^2 + d^2 = \{n \iff d(n) \geq 4 : d(n) = \text{number of divisors of $n$}, \ \forall n\in \mathbb{R}\}$$
A: First note that in the equation $a^2+b^2=c^2+d^2 (*)$ you can adjust the signs of the variables, which can thus be taken in $\mathbf Z$ in order to work in the Gaussian ring $\mathbf Z[i]$. Denoting by $N$ the norm map of $\mathbf Q(i)/\mathbf Q$, one can write $(*)$ as $N(a+ib)=N(c+id)$, or $(a+ib)=u(c+id)$, with $N(u)=1$. Every $u \in \mathbf Q(i)$ having norm $1$ is of the form $(e+if)/(e-if)$, where $e,f $ can be taken in $\mathbf Z$ for reasons of homogeneity. By developping the products in the equation $(a+ib)(e-if)=(c+id)(e+if)$, one gets immediately the following parametrization of the solutions of $(*)$ : $(a, b, c, d)=(AE+BF, BE-AF, CE-DF, DE+CF))$, with $A, B, C, D, E, F \in \mathbf Z$.
Note that this kind of problem can be generalized to $N_{1}(z_1)=\lambda N_2(z_2)$, where the $N_h$'s are the norm maps of two quadratic fields, see e.g. For which values of $a\in\mathbb{Q}$ does integer solutions to $x^2+x+1=a(y^2+1)$ exist?
