\(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^2\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^4-b^4\right)-\left(2a^3b-2ab^3\right)\)
\(=\left(a^2-b^2\right)\left(a^2+b^2\right)-2ab\left(a^2-b^2\right)\)
\(=\left(a-b\right)\left(a+b\right)\left(a^2+b^2-2ab\right)\)
\(=\left(a-b\right)\left(a+b\right)\left(a-b\right)^2=\left(a-b\right)^3\left(a+b\right)\)