Is $a^2 + b^2 = c^2 + d^2 = e^2 + f^2$ possible, where a+e=d and b+c=f Here's my problem:
Is $a^2 + b^2 = c^2 + d^2 = e^2 + f^2$ possible where $a$, $b$, $c$, $d$, $e$, and $f$ are all positive integers, and $(a, b)$, $(c, d)$, $(e, f)$ are all distinct pairs ($(3, 4)$ and $(4, 3)$ are same)? I'm not sure if this is a theorem or not, so please let me know the name of the theorem if it is.
Edit: Will this still work if a+e=d and b+c=f?
Thanks for the help! 
 A: Just look for an example. $(7,1),(1,7),(5,5)$ will work, for example.
A: Note that $2=1^2+1^2$ and that a prime $p$ of the form $4n+1$ can be written as a sum of integer squares in essentially one way. eg $5=1^2+2^2, 13=2^2+3^2$. On your method of counting these become two ways.
Then note also that $$(a^2+b^2)(c^2+d^2)=(ac-bd)^2+(ad+bc)^2$$ by simple computation. This is related to $(a+ib)(c+id)=(ac-bd)+i(ad+bc)$ where $i^2=-1$, and that observation enables us to draw on deeper mathematical structure. But for the moment the simple observation is enough.
So, for example, we get $65=5\times 13=1+64=49+16$ by pairing the decomposition differently. That counts as four examples on your counting. Then introduce another factor (eg another $5$, or $17$) and you can continue to build examples where you have as many pairs of squares as you like.
Further examples come once you have a decomposition - you can multiply everything by any square number you choose..
A: Answering the version with the two linear equations added to the system.
Consider the three complex numbers
$$
z_1=b+ai,\quad z_2=c-di,\quad z_3=f-ei.
$$
The quadratic equations imply that $$|z_1|=|z_2|=|z_3|.$$ The linear equations imply that $$z_1+z_2=z_3.$$
So $z_1+z_2=z_3$ has the same length as both $z_1$ and $z_2$. By the law of cosines this implies that the angle between $z_1$ and $z_2$ must be $2\pi/3$.
Let's introduce the ratio
$$
\omega=\frac{z_1}{z_2}.\qquad(*)
$$
We have seen that $|\omega|=1$ and that the argument of $\omega$ is $\pm2\pi/3$.
Therefore
$$
\omega=\frac{-1\pm i\sqrt3}2.
$$
But, by $(*)$, $\omega$ should also be an element of the field $\Bbb{Q}(i)$. This is a contradiction.

There are no (non-trivial) integer solutions to the system of the three quadratic and two linear equations. Positive or not.

