The areas of the smaller rectangles:
[tex]A_A=3\cdot x=3x\\A_B=3\cdot7=21\\A_C=x\cdot x=x^2\\A_D=x\cdot7=7x[/tex]
The area of the large rectangle:
[tex]A=(3+x)(x+7)[/tex]
The area of the large rectangle is equal of the sum of the areas of the smaller rectangle. Therefore:
[tex]A=A_A+A_B+A_C+A_D\\\\(3+x)(x+7)=3\cdot x+3\cdot7+x\cdot x+x\cdot7\\\\(3+x)(x+7)=3x+21+x^2+7x[/tex]
It's the distributive property:
[tex]a(b+c)=ab+ac[/tex]
replace [tex](3 + x)[/tex] in [tex](3 + x)(x + 7)[/tex] by A , giving [tex]A(x + 7)[/tex].
Then the formula
[tex]A(x+7)=Ax+A7[/tex]
gives, on back-substitution, the formula
[tex](3 + x)(x + 7)=(3+x)x+(3+x)7=3x+x^2+21+7x=3x+21+x^2+7x[/tex]