Problem Heron of Alexandria.
In Dickson's History of the Theory of Numbers, there are two problems relating perimeter and area of rectangles (not right triangles), the second of which is to find two rectangles of equal perimeter, with the area of the second being 4 times the area of the first. Heron finds a solution for this.
Later Maximus Planude (1260-1310) gave a generalization of Heron's problem above, to find two rectangles of equal perimeter such that their areas have a given ratio b:1. It seems the Planude problem fits with the one you are looking at. Using different letters from yours, with one rectangle of sides $x,y$ and the other with sides $u,v,$ the equal perimeters and area ratio $b:1$ give the equations $$x+y=u+v, \\ x\cdot y = b \cdot u \cdot v.$$ The solution found by M. Cantor was $u=a,\ v=b(b+1)a,$ along with $x=(b+1)a,\ y=b^2a.$ It's easy enough to check that for any value of $b$ this gives a pair of rectangles with the desired properties. Apparently Cantor "noted" that the above gives all the solutions, but in Dicksons footnotes there are some remarks that this may not be all of the solutions. [I myself haven't tried much to see if this solution is complete.]