\(a\left(a+2b\right)^3-b\left(2a+b\right)^3\)
\(=a\left(a ^3+3.a^22b+3.a2b^2+2b^3\right)-b\left(2a^3+3.2a^2.b+3.2a.b^2+b^3\right)\)
\(=a\left(a^3+6a^2b+6ab^2+8b^3\right)-b\left(8a^3+6a^2b+6ab^2+b^3\right)\)
\(=a^4+6a^3b+6a^2b^2+8ab^3-8a^3b-6a^2b^2-6ab^3-b^4\)
\(=a^4+6a^3b+8ab^3-8a^3b-6ab^3-b^4\)
\(a\left(a+2b\right)^3-b\left(2a+b\right)^3\)
\(=a\left(a^3+6a^2b+12ab^2+8b^3\right)-b\left(8a^3+12a^2b+6ab^2+b^3\right)\)
\(=a^4+6a^3b+12a^2b^2+8ab^3-8a^3b-12a^2b^2-6ab^3-b^4\)
\(=a^4-2a^3b+2ab^3-b^4\)
\(=\left(a^2-b^2\right)\left(a^2+b^2\right)-2ab\left(a^2-b^2\right)\)
\(=\left(a^2-b^2\right)\left(a^2-2ab+b^2\right)\)
\(=\left(a+b\right)\left(a-b\right)^3\)