How to solve diophantine equation $2a(a+d)=(c-d)(c+d)$ Solve diophantine equation
$2a(a+d)=(c-d)(c+d)$
given $1 \le a < c$ and $1 \le d$
Also Lets say I have the value of $d$ known , how should I express $a$ as a function of it.i.e. $a=f(d)$ ?
My thoughts so far:
$(c-d)$ and $(c+d)$ are integers $2d$ distance apart.To satisfy $2d$ distance condition if one is even other is too and similarly if one is odd other is too.
But to satisfy LHS having $2$ both $(c-d)$ and $(c+d)$ can not be odd so both must be even.
Let $c-d=2k$, then the equation becomes $$2a(a+d)=2k(2k+2d) \implies a(a+d)=2k(k+d)$$
now we have product of two number who are $d$ distance apart on both LHS and RHS but one is twice the other.

I guess the best approach is to use the Pythagorean triple as below:
$$2a(a+d)=(c-d)(c+d)\implies d^2+2ad+2a^2=(d+a)^2+a^2=c^2;$$
hence the solutions should be:
$$a+d=k(m^2-n^2),$$
$$a=k(2mn),$$
$$c=k(m^2+n^2),$$
where $k,m,n$ are integers. Moreover, it should be added that in order to meet the conditions of the problem, $m,n,k$ should be chosen in a particular way; however the general form of the answer is the same.
This link is helpful, I think.


Another situation when $d$ is given;
If $d$ is a constant value, then we should look for $m,n$ such that $m^2-n^2-2mn=d$, hence:
$$m=\frac{2n\pm \sqrt {4n^2+4n^2+4d}}{2}=n\pm \sqrt {2n^2+d}.$$
In this case, according to the given $d$ we just need to look for some $n$ such that $\sqrt {2n^2+d}$ is a square, and this is entirely another problem.
