(a-b)(a^2+ab+b^2)+b(a-b)^2-a(a-b)(a+2b)=(a−b)(a^2+ab+b^2)+b(a^2−2ab+b^2)−a(a−b)(a+2b)=a^3+a^2b+ab^2−ba^2−b^2a−b^3+ba^2+b^2(−2)a+b^3+(−a^2+ab)(a+2b)=a^3−ab^2−b^2a+ba^2+(−a^2+ab)(a+2b)=a^3-2ab^2+ba^2+(-a^2+ab)=a
3−2ab^2+ba^2−a^3−2a^2b+a^2b+ab^2 2=ba^2−a^2b.