For x2+7x+12x^2+7x+12x2+7x+12: find two numbers with product 12, sum 7: 3 and 4. So (x+3)(x+4)(x+3)(x+4)(x+3)(x+4).