\(\left(a+b\right)^2\left(a+b\right)=\left(a+b\right)^3=a^3+3a^2b+3ab^2+b^3\)
\(\left(a-b\right)^2\left(a-b\right)=\left(a-b\right)^3=a^3-3a^2b+3ab^2-b^3\)
(a+b)2(a+b)
=(a2+2ab+b2)(a+b)
=a(a2+2ab+b2)+b(a2+2ab+b2)
=a3+2a2b+ab2+a2b+2ab2+b3
=a3+3a2+2ab2+b3