a(a-b)³+2a²(a-b)²-2ab(b-a)
= a(a-b)³+2a²(a-b)²+2ab(a-b)
=a(a-b)[(a-b)²+2a(a-b)+2b]
=a(a-b)(a²+b²-2ab+2a²-2ab+2b)
=a(a-b)(3a²+b²-4ab-2b)
a(a-b)³+2a²(a-b)²-2ab(b-a)
= a(a-b)³+2a²(a-b)²+2ab(a-b)
=a(a-b)[(a-b)²+2a(a-b)+2b]
=a(a-b)(a²+b²-2ab+2a²-2ab+2b)
=a(a-b)(3a²+b²-4ab-2b)