<s>[INST] How to simplify $(a-b)^2(y-x)+(b-a)(x-y)^2-(b-a)(x-y)$? How to simplify the following?:
$(a-b)^2(y-x)+(b-a)(x-y)^2-(b-a)(x-y)$
I have performed the following, but I think what I have arrived at is not the final step:
$(b-a)((b-a)(y-x)+(x-y)^2-(x-y))$
$ (b-a)((b-a)(y-x)+(y-x)^2+(y-x))$
$ (b-a)((y-x)((b-a)+(y-x)+1)))$
$ (b-a)(y-x)(y+b-a-x+1)$
 [/INST] Adjust the signs and binomials right away:
$$(a-b)^2(y-x)+(b-a)(x-y)^2-(b-a)(x-y)=\\
-(b-a)^2(x-y)+(b-a)(x-y)^2-(b-a)(x-y)=\\
(b-a)(x-y)[-(b-a)+(x-y)-1]=\\
(b-a)(x-y)[x-y+a-b-1]=\\
(a-b)(x-y)(y-x-a+b+1).$$
</s>