You don’t need to assume a height for the rectangle, just call it “H”.

Call the base of the red triangle b1 and the height of the red triangle x1.

Areas of the red and blue triangles total 5, which has to be 0.5*b1*H, so b1 = (10/H).

The area of the red triangle is 2, which is 0.5*x1*b1. Substituting 10/H for b1 lets us get x1 = (4/10)*H

Because the red and white triangles are similar, they both have the same base:height ratio.

The height of the white triangle is (6/10)*H (because the heights of the two triangles must total H), and so the ratio of the heights of the two triangles is 6:4 or just 1.5:1.

The bases must also have the same ratio, so the base of the white triangle (the length of the whole rectangle) is 1.5*(10/H) or 15/H.

Almost done. The area of the entire rectangle is (15/H)*H = 15. Notice at this point that the unknowns have dropped out of the picture - the exact value of H doesn’t matter at all.

Half of 15 is 7.5, which is the area of the red+green segments. The area of the red segment is 2, so the green must be (7.5-2) = 5.5