<s>[INST] Find all positive integers s.t. $\frac{1}{a^2} - \frac{1}{b^2} = \frac{1}{c^2} - \frac{1}{d^2}$ Find all positive integers $a, b, c, d$ such that :
$$\frac{1}{a^2} - \frac{1}{b^2} = \frac{1}{c^2} - \frac{1}{d^2}$$
The original problem came from atomic electron transitions :

I would like to find out non-trivial positive integer solutions; since it is trivial if $a = b$ and $c = d$, or $a = c$ and $b = d$.
I found some of the solutions, and they look like :

There is some pattern in these integers, but it seems difficult to obtain a gerneralized form of the solution.
 [/INST] (Remark: The following is inspired by Equation of 1/x^2 on AoPS. However, a bit more work is needed to characterize all solutions of the given equation. It does not suffice to start with Pythagorean triples.)
Let $a, b, c, d$ be positive integers satisfying
$$ \tag{$1$}
\frac{1}{a^2} - \frac{1}{b^2} = \frac{1}{c^2} - \frac{1}{d^2} \, .
$$
By replacing $(a, b, c, d)$ with $(c, d, a, b)$ or $(a, c, b, d)$, if necessary, we can assume that $a \le b \le c \le d$, and actually $a < b \le c < d$ since we want to exclude the “trivial solutions.” By dividing all numbers by $\gcd(a, b, c, d)$ we can also assume that $a, b, c, d$ have no factor in common.
I'll call $(a, b, c, d)$ a “primitive solution” of $(1)$ if $a < b \le c < d$ and $\gcd(a, b, c, d) = 1$.
Now let $(a, b, c, d)$ be a primitive solution of $(1)$ and let $l = \operatorname{lcm}(a, b, c, d) $ be their least common multiple. Then
$$
 (x, y, z, t) = \left( \frac la, \frac lb,\frac lc,\frac ld\right)
$$
is a quadruple of positive integers satisfying
$$ \tag{$2$}
x^2-y^2 = z^2-t^2 \, .
$$
It is also not difficult to see that $x > y \ge z > t$ and $\gcd(x, y, z, t) = 1$. I'll call that a “primitive solution” of $(2)$.
So a primitive solution of $(1)$ leads to a primitive solution of $(2)$.
But the converse is also true: If $(x, y, z, t)$ is a primitive solution of $(2)$ and $L = \operatorname{lcm}(x, y, z, t) $ their least common multiple then
$$
 (a, b, c, d) = \left( \frac Lx, \frac Ly,\frac Lz,\frac Lt\right)
$$
is a primitive solution of $(1)$.
Therefore it suffices to determine all primitive solutions of $(2)$. Writing that equation in the form
$$ \tag{$*$}
 x^2 + t^2 = y^2 + z^2 
$$
shows that this task amounts to find positive integers which can be represented in two (or more) ways as the sum of two squares. The smallest integer with this property is $N=50$, compare https://oeis.org/A007692.
Example: $50 = 1^2+7^2 = 5^2+5^2$, so $(x, y, z, t) = (7, 5, 5, 1)$ is a primitive solution of $(2)$ with least common multiple $L=35$. This gives the solution
$$
 \frac{1}{5^2} - \frac{1}{7^2} = \frac{1}{7^2} - \frac{1}{35^2} \, .
$$
So a recipe to compute all primitive solutions of $(1)$ could look like this:

*

*Enumerate the positive integers $N$ which can be represented as the sum of two squares. The Sum of two squares theorem can help to find these numbers efficiently.

*For each such number $N$, determine all pairs $(u_i, v_i)$ of non-zero integers such that $u_i^2+v_i^2 = N$.

*If there are at least two such pairs, try all combinations  $(u_i, u_j, v_j, v_i)$ with $i \ne j$.

*If $u_i > u_j \ge v_j > v_i$ and $\gcd(u_i, u_j, v_j, v_i) = 1$ then
$$
 (a, b, c, d) = \left( \frac L{u_i}, \frac L{u_j},\frac L{v_j},\frac L{u_i}\right)
$$
with $L = \operatorname{lcm}(u_i, u_j, v_j, v_i)$ is a primitive solution of $(1)$.

</s>