I worked this out algebraically
Let the little squares be x*x and the big ones are y*y so the long ones are x*y
Ths sum of the areas is
\(10x^2+9xy+2y^2\\ \)
I want two numbers that multiply to 10*2=20 and add to 9 Those numbers are 4 and 5
\(10x^2+9xy+2y^2\\ =10x^2+5xy+4xy+2y^2\\ =5x(2x+y)+2y(2x+y)\\ =(5x+2y)(2x+y)\\\)
So one side is 5x+2y long and the other is 2x+y long
Now it is quite easy. If you have problems then assign a number to x and to y.
I chose 1 and 7 but any numbers that have only 1 as a factor will do.
People ususally find it easier to deal with real numbers instead of with pronumerals