Solution of $X^2+Y^2=Z^2$ under condition $X+Y+Z=1000$ As we know before the general solution of the equation $x^2+y^2=z^2$ in the number theory is as follows:
$x=\pm(a^2-b^2)c$, $y=\pm 2abc$ and $z=\pm(a^2+b^2)c$.
I want to know how to find a solution for the equation $x^2+y^2=z^2$ under condition $x+y+z=1000$?
A hint would be greatly appreciated. Thanks, Payam

If the solutions you want have to be integer, you can simply add up the formulas for $x, y, z$ under the condition $x^2+y^2=z^2$. For example, let $x=(a^2-b^2)c, y=2abc, z=(a^2+b^2)c$, then $x+y+z=2ac(a+b)=1000\rightarrow ac(a+b)=500=2^2\cdot5^3 $. Since $a,b,c$ need to be integer, we can let $a=2,b=3,c=50$, then we have a solution $x=-250,y=600,z=650$. Other integer solutions can be found in the same way.
Actually, if you allow real solutions, the equations will have infinite solutions. Just let $x=zcos\theta,y=zsin\theta$, this satisfies the first equation. And then, the second equation becomes $z(cos\theta+sin\theta+1)=1000$. Obviously, it has infintely many real solutions.
