\(\begin{array}{l}a)\left( {a + b} \right){\left( {a + b} \right)^2}\\ = \left( {a + b} \right)\left( {{a^2} + 2{\rm{a}}b + {b^2}} \right)\\ = {a^3} + 2{{\rm{a}}^2}b + a{b^2} + b{a^2} + 2{\rm{a}}{b^2} + {b^3}\\ = {a^3} + 3{{\rm{a}}^2}b + 3{\rm{a}}{b^3} + {b^3}\end{array}\)
\(\begin{array}{l}b)\left( {a - b} \right){\left( {a - b} \right)^2}\\ = \left( {a - b} \right)\left( {{a^2} - 2{\rm{a}}b + {b^2}} \right)\\ = {a^3} - 2{{\rm{a}}^2}b + a{b^2} - b{a^2} + 2{\rm{a}}{b^2} - {b^3}\\ = {a^3} - 3{{\rm{a}}^2}b + 3{\rm{a}}{b^3} - {b^3}\end{array}\)