I am trying to find a general solution for $d\left(a+b-c\right) = a^2+b^2-c^2$ with the requirement that all variables are integers.
Obviously $\frac{a^2+b^2-c^2}{a+b-c}$ must an integer, but my understanding is that there must be some constraints on the values of a, b, or c for this to assuredly be the case.
I easily discovered the trivial solution where $a = 1-b+c$, but I'm fairly sure a more general solution exists, albeit with constraints on more than just one unknown. How can I find it?
►Putting $2d$ instead of $d$ we have $(a-d)^2+(b-d)^2=c^2-2cd+2d^2$ so for $c$ and $d$ fixed, $a$ and $b$ are coordinates of points of the circle $(x-d)^2+(y-d)^2=c^2-2cd+2d^2$.
Example.-For $(c,d)=(1,4)$ we have the four integer points $(a,b)=(1,0),(3,0),(4,1),(4,3)$ and the symmetrics respect to the diagonal $y=x$
►►In general we have $(a-d)^2+(b-d)^2=(c-d)^2+d^2$ so each solution $(a,b,c,2d)$ correspond to a solution of the diophantine equation $x^2+y^2=z^2+w^2$ whose general solution is given by the known identity $$(mX+nY)^2+(-nX+mY)^2=(nX+mY)^2+(mX-nY)^2$$ where $m,n,X,Y$ are arbitrary integers.
Consequently we can put as parameterization of the solutions $$\begin{cases}a-d=mX+nY\\b-d=-nX+mY\\c-d=nX+mY\\d=mX-nY\end{cases}\Rightarrow \begin{cases}a=2mX\\b=(m-n)(X+Y)\\c=(m+n)X+(m-n)Y\\d=mX-nY\end{cases}$$ Example.-$(m,n,X,Y)=(3,1,5,11)$ gives $(a,b,c,d)=(30,32,42,4)$ but, keeping in mind that we have by confort put $2d$ instead of $d$ we have the equality of verification $$\frac{30^2+32^2-42^2}{30+32-42}=8$$ We find as quotient $8$ instead of $4$ but this is logic; this is so for any other example of $(m,n,X,Y)$ we chose because we have put $2d$ instead of $d$ at the beginning.