How to dissect a pythagorean triple into the smaller squares? For a long time now i have been wondering about the following problem:
Given a pythagorean triple $(x,y,z)$. Say i have a piece of paper in a square shape of $Z^2$.
I want to reconstruct the two smaller squares $X^2$ and $Y^2$ out of the bigger one, by first taking $X^2$ as a whole piece out of $Z^2$ and then dissect the remaining sort of "L" shaped Polygon into disjoint rectangles to construct the missing second square keeping the number of pieces to a minimum.
I'll give a short example for the primitive triple (3,4,5)

At first it looks like, that this construction is always like this, but trying this on different triples it turned out to be way more complicated then this simple example.
Here comes the question:
Given a pythagorean triple $(x,y,z)$. Is there a chance to predetermine the number of pieces i have to dissect the $Z^2$ square to get the smaller two?
 A: In the diagram below (taken from CutTheKnot) the small squares can be reconstructed from 5 pieces cut out of the larger square.

This always works, and I don't know of any dissection using four pieces or less, apart some particular cases.
If, however, you want a dissection of the type outlined in your question, then we can try to find a formula for the number of pieces. We can suppose the sides $a$, $b$ and $c$ of the right triangle to be relatively prime among them (if not, divide them for their GCD) and let $a$ be the odd cathetus, $b$ the even cathetus and  $c$ the hypotenuse. If we define coprime numbers $m$ and $n$ by $m/n=(c+a)/b$, then we have: 
$$
a=m^2-n^2,\quad b=2mn,\quad c=m^2+n^2.
$$ 
As you can see in diagram below, the square remaining to be filled in the L-shaped piece has sides of $2n(m-n)$, while the two rectangles to be cut into pieces have dimensions $2n^2\times (m-n)^2$.
We must then find the minimum number of pieces needed to cover a 
$2n(m-n)\times2n(m-n)$ square using to $2n^2\times (m-n)^2$ rectangles.

