Explanation:
since im typing it out its neater to seperately do left side expression and right side expression
(a+b)(a+2ab) = a(a+2ab) + b(a+2ab) (expansion of terms)
=a^2 +2a^2b + ab + 2ab^2 (remember order of algebraic terms doesnt matter so for instance ab=ba)
other side
(2a-b)(a-b) = 2a(a-b) -b(a-b)
=2a^2 -2ab -ab +b^2 (remember -b x -b = b^2, negatives cancel out when they multiply by each other)
if you want to present this on paper, you would have done the both expansions in one line, to reach this line
.
.
.
= a^2 + 2a^2b + ab + 2ab^2 + 2a^2 -2ab -ab +b^2
=3a^2 + b^2 -2ab + 2a^2b + 2ab^2