x^3+x+30
=x^3+27+x+3
=(x+3)(x^2-3x+9)+x+3
=(x+3)(x^2-3x+10)
x^2-4xy+4y^2+7x-14y+12
=(x-2y)^2+7(x-2y)+12
=(x-2y+4)(x-2y+3)