(m+n)^3+2mn(1-m-n)-1
=(m+n)^3-1-2mn(m+n-1)
=(m+n-1)(m^2+mn+n^2)-2mn(m+n-1)
=(m+n-1)(m^2+n^2-mn)
(a^2+a+1)(a^2+a+2)-12
=(a^2+a)^2+3(a^2+a)+2-12
=(a^2+a+5)(a^2+a-2)
=(a^2+a+5)(a+2)(a-1)
12x^4-56x^3+89x^2-56x+12
=(x-2)(12x^3-32x^2+25x-6)
=(x-2)(2x-1)(6x^2-13x+6)
=(x-2)(2x-1)(2x-3)(3x-2)