a³+b³-a²b-ab² = (а³-а²b)+(b³-ab²) = a²(a-b)+b²(b-a) = a²(a-b)-b²(a-b) = (a-b)(a²-b²) = (a-b)((a+b)(a-b)).
xy²+x²y-x³-y³ = (xy²-y³)+(x²y-x³) = y²(x-y)+x²(y-x) = y²(x-y)-x²(x-y) = (x-y)(y²-x²) = (x-y)((y-x)(y+x)).
n⁴+an³-n-a = (n⁴+an³)-(n+a) = n³(n+a)-(n+a) = (n+a)(n³-1) = (n+a)((n-1)(n²+n+1))