solutions of $a^2+b^2=c^2$ I am trying to figure the following out.
If you have $a^2+b^2=c^2$ and let $x=a/c$ and $y=b/c$
how can you show that 
$x=\frac{m^2-n^2}{m^2+n^2}$ and $y=\frac{2mn}{m^2+n^2}$ for some relatively prime numbers $m,n \in \mathbb{Z}$ 
 A: The substitution turns the problem into finding rational points $(x,y)$ on $$x^2 + y^2 = 1,$$ given any two rational points the line through them will have rational gradiant ($\Delta y/\Delta x$). In fact we have a sort of converse: if you have one point and a line with rational gradiant through that point, then the intersection of it with the circle will have two points (because every quadratic has two roots) both rational (because the conjugate of a rational number is rational).
If we picked $(1,0)$ and intersect the line $y = (m/n)x - m/n$ with the circle $x^2 + y^2 - 1 = 0$ we get $x^2 + ((m/n)x - m/n)^2 - 1 = 0$ which must be divisible by $x-1$ since that is $x=1$ is a root, so after performing the long division we get $x = (m^2 - n^2)/(m^2 + n^2)$, back substituting that gives $y = (-2nm)/(m^2 + n^2)$ thus $(a:b:c) = (m^2-n^2:2mn:m^2+n^2)$ gives all solutions of $a^2 + b^2 = c^2$.
A: As another approach to this famous quesiton, notice that
$a²+b²=c²$ is equivalent with $(a+bi)(a-bi)=cc$, and hence the question turns out to ask for a factorisation of $c²$ in $Z(i)$. Since, in $Z(i)$, the product on the left is a square, by use of the unique factorisation property of the Gaussian numbers, one deduces that $a+bi=(\alpha+\beta i)²$. On expanding this equality, one finds that
$a=\alpha²-\beta²$,
$b=2\alpha\beta$, thus
$c=(a²+b²)^{1/2}=\alpha²+\beta²$.
And this is equivalent with the statement in the question.
Notice that the essential part of this rocedure is the fact that $Z(i)$ is a UFD. This fact could be proved quite easily by observing the Eucklidean algorithm on it. Of course, one could also deploy of all the modern machinery of L-series..., to deduce the same result. It is very welcomed to have this computation as a funny exercise.  
