TITLE: Solutions for $a^2+b^2+c^2=d^2$
QUESTION [5 upvotes]: I have to find an infinite set for $a,b,c,d$ such that $a^2+b^2+c^2=d^2$ and $a,b,c,d\in\mathbb N$
I have found one possible set which is $x,2x,2x,3x$ and $x\in\mathbb N$
But I want another infinite sets and how to reach them because I have found my solution by hit and trial .

REPLY [6 votes]: It is well known that the identity $(2n)^2+(n^2-1)^2=(n^2+1)^2$ produces a class of Pythagorean Triples. We can apply  the same algorithm twice by replacing $n\to n^2+1$, as $$\color{Green}{(4n)^2+(2(n^2-1))^2+((n^2+1)^2-1)^2=((n^2+1)^2+1)^2}\,\,\,\,\forall n\in\Bbb{N}.$$ In fact this solution has an interesting property which does not holds for others :)
Also there is another similar identity which looks rather simple, $$\color{red}{n^2+(n+1)^2+(n^2+n)^2=(n^2+n+1)^2}\,\,\,\,\forall n\in\Bbb{N}.$$

REPLY [6 votes]: Neater solution. (not obvious where I got formula from)
Note that: $(b^2-a^2)^2+(2ab)^2+(2cd)^2-(c^2+d^2)^2=(a^2+b^2+c^2-d^2)(a^2+b^2-c^2+d^2)$.
So if you have a solution $(a,b,c,d)$ to $a^2+b^2+c^2-d^2=0$ then another solution is:
$$\bigg(b^2-a^2,2ab,2cd,c^2+d^2\bigg)$$
Applying this to your solution $(1,2,2,3)$ gives $(3,4,12,13)$.
Note the order of terms could be juggled around for further applications of this. The only requirement is that $b>a$.
$(3,4,12,13)$ becomes $(24,12,313)$.
$(3,12,4,13)$ becomes $(35,72,104,185)$.
$(4,12,3,13)$ becomes $(128,96,78,178)$.
Ugly Solution. (more obvious where formula comes from)
Pythagoras's theorem is a related problem only involving three terms: $a^2+b^2=c^2$. It has a fundamental solution of $x^2-y^2, 2xy, x^2+y^2$. We can built upon this.
If we tackle your problem $a^2+b^2+c^2=d^2$ then we can start with $a^2+b^2=(x^2-y^2)^2, c=2xy, d=x^2+y^2$. Note that solving $a^2+b^2=(x^2-y^2)^2$ is another case of Pythagoras: $a=k^2-l^2, b=2kl, x^2-y^2=k^2+l^2$. Note that $x^2-y^2=k^2+l^2$ is the same as your original equation to which you have a solution so we can build another from there: $x=3,k=2,l=1,y=2$ (Note we need $k>l$).
So with $k=2,l=1,y=2,x=3$ then we get $a=3,b=4,c=12,d=13$ giving $3^2+4^2+12^2=13^2$.
So in general if you have a solution $(a,b,c,d)$ (with $a<b$) you can form a new solution: $(b^2-a^2,2ab,2cd,c^2+d^2)$.